diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dai.h | 4 | ||||
-rw-r--r-- | include/sound/soc.h | 64 |
2 files changed, 58 insertions, 10 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 373d1775ecba..2df96b1384c7 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -206,7 +206,6 @@ struct snd_soc_dai_driver { | |||
206 | /* DAI description */ | 206 | /* DAI description */ |
207 | const char *name; | 207 | const char *name; |
208 | unsigned int id; | 208 | unsigned int id; |
209 | int ac97_control; | ||
210 | unsigned int base; | 209 | unsigned int base; |
211 | 210 | ||
212 | /* DAI driver callbacks */ | 211 | /* DAI driver callbacks */ |
@@ -216,6 +215,8 @@ struct snd_soc_dai_driver { | |||
216 | int (*resume)(struct snd_soc_dai *dai); | 215 | int (*resume)(struct snd_soc_dai *dai); |
217 | /* compress dai */ | 216 | /* compress dai */ |
218 | bool compress_dai; | 217 | bool compress_dai; |
218 | /* DAI is also used for the control bus */ | ||
219 | bool bus_control; | ||
219 | 220 | ||
220 | /* ops */ | 221 | /* ops */ |
221 | const struct snd_soc_dai_ops *ops; | 222 | const struct snd_soc_dai_ops *ops; |
@@ -241,7 +242,6 @@ struct snd_soc_dai { | |||
241 | const char *name; | 242 | const char *name; |
242 | int id; | 243 | int id; |
243 | struct device *dev; | 244 | struct device *dev; |
244 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
245 | 245 | ||
246 | /* driver ops */ | 246 | /* driver ops */ |
247 | struct snd_soc_dai_driver *driver; | 247 | struct snd_soc_dai_driver *driver; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 38769cc900c9..a765c684bd7b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -369,8 +369,6 @@ struct snd_soc_jack_gpio; | |||
369 | 369 | ||
370 | typedef int (*hw_write_t)(void *,const char* ,int); | 370 | typedef int (*hw_write_t)(void *,const char* ,int); |
371 | 371 | ||
372 | extern struct snd_ac97_bus_ops *soc_ac97_ops; | ||
373 | |||
374 | enum snd_soc_pcm_subclass { | 372 | enum snd_soc_pcm_subclass { |
375 | SND_SOC_PCM_CLASS_PCM = 0, | 373 | SND_SOC_PCM_CLASS_PCM = 0, |
376 | SND_SOC_PCM_CLASS_BE = 1, | 374 | SND_SOC_PCM_CLASS_BE = 1, |
@@ -499,14 +497,28 @@ int snd_soc_update_bits_locked(struct snd_soc_codec *codec, | |||
499 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, | 497 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, |
500 | unsigned int mask, unsigned int value); | 498 | unsigned int mask, unsigned int value); |
501 | 499 | ||
502 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | 500 | #ifdef CONFIG_SND_SOC_AC97_BUS |
503 | struct snd_ac97_bus_ops *ops, int num); | 501 | struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec); |
504 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | 502 | void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); |
505 | 503 | ||
506 | int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); | 504 | int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); |
507 | int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, | 505 | int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, |
508 | struct platform_device *pdev); | 506 | struct platform_device *pdev); |
509 | 507 | ||
508 | extern struct snd_ac97_bus_ops *soc_ac97_ops; | ||
509 | #else | ||
510 | static inline int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, | ||
511 | struct platform_device *pdev) | ||
512 | { | ||
513 | return 0; | ||
514 | } | ||
515 | |||
516 | static inline int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops) | ||
517 | { | ||
518 | return 0; | ||
519 | } | ||
520 | #endif | ||
521 | |||
510 | /* | 522 | /* |
511 | *Controls | 523 | *Controls |
512 | */ | 524 | */ |
@@ -778,11 +790,8 @@ struct snd_soc_codec { | |||
778 | struct list_head card_list; | 790 | struct list_head card_list; |
779 | 791 | ||
780 | /* runtime */ | 792 | /* runtime */ |
781 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | ||
782 | unsigned int cache_bypass:1; /* Suppress access to the cache */ | 793 | unsigned int cache_bypass:1; /* Suppress access to the cache */ |
783 | unsigned int suspended:1; /* Codec is in suspend PM state */ | 794 | unsigned int suspended:1; /* Codec is in suspend PM state */ |
784 | unsigned int ac97_registered:1; /* Codec has been AC97 registered */ | ||
785 | unsigned int ac97_created:1; /* Codec has been created by SoC */ | ||
786 | unsigned int cache_init:1; /* codec cache has been initialized */ | 795 | unsigned int cache_init:1; /* codec cache has been initialized */ |
787 | 796 | ||
788 | /* codec IO */ | 797 | /* codec IO */ |
@@ -1275,6 +1284,45 @@ void snd_soc_component_async_complete(struct snd_soc_component *component); | |||
1275 | int snd_soc_component_test_bits(struct snd_soc_component *component, | 1284 | int snd_soc_component_test_bits(struct snd_soc_component *component, |
1276 | unsigned int reg, unsigned int mask, unsigned int value); | 1285 | unsigned int reg, unsigned int mask, unsigned int value); |
1277 | 1286 | ||
1287 | #ifdef CONFIG_REGMAP | ||
1288 | |||
1289 | void snd_soc_component_init_regmap(struct snd_soc_component *component, | ||
1290 | struct regmap *regmap); | ||
1291 | void snd_soc_component_exit_regmap(struct snd_soc_component *component); | ||
1292 | |||
1293 | /** | ||
1294 | * snd_soc_codec_init_regmap() - Initialize regmap instance for the CODEC | ||
1295 | * @codec: The CODEC for which to initialize the regmap instance | ||
1296 | * @regmap: The regmap instance that should be used by the CODEC | ||
1297 | * | ||
1298 | * This function allows deferred assignment of the regmap instance that is | ||
1299 | * associated with the CODEC. Only use this if the regmap instance is not yet | ||
1300 | * ready when the CODEC is registered. The function must also be called before | ||
1301 | * the first IO attempt of the CODEC. | ||
1302 | */ | ||
1303 | static inline void snd_soc_codec_init_regmap(struct snd_soc_codec *codec, | ||
1304 | struct regmap *regmap) | ||
1305 | { | ||
1306 | snd_soc_component_init_regmap(&codec->component, regmap); | ||
1307 | } | ||
1308 | |||
1309 | /** | ||
1310 | * snd_soc_codec_exit_regmap() - De-initialize regmap instance for the CODEC | ||
1311 | * @codec: The CODEC for which to de-initialize the regmap instance | ||
1312 | * | ||
1313 | * Calls regmap_exit() on the regmap instance associated to the CODEC and | ||
1314 | * removes the regmap instance from the CODEC. | ||
1315 | * | ||
1316 | * This function should only be used if snd_soc_codec_init_regmap() was used to | ||
1317 | * initialize the regmap instance. | ||
1318 | */ | ||
1319 | static inline void snd_soc_codec_exit_regmap(struct snd_soc_codec *codec) | ||
1320 | { | ||
1321 | snd_soc_component_exit_regmap(&codec->component); | ||
1322 | } | ||
1323 | |||
1324 | #endif | ||
1325 | |||
1278 | /* device driver data */ | 1326 | /* device driver data */ |
1279 | 1327 | ||
1280 | static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card, | 1328 | static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card, |