max98371.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * max98371.h -- MAX98371 ALSA SoC Audio driver
  3. *
  4. * Copyright 2011-2012 Maxim Integrated Products
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _MAX98371_H
  11. #define _MAX98371_H
  12. #define MAX98371_IRQ_CLEAR1 0x01
  13. #define MAX98371_IRQ_CLEAR2 0x02
  14. #define MAX98371_IRQ_CLEAR3 0x03
  15. #define MAX98371_DAI_CLK 0x10
  16. #define MAX98371_DAI_BSEL_MASK 0xF
  17. #define MAX98371_DAI_BSEL_32 2
  18. #define MAX98371_DAI_BSEL_48 3
  19. #define MAX98371_DAI_BSEL_64 4
  20. #define MAX98371_SPK_SR 0x11
  21. #define MAX98371_SPK_SR_MASK 0xF
  22. #define MAX98371_SPK_SR_32 6
  23. #define MAX98371_SPK_SR_44 7
  24. #define MAX98371_SPK_SR_48 8
  25. #define MAX98371_SPK_SR_88 10
  26. #define MAX98371_SPK_SR_96 11
  27. #define MAX98371_DAI_CHANNEL 0x15
  28. #define MAX98371_CHANNEL_MASK 0x3
  29. #define MAX98371_MONOMIX_SRC 0x18
  30. #define MAX98371_MONOMIX_CFG 0x19
  31. #define MAX98371_HPF 0x1C
  32. #define MAX98371_MONOMIX_SRC_MASK 0xFF
  33. #define MONOMIX_RX_0_1 ((0x1)<<(4))
  34. #define M98371_DAI_CHANNEL_I2S 0x3
  35. #define MAX98371_DIGITAL_GAIN 0x2D
  36. #define MAX98371_DIGITAL_GAIN_WIDTH 0x7
  37. #define MAX98371_GAIN 0x2E
  38. #define MAX98371_GAIN_SHIFT 0x4
  39. #define MAX98371_GAIN_WIDTH 0x4
  40. #define MAX98371_DHT_MAX_WIDTH 4
  41. #define MAX98371_FMT 0x14
  42. #define MAX98371_CHANSZ_WIDTH 6
  43. #define MAX98371_FMT_MASK ((0x3)<<(MAX98371_CHANSZ_WIDTH))
  44. #define MAX98371_FMT_MODE_MASK ((0x7)<<(3))
  45. #define MAX98371_DAI_LEFT ((0x1)<<(3))
  46. #define MAX98371_DAI_RIGHT ((0x2)<<(3))
  47. #define MAX98371_DAI_CHANSZ_16 ((1)<<(MAX98371_CHANSZ_WIDTH))
  48. #define MAX98371_DAI_CHANSZ_24 ((2)<<(MAX98371_CHANSZ_WIDTH))
  49. #define MAX98371_DAI_CHANSZ_32 ((3)<<(MAX98371_CHANSZ_WIDTH))
  50. #define MAX98371_DHT 0x32
  51. #define MAX98371_DHT_STEP 0x3
  52. #define MAX98371_DHT_GAIN 0x31
  53. #define MAX98371_DHT_GAIN_WIDTH 0x4
  54. #define MAX98371_DHT_ROT_WIDTH 0x4
  55. #define MAX98371_SPK_ENABLE 0x4A
  56. #define MAX98371_GLOBAL_ENABLE 0x50
  57. #define MAX98371_SOFT_RESET 0x51
  58. #define MAX98371_VERSION 0xFF
  59. struct max98371_priv {
  60. struct regmap *regmap;
  61. struct snd_soc_codec *codec;
  62. };
  63. #endif