currentVarianceCalculation.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /* Speyside modules for Cragganmore - board data probing
  2. *
  3. * Copyright 2011 Wolfson Microelectronics plc
  4. * Mark Brown <broonie@opensource.wolfsonmicro.com>
  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. #include <linux/export.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/i2c.h>
  13. #include <linux/spi/spi.h>
  14. #include <linux/mfd/wm831x/irq.h>
  15. #include <linux/mfd/wm831x/gpio.h>
  16. #include <linux/mfd/wm8994/pdata.h>
  17. #include <linux/mfd/arizona/pdata.h>
  18. #include <linux/regulator/machine.h>
  19. #include <sound/wm0010.h>
  20. #include <sound/wm2200.h>
  21. #include <sound/wm5100.h>
  22. #include <sound/wm8996.h>
  23. #include <sound/wm8962.h>
  24. #include <sound/wm9081.h>
  25. #include <linux/platform_data/spi-s3c64xx.h>
  26. #include <mach/crag6410.h>
  27. static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = {
  28. .line = S3C64XX_GPC(3),
  29. };
  30. static struct wm0010_pdata wm0010_pdata = {
  31. .gpio_reset = S3C64XX_GPN(6),
  32. .reset_active_high = 1, /* Active high for Glenfarclas Rev 2 */
  33. };
  34. static struct spi_board_info wm1253_devs[] = {
  35. [0] = {
  36. .modalias = "wm0010",
  37. .max_speed_hz = 26 * 1000 * 1000,
  38. .bus_num = 0,
  39. .chip_select = 0,
  40. .mode = SPI_MODE_0,
  41. .irq = S3C_EINT(4),
  42. .controller_data = &wm0010_spi_csinfo,
  43. .platform_data = &wm0010_pdata,
  44. },
  45. };
  46. static struct spi_board_info balblair_devs[] = {
  47. [0] = {
  48. .modalias = "wm0010",
  49. .max_speed_hz = 26 * 1000 * 1000,
  50. .bus_num = 0,
  51. .chip_select = 0,
  52. .mode = SPI_MODE_0,
  53. .irq = S3C_EINT(4),
  54. .controller_data = &wm0010_spi_csinfo,
  55. .platform_data = &wm0010_pdata,
  56. },
  57. };
  58. static struct wm5100_pdata wm5100_pdata = {
  59. .ldo_ena = S3C64XX_GPN(7),
  60. .irq_flags = IRQF_TRIGGER_HIGH,
  61. .gpio_base = CODEC_GPIO_BASE,
  62. .in_mode = {
  63. WM5100_IN_DIFF,
  64. WM5100_IN_DIFF,
  65. WM5100_IN_DIFF,
  66. WM5100_IN_SE,
  67. },
  68. .hp_pol = CODEC_GPIO_BASE + 3,
  69. .jack_modes = {
  70. { WM5100_MICDET_MICBIAS3, 0, 0 },
  71. { WM5100_MICDET_MICBIAS2, 1, 1 },
  72. },
  73. .gpio_defaults = {
  74. 0,
  75. 0,
  76. 0,
  77. 0,
  78. 0x2, /* IRQ: CMOS output */
  79. 0x3, /* CLKOUT: CMOS output */
  80. },
  81. };
  82. static struct wm8996_retune_mobile_config wm8996_retune[] = {
  83. {
  84. .name = "Sub LPF",
  85. .rate = 48000,
  86. .regs = {
  87. 0x6318, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
  88. 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
  89. 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
  90. },
  91. },
  92. {
  93. .name = "Sub HPF",
  94. .rate = 48000,
  95. .regs = {
  96. 0x000A, 0x6300, 0x1000, 0x0000, 0x0004, 0x2000, 0xF000,
  97. 0x0000, 0x0004, 0x2000, 0xF000, 0x0000, 0x0004, 0x2000,
  98. 0xF000, 0x0000, 0x0004, 0x1000, 0x0800, 0x4000
  99. },
  100. },
  101. };
  102. static struct wm8996_pdata wm8996_pdata __initdata = {
  103. .ldo_ena = S3C64XX_GPN(7),
  104. .gpio_base = CODEC_GPIO_BASE,
  105. .micdet_def = 1,
  106. .inl_mode = WM8996_DIFFERRENTIAL_1,
  107. .inr_mode = WM8996_DIFFERRENTIAL_1,
  108. .irq_flags = IRQF_TRIGGER_RISING,
  109. .gpio_default = {
  110. 0x8001, /* GPIO1 == ADCLRCLK1 */
  111. 0x8001, /* GPIO2 == ADCLRCLK2, input due to CPU */
  112. 0x0141, /* GPIO3 == HP_SEL */
  113. 0x0002, /* GPIO4 == IRQ */
  114. 0x020e, /* GPIO5 == CLKOUT */
  115. },
  116. .retune_mobile_cfgs = wm8996_retune,
  117. .num_retune_mobile_cfgs = ARRAY_SIZE(wm8996_retune),
  118. };
  119. static struct wm8962_pdata wm8962_pdata __initdata = {
  120. .gpio_init = {
  121. 0,
  122. WM8962_GPIO_FN_OPCLK,
  123. WM8962_GPIO_FN_DMICCLK,
  124. 0,
  125. 0x8000 | WM8962_GPIO_FN_DMICDAT,
  126. WM8962_GPIO_FN_IRQ, /* Open drain mode */
  127. },
  128. .in4_dc_measure = true,
  129. };
  130. static struct wm9081_pdata wm9081_pdata __initdata = {
  131. .irq_high = false,
  132. .irq_cmos = false,
  133. };
  134. static const struct i2c_board_info wm1254_devs[] = {
  135. { I2C_BOARD_INFO("wm8996", 0x1a),
  136. .platform_data = &wm8996_pdata,
  137. .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
  138. },
  139. { I2C_BOARD_INFO("wm9081", 0x6c),
  140. .platform_data = &wm9081_pdata, },
  141. };
  142. static const struct i2c_board_info wm1255_devs[] = {
  143. { I2C_BOARD_INFO("wm5100", 0x1a),
  144. .platform_data = &wm5100_pdata,
  145. .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
  146. },
  147. { I2C_BOARD_INFO("wm9081", 0x6c),
  148. .platform_data = &wm9081_pdata, },
  149. };
  150. static const struct i2c_board_info wm1259_devs[] = {
  151. { I2C_BOARD_INFO("wm8962", 0x1a),
  152. .platform_data = &wm8962_pdata,
  153. .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
  154. },
  155. };