max98506.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Platform data for MAX98506
  3. *
  4. * Copyright 2013-2015 Maxim Integrated Products
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. */
  12. #ifndef __SOUND_MAX98506_PDATA_H__
  13. #define __SOUND_MAX98506_PDATA_H__
  14. #define MAX98506_I2C_ADDR 0x62
  15. #define MAX98506_I2C_ADDR_S (MAX98506_I2C_ADDR >> 1)
  16. /* MAX98506 volume step */
  17. #define MAX98506_VSTEP_0 0
  18. #define MAX98506_VSTEP_1 1
  19. #define MAX98506_VSTEP_2 2
  20. #define MAX98506_VSTEP_3 3
  21. #define MAX98506_VSTEP_4 4
  22. #define MAX98506_VSTEP_5 5
  23. #define MAX98506_VSTEP_6 6
  24. #define MAX98506_VSTEP_7 7
  25. #define MAX98506_VSTEP_8 8
  26. #define MAX98506_VSTEP_9 9
  27. #define MAX98506_VSTEP_10 10
  28. #define MAX98506_VSTEP_11 11
  29. #define MAX98506_VSTEP_12 12
  30. #define MAX98506_VSTEP_13 13
  31. #define MAX98506_VSTEP_14 14
  32. #define MAX98506_VSTEP_15 15
  33. #define MAX98506_VSTEP_MAX MAX98506_VSTEP_15
  34. /* MAX98506 one stop mode */
  35. enum one_stop_mode {
  36. MAX98506_OSM_STEREO = 0,
  37. MAX98506_OSM_MONO_L,
  38. MAX98506_OSM_MONO_R,
  39. MAX98506_OSM_RCV_L,
  40. MAX98506_OSM_RCV_R,
  41. MAX98506_OSM_MAX,
  42. };
  43. #ifdef CONFIG_SND_SOC_MAXIM_DSM_CAL
  44. extern struct class *g_class;
  45. #else
  46. struct class *g_class;
  47. #endif /* CONFIG_SND_SOC_MAXIM_DSM_CAL */
  48. struct max98506_volume_step_info {
  49. int length;
  50. int vol_step;
  51. int adc_thres;
  52. int boost_step[MAX98506_VSTEP_MAX + 1];
  53. bool adc_status;
  54. };
  55. struct max98506_pc_active {
  56. u32 capture_active;
  57. u32 playback_active:1;
  58. };
  59. #define MAX98506_PINFO_SZ 6
  60. struct max98506_pdata {
  61. int sysclk;
  62. u32 spk_gain;
  63. u32 vmon_slot;
  64. bool i2c_pull_up;
  65. #ifdef USE_MAX98506_IRQ
  66. int irq;
  67. #endif /* USE_MAX98506_IRQ */
  68. uint32_t pinfo[MAX98506_PINFO_SZ];
  69. const uint32_t *reg_arr;
  70. uint32_t reg_arr_len;
  71. int sub_reg;
  72. int interleave;
  73. int osm;
  74. uint32_t boostv;
  75. };
  76. #endif /* __SOUND_MAX98506_PDATA_H__ */