soc.h 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. /*
  2. * linux/sound/soc.h -- ALSA SoC Layer
  3. *
  4. * Author: Liam Girdwood
  5. * Created: Aug 11th 2005
  6. * Copyright: Wolfson Microelectronics. PLC.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __LINUX_SND_SOC_H
  13. #define __LINUX_SND_SOC_H
  14. #include <linux/platform_device.h>
  15. #include <linux/types.h>
  16. #include <linux/notifier.h>
  17. #include <linux/workqueue.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/kernel.h>
  20. #include <linux/regmap.h>
  21. #include <sound/core.h>
  22. #include <sound/pcm.h>
  23. #include <sound/control.h>
  24. #include <sound/ac97_codec.h>
  25. /*
  26. * Convenience kcontrol builders
  27. */
  28. #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \
  29. ((unsigned long)&(struct soc_mixer_control) \
  30. {.reg = xreg, .rreg = xreg, .shift = shift_left, \
  31. .rshift = shift_right, .max = xmax, .platform_max = xmax, \
  32. .invert = xinvert})
  33. #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \
  34. SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert)
  35. #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
  36. ((unsigned long)&(struct soc_mixer_control) \
  37. {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
  38. #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \
  39. ((unsigned long)&(struct soc_mixer_control) \
  40. {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
  41. .max = xmax, .platform_max = xmax, .invert = xinvert})
  42. #define SOC_SINGLE(xname, reg, shift, max, invert) \
  43. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  44. .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
  45. .put = snd_soc_put_volsw, \
  46. .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
  47. #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
  48. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  49. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
  50. SNDRV_CTL_ELEM_ACCESS_READWRITE,\
  51. .tlv.p = (tlv_array), \
  52. .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
  53. .put = snd_soc_put_volsw, \
  54. .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
  55. #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
  56. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
  57. .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
  58. .put = snd_soc_put_volsw, \
  59. .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
  60. max, invert) }
  61. #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
  62. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
  63. .info = snd_soc_info_volsw, \
  64. .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
  65. .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
  66. xmax, xinvert) }
  67. #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \
  68. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
  69. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
  70. SNDRV_CTL_ELEM_ACCESS_READWRITE,\
  71. .tlv.p = (tlv_array), \
  72. .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
  73. .put = snd_soc_put_volsw, \
  74. .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
  75. max, invert) }
  76. #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
  77. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
  78. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
  79. SNDRV_CTL_ELEM_ACCESS_READWRITE,\
  80. .tlv.p = (tlv_array), \
  81. .info = snd_soc_info_volsw, \
  82. .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
  83. .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
  84. xmax, xinvert) }
  85. #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
  86. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
  87. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
  88. SNDRV_CTL_ELEM_ACCESS_READWRITE, \
  89. .tlv.p = (tlv_array), \
  90. .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \
  91. .put = snd_soc_put_volsw_s8, \
  92. .private_value = (unsigned long)&(struct soc_mixer_control) \
  93. {.reg = xreg, .min = xmin, .max = xmax, \
  94. .platform_max = xmax} }
  95. #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \
  96. { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
  97. .max = xmax, .texts = xtexts }
  98. #define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \
  99. SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts)
  100. #define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \
  101. { .max = xmax, .texts = xtexts }
  102. #define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xmax, xtexts, xvalues) \
  103. { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
  104. .mask = xmask, .max = xmax, .texts = xtexts, .values = xvalues}
  105. #define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xmax, xtexts, xvalues) \
  106. SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xmax, xtexts, xvalues)
  107. #define SOC_ENUM(xname, xenum) \
  108. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
  109. .info = snd_soc_info_enum_double, \
  110. .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
  111. .private_value = (unsigned long)&xenum }
  112. #define SOC_VALUE_ENUM(xname, xenum) \
  113. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
  114. .info = snd_soc_info_enum_double, \
  115. .get = snd_soc_get_value_enum_double, \
  116. .put = snd_soc_put_value_enum_double, \
  117. .private_value = (unsigned long)&xenum }
  118. #define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
  119. xhandler_get, xhandler_put) \
  120. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  121. .info = snd_soc_info_volsw, \
  122. .get = xhandler_get, .put = xhandler_put, \
  123. .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
  124. #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\
  125. xhandler_get, xhandler_put) \
  126. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
  127. .info = snd_soc_info_volsw, \
  128. .get = xhandler_get, .put = xhandler_put, \
  129. .private_value = \
  130. SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) }
  131. #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
  132. xhandler_get, xhandler_put, tlv_array) \
  133. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  134. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
  135. SNDRV_CTL_ELEM_ACCESS_READWRITE,\
  136. .tlv.p = (tlv_array), \
  137. .info = snd_soc_info_volsw, \
  138. .get = xhandler_get, .put = xhandler_put, \
  139. .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
  140. #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
  141. xhandler_get, xhandler_put, tlv_array) \
  142. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
  143. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
  144. SNDRV_CTL_ELEM_ACCESS_READWRITE, \
  145. .tlv.p = (tlv_array), \
  146. .info = snd_soc_info_volsw, \
  147. .get = xhandler_get, .put = xhandler_put, \
  148. .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \
  149. xmax, xinvert) }
  150. #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\
  151. xhandler_get, xhandler_put, tlv_array) \
  152. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
  153. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
  154. SNDRV_CTL_ELEM_ACCESS_READWRITE, \
  155. .tlv.p = (tlv_array), \
  156. .info = snd_soc_info_volsw, \
  157. .get = xhandler_get, .put = xhandler_put, \
  158. .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
  159. xmax, xinvert) }
  160. #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
  161. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  162. .info = snd_soc_info_bool_ext, \
  163. .get = xhandler_get, .put = xhandler_put, \
  164. .private_value = xdata }
  165. #define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \
  166. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  167. .info = snd_soc_info_enum_ext, \
  168. .get = xhandler_get, .put = xhandler_put, \
  169. .private_value = (unsigned long)&xenum }
  170. #define SOC_DOUBLE_R_SX_TLV(xname, xreg_left, xreg_right, xshift,\
  171. xmin, xmax, tlv_array) \
  172. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
  173. .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
  174. SNDRV_CTL_ELEM_ACCESS_READWRITE, \
  175. .tlv.p = (tlv_array), \
  176. .info = snd_soc_info_volsw_2r_sx, \
  177. .get = snd_soc_get_volsw_2r_sx, \
  178. .put = snd_soc_put_volsw_2r_sx, \
  179. .private_value = (unsigned long)&(struct soc_mixer_control) \
  180. {.reg = xreg_left, \
  181. .rreg = xreg_right, .shift = xshift, \
  182. .min = xmin, .max = xmax} }
  183. #define SND_SOC_BYTES(xname, xbase, xregs) \
  184. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  185. .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
  186. .put = snd_soc_bytes_put, .private_value = \
  187. ((unsigned long)&(struct soc_bytes) \
  188. {.base = xbase, .num_regs = xregs }) }
  189. #define SND_SOC_BYTES_MASK(xname, xbase, xregs, xmask) \
  190. { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
  191. .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
  192. .put = snd_soc_bytes_put, .private_value = \
  193. ((unsigned long)&(struct soc_bytes) \
  194. {.base = xbase, .num_regs = xregs, \
  195. .mask = xmask }) }
  196. /*
  197. * Simplified versions of above macros, declaring a struct and calculating
  198. * ARRAY_SIZE internally
  199. */
  200. #define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \
  201. struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
  202. ARRAY_SIZE(xtexts), xtexts)
  203. #define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \
  204. SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts)
  205. #define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \
  206. struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts)
  207. #define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \
  208. struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
  209. ARRAY_SIZE(xtexts), xtexts, xvalues)
  210. #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
  211. SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
  212. /*
  213. * Component probe and remove ordering levels for components with runtime
  214. * dependencies.
  215. */
  216. #define SND_SOC_COMP_ORDER_FIRST -2
  217. #define SND_SOC_COMP_ORDER_EARLY -1
  218. #define SND_SOC_COMP_ORDER_NORMAL 0
  219. #define SND_SOC_COMP_ORDER_LATE 1
  220. #define SND_SOC_COMP_ORDER_LAST 2
  221. /*
  222. * Bias levels
  223. *
  224. * @ON: Bias is fully on for audio playback and capture operations.
  225. * @PREPARE: Prepare for audio operations. Called before DAPM switching for
  226. * stream start and stop operations.
  227. * @STANDBY: Low power standby state when no playback/capture operations are
  228. * in progress. NOTE: The transition time between STANDBY and ON
  229. * should be as fast as possible and no longer than 10ms.
  230. * @OFF: Power Off. No restrictions on transition times.
  231. */
  232. enum snd_soc_bias_level {
  233. SND_SOC_BIAS_OFF = 0,
  234. SND_SOC_BIAS_STANDBY = 1,
  235. SND_SOC_BIAS_PREPARE = 2,
  236. SND_SOC_BIAS_ON = 3,
  237. };
  238. struct device_node;
  239. struct snd_jack;
  240. struct snd_soc_card;
  241. struct snd_soc_pcm_stream;
  242. struct snd_soc_ops;
  243. struct snd_soc_pcm_runtime;
  244. struct snd_soc_dai;
  245. struct snd_soc_dai_driver;
  246. struct snd_soc_platform;
  247. struct snd_soc_dai_link;
  248. struct snd_soc_platform_driver;
  249. struct snd_soc_codec;
  250. struct snd_soc_codec_driver;
  251. struct soc_enum;
  252. struct snd_soc_jack;
  253. struct snd_soc_jack_zone;
  254. struct snd_soc_jack_pin;
  255. struct snd_soc_cache_ops;
  256. #include <sound/soc-dapm.h>
  257. #ifdef CONFIG_GPIOLIB
  258. struct snd_soc_jack_gpio;
  259. #endif
  260. typedef int (*hw_write_t)(void *,const char* ,int);
  261. extern struct snd_ac97_bus_ops soc_ac97_ops;
  262. enum snd_soc_control_type {
  263. SND_SOC_I2C = 1,
  264. SND_SOC_SPI,
  265. SND_SOC_REGMAP,
  266. };
  267. enum snd_soc_compress_type {
  268. SND_SOC_FLAT_COMPRESSION = 1,
  269. };
  270. enum snd_soc_pcm_subclass {
  271. SND_SOC_PCM_CLASS_PCM = 0,
  272. SND_SOC_PCM_CLASS_BE = 1,
  273. };
  274. int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
  275. int source, unsigned int freq, int dir);
  276. int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
  277. unsigned int freq_in, unsigned int freq_out);
  278. int snd_soc_register_card(struct snd_soc_card *card);
  279. int snd_soc_unregister_card(struct snd_soc_card *card);
  280. int snd_soc_suspend(struct device *dev);
  281. int snd_soc_resume(struct device *dev);
  282. int snd_soc_poweroff(struct device *dev);
  283. int snd_soc_register_platform(struct device *dev,
  284. struct snd_soc_platform_driver *platform_drv);
  285. void snd_soc_unregister_platform(struct device *dev);
  286. int snd_soc_register_codec(struct device *dev,
  287. const struct snd_soc_codec_driver *codec_drv,
  288. struct snd_soc_dai_driver *dai_drv, int num_dai);
  289. void snd_soc_unregister_codec(struct device *dev);
  290. int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
  291. unsigned int reg);
  292. int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
  293. unsigned int reg);
  294. int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
  295. unsigned int reg);
  296. int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
  297. int addr_bits, int data_bits,
  298. enum snd_soc_control_type control);
  299. int snd_soc_cache_sync(struct snd_soc_codec *codec);
  300. int snd_soc_cache_init(struct snd_soc_codec *codec);
  301. int snd_soc_cache_exit(struct snd_soc_codec *codec);
  302. int snd_soc_cache_write(struct snd_soc_codec *codec,
  303. unsigned int reg, unsigned int value);
  304. int snd_soc_cache_read(struct snd_soc_codec *codec,
  305. unsigned int reg, unsigned int *value);
  306. int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
  307. unsigned int reg);
  308. int snd_soc_default_readable_register(struct snd_soc_codec *codec,
  309. unsigned int reg);
  310. int snd_soc_default_writable_register(struct snd_soc_codec *codec,
  311. unsigned int reg);
  312. int snd_soc_platform_read(struct snd_soc_platform *platform,
  313. unsigned int reg);
  314. int snd_soc_platform_write(struct snd_soc_platform *platform,
  315. unsigned int reg, unsigned int val);
  316. int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
  317. /* Utility functions to get clock rates from various things */
  318. int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
  319. int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
  320. int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
  321. int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
  322. /* set runtime hw params */
  323. int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
  324. const struct snd_pcm_hardware *hw);
  325. /* Jack reporting */
  326. int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
  327. struct snd_soc_jack *jack);
  328. void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
  329. int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
  330. struct snd_soc_jack_pin *pins);
  331. void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
  332. struct notifier_block *nb);
  333. void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
  334. struct notifier_block *nb);
  335. int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
  336. struct snd_soc_jack_zone *zones);
  337. int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
  338. #ifdef CONFIG_GPIOLIB
  339. int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
  340. struct snd_soc_jack_gpio *gpios);
  341. void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
  342. struct snd_soc_jack_gpio *gpios);
  343. #endif
  344. /* codec register bit access */
  345. int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
  346. unsigned int mask, unsigned int value);
  347. int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
  348. unsigned short reg, unsigned int mask,
  349. unsigned int value);
  350. int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
  351. unsigned int mask, unsigned int value);
  352. int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
  353. struct snd_ac97_bus_ops *ops, int num);
  354. void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
  355. /*
  356. *Controls
  357. */
  358. struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
  359. void *data, const char *long_name,
  360. const char *prefix);
  361. int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
  362. const struct snd_kcontrol_new *controls, int num_controls);
  363. int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
  364. const struct snd_kcontrol_new *controls, int num_controls);
  365. int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
  366. const struct snd_kcontrol_new *controls, int num_controls);
  367. int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
  368. const struct snd_kcontrol_new *controls, int num_controls);
  369. int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
  370. struct snd_ctl_elem_info *uinfo);
  371. int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
  372. struct snd_ctl_elem_info *uinfo);
  373. int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
  374. struct snd_ctl_elem_value *ucontrol);
  375. int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
  376. struct snd_ctl_elem_value *ucontrol);
  377. int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
  378. struct snd_ctl_elem_value *ucontrol);
  379. int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
  380. struct snd_ctl_elem_value *ucontrol);
  381. int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
  382. struct snd_ctl_elem_info *uinfo);
  383. int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol,
  384. struct snd_ctl_elem_info *uinfo);
  385. #define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
  386. int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
  387. struct snd_ctl_elem_value *ucontrol);
  388. int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
  389. struct snd_ctl_elem_value *ucontrol);
  390. #define snd_soc_get_volsw_2r snd_soc_get_volsw
  391. #define snd_soc_put_volsw_2r snd_soc_put_volsw
  392. int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol,
  393. struct snd_ctl_elem_info *uinfo);
  394. int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
  395. struct snd_ctl_elem_value *ucontrol);
  396. int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
  397. struct snd_ctl_elem_value *ucontrol);
  398. int snd_soc_limit_volume(struct snd_soc_codec *codec,
  399. const char *name, int max);
  400. int snd_soc_info_volsw_2r_sx(struct snd_kcontrol *kcontrol,
  401. struct snd_ctl_elem_info *uinfo);
  402. int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol,
  403. struct snd_ctl_elem_value *ucontrol);
  404. int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
  405. struct snd_ctl_elem_value *ucontrol);
  406. int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
  407. struct snd_ctl_elem_info *uinfo);
  408. int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
  409. struct snd_ctl_elem_value *ucontrol);
  410. int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
  411. struct snd_ctl_elem_value *ucontrol);
  412. /**
  413. * struct snd_soc_reg_access - Describes whether a given register is
  414. * readable, writable or volatile.
  415. *
  416. * @reg: the register number
  417. * @read: whether this register is readable
  418. * @write: whether this register is writable
  419. * @vol: whether this register is volatile
  420. */
  421. struct snd_soc_reg_access {
  422. u16 reg;
  423. u16 read;
  424. u16 write;
  425. u16 vol;
  426. };
  427. /**
  428. * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
  429. *
  430. * @pin: name of the pin to update
  431. * @mask: bits to check for in reported jack status
  432. * @invert: if non-zero then pin is enabled when status is not reported
  433. */
  434. struct snd_soc_jack_pin {
  435. struct list_head list;
  436. const char *pin;
  437. int mask;
  438. bool invert;
  439. };
  440. /**
  441. * struct snd_soc_jack_zone - Describes voltage zones of jack detection
  442. *
  443. * @min_mv: start voltage in mv
  444. * @max_mv: end voltage in mv
  445. * @jack_type: type of jack that is expected for this voltage
  446. * @debounce_time: debounce_time for jack, codec driver should wait for this
  447. * duration before reading the adc for voltages
  448. * @:list: list container
  449. */
  450. struct snd_soc_jack_zone {
  451. unsigned int min_mv;
  452. unsigned int max_mv;
  453. unsigned int jack_type;
  454. unsigned int debounce_time;
  455. struct list_head list;
  456. };
  457. /**
  458. * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
  459. *
  460. * @gpio: gpio number
  461. * @name: gpio name
  462. * @report: value to report when jack detected
  463. * @invert: report presence in low state
  464. * @debouce_time: debouce time in ms
  465. * @wake: enable as wake source
  466. * @jack_status_check: callback function which overrides the detection
  467. * to provide more complex checks (eg, reading an
  468. * ADC).
  469. */
  470. #ifdef CONFIG_GPIOLIB
  471. struct snd_soc_jack_gpio {
  472. unsigned int gpio;
  473. const char *name;
  474. int report;
  475. int invert;
  476. int debounce_time;
  477. bool wake;
  478. struct snd_soc_jack *jack;
  479. struct delayed_work work;
  480. int (*jack_status_check)(void);
  481. };
  482. #endif
  483. struct snd_soc_jack {
  484. struct snd_jack *jack;
  485. struct snd_soc_codec *codec;
  486. struct list_head pins;
  487. int status;
  488. struct blocking_notifier_head notifier;
  489. struct list_head jack_zones;
  490. };
  491. /* SoC PCM stream information */
  492. struct snd_soc_pcm_stream {
  493. const char *stream_name;
  494. u64 formats; /* SNDRV_PCM_FMTBIT_* */
  495. unsigned int rates; /* SNDRV_PCM_RATE_* */
  496. unsigned int rate_min; /* min rate */
  497. unsigned int rate_max; /* max rate */
  498. unsigned int channels_min; /* min channels */
  499. unsigned int channels_max; /* max channels */
  500. unsigned int sig_bits; /* number of bits of content */
  501. };
  502. /* SoC audio ops */
  503. struct snd_soc_ops {
  504. int (*startup)(struct snd_pcm_substream *);
  505. void (*shutdown)(struct snd_pcm_substream *);
  506. int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
  507. int (*hw_free)(struct snd_pcm_substream *);
  508. int (*prepare)(struct snd_pcm_substream *);
  509. int (*trigger)(struct snd_pcm_substream *, int);
  510. };
  511. /* SoC cache ops */
  512. struct snd_soc_cache_ops {
  513. const char *name;
  514. enum snd_soc_compress_type id;
  515. int (*init)(struct snd_soc_codec *codec);
  516. int (*exit)(struct snd_soc_codec *codec);
  517. int (*read)(struct snd_soc_codec *codec, unsigned int reg,
  518. unsigned int *value);
  519. int (*write)(struct snd_soc_codec *codec, unsigned int reg,
  520. unsigned int value);
  521. int (*sync)(struct snd_soc_codec *codec);
  522. };
  523. /* SoC Audio Codec device */
  524. struct snd_soc_codec {
  525. const char *name;
  526. const char *name_prefix;
  527. int id;
  528. struct device *dev;
  529. const struct snd_soc_codec_driver *driver;
  530. struct mutex mutex;
  531. struct snd_soc_card *card;
  532. struct list_head list;
  533. struct list_head card_list;
  534. int num_dai;
  535. enum snd_soc_compress_type compress_type;
  536. size_t reg_size; /* reg_cache_size * reg_word_size */
  537. int (*volatile_register)(struct snd_soc_codec *, unsigned int);
  538. int (*readable_register)(struct snd_soc_codec *, unsigned int);
  539. int (*writable_register)(struct snd_soc_codec *, unsigned int);
  540. /* runtime */
  541. struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
  542. unsigned int active;
  543. unsigned int cache_bypass:1; /* Suppress access to the cache */
  544. unsigned int suspended:1; /* Codec is in suspend PM state */
  545. unsigned int probed:1; /* Codec has been probed */
  546. unsigned int ac97_registered:1; /* Codec has been AC97 registered */
  547. unsigned int ac97_created:1; /* Codec has been created by SoC */
  548. unsigned int sysfs_registered:1; /* codec has been sysfs registered */
  549. unsigned int cache_init:1; /* codec cache has been initialized */
  550. unsigned int using_regmap:1; /* using regmap access */
  551. u32 cache_only; /* Suppress writes to hardware */
  552. u32 cache_sync; /* Cache needs to be synced to hardware */
  553. /* codec IO */
  554. void *control_data; /* codec control (i2c/3wire) data */
  555. enum snd_soc_control_type control_type;
  556. hw_write_t hw_write;
  557. unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
  558. unsigned int (*read)(struct snd_soc_codec *, unsigned int);
  559. int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
  560. int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t);
  561. void *reg_cache;
  562. const void *reg_def_copy;
  563. const struct snd_soc_cache_ops *cache_ops;
  564. struct mutex cache_rw_mutex;
  565. int val_bytes;
  566. /* dapm */
  567. struct snd_soc_dapm_context dapm;
  568. unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
  569. #ifdef CONFIG_DEBUG_FS
  570. struct dentry *debugfs_codec_root;
  571. struct dentry *debugfs_reg;
  572. struct dentry *debugfs_dapm;
  573. #endif
  574. };
  575. /* codec driver */
  576. struct snd_soc_codec_driver {
  577. /* driver ops */
  578. int (*probe)(struct snd_soc_codec *);
  579. int (*remove)(struct snd_soc_codec *);
  580. int (*suspend)(struct snd_soc_codec *);
  581. int (*resume)(struct snd_soc_codec *);
  582. /* Default control and setup, added after probe() is run */
  583. const struct snd_kcontrol_new *controls;
  584. int num_controls;
  585. const struct snd_soc_dapm_widget *dapm_widgets;
  586. int num_dapm_widgets;
  587. const struct snd_soc_dapm_route *dapm_routes;
  588. int num_dapm_routes;
  589. /* codec wide operations */
  590. int (*set_sysclk)(struct snd_soc_codec *codec,
  591. int clk_id, int source, unsigned int freq, int dir);
  592. int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
  593. unsigned int freq_in, unsigned int freq_out);
  594. /* codec IO */
  595. unsigned int (*read)(struct snd_soc_codec *, unsigned int);
  596. int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
  597. int (*display_register)(struct snd_soc_codec *, char *,
  598. size_t, unsigned int);
  599. int (*volatile_register)(struct snd_soc_codec *, unsigned int);
  600. int (*readable_register)(struct snd_soc_codec *, unsigned int);
  601. int (*writable_register)(struct snd_soc_codec *, unsigned int);
  602. unsigned int reg_cache_size;
  603. short reg_cache_step;
  604. short reg_word_size;
  605. const void *reg_cache_default;
  606. short reg_access_size;
  607. const struct snd_soc_reg_access *reg_access_default;
  608. enum snd_soc_compress_type compress_type;
  609. /* codec bias level */
  610. int (*set_bias_level)(struct snd_soc_codec *,
  611. enum snd_soc_bias_level level);
  612. bool idle_bias_off;
  613. void (*seq_notifier)(struct snd_soc_dapm_context *,
  614. enum snd_soc_dapm_type, int);
  615. /* codec stream completion event */
  616. int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
  617. bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */
  618. /* probe ordering - for components with runtime dependencies */
  619. int probe_order;
  620. int remove_order;
  621. };
  622. /* SoC platform interface */
  623. struct snd_soc_platform_driver {
  624. int (*probe)(struct snd_soc_platform *);
  625. int (*remove)(struct snd_soc_platform *);
  626. int (*suspend)(struct snd_soc_dai *dai);
  627. int (*resume)(struct snd_soc_dai *dai);
  628. /* pcm creation and destruction */
  629. int (*pcm_new)(struct snd_soc_pcm_runtime *);
  630. void (*pcm_free)(struct snd_pcm *);
  631. /* Default control and setup, added after probe() is run */
  632. const struct snd_kcontrol_new *controls;
  633. int num_controls;
  634. const struct snd_soc_dapm_widget *dapm_widgets;
  635. int num_dapm_widgets;
  636. const struct snd_soc_dapm_route *dapm_routes;
  637. int num_dapm_routes;
  638. /*
  639. * For platform caused delay reporting.
  640. * Optional.
  641. */
  642. snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
  643. struct snd_soc_dai *);
  644. /* platform stream ops */
  645. struct snd_pcm_ops *ops;
  646. /* platform stream completion event */
  647. int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
  648. /* probe ordering - for components with runtime dependencies */
  649. int probe_order;
  650. int remove_order;
  651. /* platform IO - used for platform DAPM */
  652. unsigned int (*read)(struct snd_soc_platform *, unsigned int);
  653. int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
  654. };
  655. struct snd_soc_platform {
  656. const char *name;
  657. int id;
  658. struct device *dev;
  659. struct snd_soc_platform_driver *driver;
  660. unsigned int suspended:1; /* platform is suspended */
  661. unsigned int probed:1;
  662. struct snd_soc_card *card;
  663. struct list_head list;
  664. struct list_head card_list;
  665. struct snd_soc_dapm_context dapm;
  666. #ifdef CONFIG_DEBUG_FS
  667. struct dentry *debugfs_platform_root;
  668. struct dentry *debugfs_dapm;
  669. #endif
  670. };
  671. struct snd_soc_dai_link {
  672. /* config - must be set by machine driver */
  673. const char *name; /* Codec name */
  674. const char *stream_name; /* Stream name */
  675. const char *codec_name; /* for multi-codec */
  676. const struct device_node *codec_of_node;
  677. const char *platform_name; /* for multi-platform */
  678. const struct device_node *platform_of_node;
  679. const char *cpu_dai_name;
  680. const struct device_node *cpu_dai_of_node;
  681. const char *codec_dai_name;
  682. unsigned int dai_fmt; /* format to set on init */
  683. /* Keep DAI active over suspend */
  684. unsigned int ignore_suspend:1;
  685. /* Symmetry requirements */
  686. unsigned int symmetric_rates:1;
  687. /* pmdown_time is ignored at stop */
  688. unsigned int ignore_pmdown_time:1;
  689. /* codec/machine specific init - e.g. add machine controls */
  690. int (*init)(struct snd_soc_pcm_runtime *rtd);
  691. /* machine stream operations */
  692. struct snd_soc_ops *ops;
  693. };
  694. struct snd_soc_codec_conf {
  695. const char *dev_name;
  696. /*
  697. * optional map of kcontrol, widget and path name prefixes that are
  698. * associated per device
  699. */
  700. const char *name_prefix;
  701. /*
  702. * set this to the desired compression type if you want to
  703. * override the one supplied in codec->driver->compress_type
  704. */
  705. enum snd_soc_compress_type compress_type;
  706. };
  707. struct snd_soc_aux_dev {
  708. const char *name; /* Codec name */
  709. const char *codec_name; /* for multi-codec */
  710. /* codec/machine specific init - e.g. add machine controls */
  711. int (*init)(struct snd_soc_dapm_context *dapm);
  712. };
  713. /* SoC card */
  714. struct snd_soc_card {
  715. const char *name;
  716. const char *long_name;
  717. const char *driver_name;
  718. struct device *dev;
  719. struct snd_card *snd_card;
  720. struct module *owner;
  721. struct list_head list;
  722. struct mutex mutex;
  723. bool instantiated;
  724. int (*probe)(struct snd_soc_card *card);
  725. int (*late_probe)(struct snd_soc_card *card);
  726. int (*remove)(struct snd_soc_card *card);
  727. /* the pre and post PM functions are used to do any PM work before and
  728. * after the codec and DAI's do any PM work. */
  729. int (*suspend_pre)(struct snd_soc_card *card);
  730. int (*suspend_post)(struct snd_soc_card *card);
  731. int (*resume_pre)(struct snd_soc_card *card);
  732. int (*resume_post)(struct snd_soc_card *card);
  733. /* callbacks */
  734. int (*set_bias_level)(struct snd_soc_card *,
  735. struct snd_soc_dapm_context *dapm,
  736. enum snd_soc_bias_level level);
  737. int (*set_bias_level_post)(struct snd_soc_card *,
  738. struct snd_soc_dapm_context *dapm,
  739. enum snd_soc_bias_level level);
  740. long pmdown_time;
  741. /* CPU <--> Codec DAI links */
  742. struct snd_soc_dai_link *dai_link;
  743. int num_links;
  744. struct snd_soc_pcm_runtime *rtd;
  745. int num_rtd;
  746. /* optional codec specific configuration */
  747. struct snd_soc_codec_conf *codec_conf;
  748. int num_configs;
  749. /*
  750. * optional auxiliary devices such as amplifiers or codecs with DAI
  751. * link unused
  752. */
  753. struct snd_soc_aux_dev *aux_dev;
  754. int num_aux_devs;
  755. struct snd_soc_pcm_runtime *rtd_aux;
  756. int num_aux_rtd;
  757. const struct snd_kcontrol_new *controls;
  758. int num_controls;
  759. /*
  760. * Card-specific routes and widgets.
  761. */
  762. const struct snd_soc_dapm_widget *dapm_widgets;
  763. int num_dapm_widgets;
  764. const struct snd_soc_dapm_route *dapm_routes;
  765. int num_dapm_routes;
  766. bool fully_routed;
  767. struct work_struct deferred_resume_work;
  768. /* lists of probed devices belonging to this card */
  769. struct list_head codec_dev_list;
  770. struct list_head platform_dev_list;
  771. struct list_head dai_dev_list;
  772. struct list_head widgets;
  773. struct list_head paths;
  774. struct list_head dapm_list;
  775. struct list_head dapm_dirty;
  776. /* Generic DAPM context for the card */
  777. struct snd_soc_dapm_context dapm;
  778. struct snd_soc_dapm_stats dapm_stats;
  779. #ifdef CONFIG_DEBUG_FS
  780. struct dentry *debugfs_card_root;
  781. struct dentry *debugfs_pop_time;
  782. #endif
  783. u32 pop_time;
  784. void *drvdata;
  785. };
  786. /* SoC machine DAI configuration, glues a codec and cpu DAI together */
  787. struct snd_soc_pcm_runtime {
  788. struct device *dev;
  789. struct snd_soc_card *card;
  790. struct snd_soc_dai_link *dai_link;
  791. struct mutex pcm_mutex;
  792. enum snd_soc_pcm_subclass pcm_subclass;
  793. struct snd_pcm_ops ops;
  794. unsigned int complete:1;
  795. unsigned int dev_registered:1;
  796. long pmdown_time;
  797. /* runtime devices */
  798. struct snd_pcm *pcm;
  799. struct snd_soc_codec *codec;
  800. struct snd_soc_platform *platform;
  801. struct snd_soc_dai *codec_dai;
  802. struct snd_soc_dai *cpu_dai;
  803. struct delayed_work delayed_work;
  804. };
  805. /* mixer control */
  806. struct soc_mixer_control {
  807. int min, max, platform_max;
  808. unsigned int reg, rreg, shift, rshift, invert;
  809. };
  810. struct soc_bytes {
  811. int base;
  812. int num_regs;
  813. u32 mask;
  814. };
  815. /* enumerated kcontrol */
  816. struct soc_enum {
  817. unsigned short reg;
  818. unsigned short reg2;
  819. unsigned char shift_l;
  820. unsigned char shift_r;
  821. unsigned int max;
  822. unsigned int mask;
  823. const char * const *texts;
  824. const unsigned int *values;
  825. void *dapm;
  826. };
  827. /* codec IO */
  828. unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
  829. unsigned int snd_soc_write(struct snd_soc_codec *codec,
  830. unsigned int reg, unsigned int val);
  831. unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec,
  832. unsigned int reg, const void *data, size_t len);
  833. /* device driver data */
  834. static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
  835. void *data)
  836. {
  837. card->drvdata = data;
  838. }
  839. static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
  840. {
  841. return card->drvdata;
  842. }
  843. static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
  844. void *data)
  845. {
  846. dev_set_drvdata(codec->dev, data);
  847. }
  848. static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
  849. {
  850. return dev_get_drvdata(codec->dev);
  851. }
  852. static inline void snd_soc_platform_set_drvdata(struct snd_soc_platform *platform,
  853. void *data)
  854. {
  855. dev_set_drvdata(platform->dev, data);
  856. }
  857. static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platform)
  858. {
  859. return dev_get_drvdata(platform->dev);
  860. }
  861. static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd,
  862. void *data)
  863. {
  864. dev_set_drvdata(rtd->dev, data);
  865. }
  866. static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
  867. {
  868. return dev_get_drvdata(rtd->dev);
  869. }
  870. static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
  871. {
  872. INIT_LIST_HEAD(&card->dai_dev_list);
  873. INIT_LIST_HEAD(&card->codec_dev_list);
  874. INIT_LIST_HEAD(&card->platform_dev_list);
  875. INIT_LIST_HEAD(&card->widgets);
  876. INIT_LIST_HEAD(&card->paths);
  877. INIT_LIST_HEAD(&card->dapm_list);
  878. }
  879. static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
  880. {
  881. if (mc->reg == mc->rreg && mc->shift == mc->rshift)
  882. return 0;
  883. /*
  884. * mc->reg == mc->rreg && mc->shift != mc->rshift, or
  885. * mc->reg != mc->rreg means that the control is
  886. * stereo (bits in one register or in two registers)
  887. */
  888. return 1;
  889. }
  890. int snd_soc_util_init(void);
  891. void snd_soc_util_exit(void);
  892. int snd_soc_of_parse_card_name(struct snd_soc_card *card,
  893. const char *propname);
  894. int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
  895. const char *propname);
  896. #include <sound/soc-dai.h>
  897. #ifdef CONFIG_DEBUG_FS
  898. extern struct dentry *snd_soc_debugfs_root;
  899. #endif
  900. extern const struct dev_pm_ops snd_soc_pm_ops;
  901. #endif