madera-pdata.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Platform data for Madera codec driver
  4. *
  5. * Copyright (C) 2016-2019 Cirrus Logic, Inc. and
  6. * Cirrus Logic International Semiconductor Ltd.
  7. */
  8. #ifndef MADERA_CODEC_PDATA_H
  9. #define MADERA_CODEC_PDATA_H
  10. #include <linux/types.h>
  11. #define MADERA_MAX_INPUT 6
  12. #define MADERA_MAX_MUXED_CHANNELS 4
  13. #define MADERA_MAX_OUTPUT 6
  14. #define MADERA_MAX_AIF 4
  15. #define MADERA_MAX_PDM_SPK 2
  16. #define MADERA_MAX_DSP 7
  17. /**
  18. * struct madera_codec_pdata
  19. *
  20. * @max_channels_clocked: Maximum number of channels that I2S clocks will be
  21. * generated for. Useful when clock master for systems
  22. * where the I2S bus has multiple data lines.
  23. * @dmic_ref: Indicates how the MICBIAS pins have been externally
  24. * connected to DMICs on each input. A value of 0
  25. * indicates MICVDD and is the default. Other values are:
  26. * For CS47L35 one of the CS47L35_DMIC_REF_xxx values
  27. * For all other codecs one of the MADERA_DMIC_REF_xxx
  28. * Also see the datasheet for a description of the
  29. * INn_DMIC_SUP field.
  30. * @inmode: Mode for the ADC inputs. One of the MADERA_INMODE_xxx
  31. * values. Two-dimensional array
  32. * [input_number][channel number], with four slots per
  33. * input in the order
  34. * [n][0]=INnAL [n][1]=INnAR [n][2]=INnBL [n][3]=INnBR
  35. * @out_mono: For each output set the value to TRUE to indicate that
  36. * the output is mono. [0]=OUT1, [1]=OUT2, ...
  37. * @pdm_fmt: PDM speaker data format. See the PDM_SPKn_FMT field in
  38. * the datasheet for a description of this value.
  39. * @pdm_mute: PDM mute format. See the PDM_SPKn_CTRL_1 register
  40. * in the datasheet for a description of this value.
  41. */
  42. struct madera_codec_pdata {
  43. u32 max_channels_clocked[MADERA_MAX_AIF];
  44. u32 dmic_ref[MADERA_MAX_INPUT];
  45. u32 inmode[MADERA_MAX_INPUT][MADERA_MAX_MUXED_CHANNELS];
  46. bool out_mono[MADERA_MAX_OUTPUT];
  47. u32 pdm_fmt[MADERA_MAX_PDM_SPK];
  48. u32 pdm_mute[MADERA_MAX_PDM_SPK];
  49. };
  50. #endif