soc.h (b37f1d123c69c0d7730704d65b83eaac780c0e3b) soc.h (1a39019e939f620f39a1b914231ab6ba9013b208)
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

--- 379 unchanged lines hidden (view full) ---

388void snd_soc_unregister_codec(struct device *dev);
389int snd_soc_register_component(struct device *dev,
390 const struct snd_soc_component_driver *cmpnt_drv,
391 struct snd_soc_dai_driver *dai_drv, int num_dai);
392int devm_snd_soc_register_component(struct device *dev,
393 const struct snd_soc_component_driver *cmpnt_drv,
394 struct snd_soc_dai_driver *dai_drv, int num_dai);
395void snd_soc_unregister_component(struct device *dev);
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

--- 379 unchanged lines hidden (view full) ---

388void snd_soc_unregister_codec(struct device *dev);
389int snd_soc_register_component(struct device *dev,
390 const struct snd_soc_component_driver *cmpnt_drv,
391 struct snd_soc_dai_driver *dai_drv, int num_dai);
392int devm_snd_soc_register_component(struct device *dev,
393 const struct snd_soc_component_driver *cmpnt_drv,
394 struct snd_soc_dai_driver *dai_drv, int num_dai);
395void snd_soc_unregister_component(struct device *dev);
396int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
397 unsigned int reg);
398int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
399 unsigned int reg);
400int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
401 unsigned int reg);
396int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
397 struct regmap *regmap);
398int snd_soc_cache_sync(struct snd_soc_codec *codec);
399int snd_soc_cache_init(struct snd_soc_codec *codec);
400int snd_soc_cache_exit(struct snd_soc_codec *codec);
401int snd_soc_cache_write(struct snd_soc_codec *codec,
402 unsigned int reg, unsigned int value);
403int snd_soc_cache_read(struct snd_soc_codec *codec,

--- 54 unchanged lines hidden (view full) ---

458
459static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
460 struct snd_soc_jack_gpio *gpios)
461{
462}
463#endif
464
465/* codec register bit access */
402int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
403 struct regmap *regmap);
404int snd_soc_cache_sync(struct snd_soc_codec *codec);
405int snd_soc_cache_init(struct snd_soc_codec *codec);
406int snd_soc_cache_exit(struct snd_soc_codec *codec);
407int snd_soc_cache_write(struct snd_soc_codec *codec,
408 unsigned int reg, unsigned int value);
409int snd_soc_cache_read(struct snd_soc_codec *codec,

--- 54 unchanged lines hidden (view full) ---

464
465static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
466 struct snd_soc_jack_gpio *gpios)
467{
468}
469#endif
470
471/* codec register bit access */
466int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
472int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
467 unsigned int mask, unsigned int value);
468int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
473 unsigned int mask, unsigned int value);
474int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
469 unsigned short reg, unsigned int mask,
475 unsigned int reg, unsigned int mask,
470 unsigned int value);
476 unsigned int value);
471int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
477int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
472 unsigned int mask, unsigned int value);
473
474int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
475 struct snd_ac97_bus_ops *ops, int num);
476void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
477
478int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
479int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,

--- 177 unchanged lines hidden (view full) ---

657struct snd_soc_component {
658 const char *name;
659 int id;
660 struct device *dev;
661
662 unsigned int active;
663
664 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
478 unsigned int mask, unsigned int value);
479
480int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
481 struct snd_ac97_bus_ops *ops, int num);
482void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
483
484int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
485int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,

--- 177 unchanged lines hidden (view full) ---

663struct snd_soc_component {
664 const char *name;
665 int id;
666 struct device *dev;
667
668 unsigned int active;
669
670 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
665 unsigned int registered_as_component:1;
666
667 struct list_head list;
668
669 struct snd_soc_dai_driver *dai_drv;
670 int num_dai;
671
672 const struct snd_soc_component_driver *driver;
673

--- 8 unchanged lines hidden (view full) ---

682 struct device *dev;
683 const struct snd_soc_codec_driver *driver;
684
685 struct mutex mutex;
686 struct snd_soc_card *card;
687 struct list_head list;
688 struct list_head card_list;
689 int num_dai;
671
672 struct list_head list;
673
674 struct snd_soc_dai_driver *dai_drv;
675 int num_dai;
676
677 const struct snd_soc_component_driver *driver;
678

--- 8 unchanged lines hidden (view full) ---

687 struct device *dev;
688 const struct snd_soc_codec_driver *driver;
689
690 struct mutex mutex;
691 struct snd_soc_card *card;
692 struct list_head list;
693 struct list_head card_list;
694 int num_dai;
695 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
696 int (*readable_register)(struct snd_soc_codec *, unsigned int);
697 int (*writable_register)(struct snd_soc_codec *, unsigned int);
690
691 /* runtime */
692 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
693 unsigned int cache_bypass:1; /* Suppress access to the cache */
694 unsigned int suspended:1; /* Codec is in suspend PM state */
695 unsigned int probed:1; /* Codec has been probed */
696 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
697 unsigned int ac97_created:1; /* Codec has been created by SoC */

--- 45 unchanged lines hidden (view full) ---

743 int (*set_sysclk)(struct snd_soc_codec *codec,
744 int clk_id, int source, unsigned int freq, int dir);
745 int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
746 unsigned int freq_in, unsigned int freq_out);
747
748 /* codec IO */
749 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
750 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
698
699 /* runtime */
700 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
701 unsigned int cache_bypass:1; /* Suppress access to the cache */
702 unsigned int suspended:1; /* Codec is in suspend PM state */
703 unsigned int probed:1; /* Codec has been probed */
704 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
705 unsigned int ac97_created:1; /* Codec has been created by SoC */

--- 45 unchanged lines hidden (view full) ---

751 int (*set_sysclk)(struct snd_soc_codec *codec,
752 int clk_id, int source, unsigned int freq, int dir);
753 int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
754 unsigned int freq_in, unsigned int freq_out);
755
756 /* codec IO */
757 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
758 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
759 int (*display_register)(struct snd_soc_codec *, char *,
760 size_t, unsigned int);
761 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
762 int (*readable_register)(struct snd_soc_codec *, unsigned int);
763 int (*writable_register)(struct snd_soc_codec *, unsigned int);
751 unsigned int reg_cache_size;
752 short reg_cache_step;
753 short reg_word_size;
754 const void *reg_cache_default;
755
756 /* codec bias level */
757 int (*set_bias_level)(struct snd_soc_codec *,
758 enum snd_soc_bias_level level);

--- 14 unchanged lines hidden (view full) ---

773
774/* SoC platform interface */
775struct snd_soc_platform_driver {
776
777 int (*probe)(struct snd_soc_platform *);
778 int (*remove)(struct snd_soc_platform *);
779 int (*suspend)(struct snd_soc_dai *dai);
780 int (*resume)(struct snd_soc_dai *dai);
764 unsigned int reg_cache_size;
765 short reg_cache_step;
766 short reg_word_size;
767 const void *reg_cache_default;
768
769 /* codec bias level */
770 int (*set_bias_level)(struct snd_soc_codec *,
771 enum snd_soc_bias_level level);

--- 14 unchanged lines hidden (view full) ---

786
787/* SoC platform interface */
788struct snd_soc_platform_driver {
789
790 int (*probe)(struct snd_soc_platform *);
791 int (*remove)(struct snd_soc_platform *);
792 int (*suspend)(struct snd_soc_dai *dai);
793 int (*resume)(struct snd_soc_dai *dai);
781 struct snd_soc_component_driver component_driver;
782
783 /* pcm creation and destruction */
784 int (*pcm_new)(struct snd_soc_pcm_runtime *);
785 void (*pcm_free)(struct snd_pcm *);
786
787 /* Default control and setup, added after probe() is run */
788 const struct snd_kcontrol_new *controls;
789 int num_controls;

--- 37 unchanged lines hidden (view full) ---

827
828 unsigned int suspended:1; /* platform is suspended */
829 unsigned int probed:1;
830
831 struct snd_soc_card *card;
832 struct list_head list;
833 struct list_head card_list;
834
794
795 /* pcm creation and destruction */
796 int (*pcm_new)(struct snd_soc_pcm_runtime *);
797 void (*pcm_free)(struct snd_pcm *);
798
799 /* Default control and setup, added after probe() is run */
800 const struct snd_kcontrol_new *controls;
801 int num_controls;

--- 37 unchanged lines hidden (view full) ---

839
840 unsigned int suspended:1; /* platform is suspended */
841 unsigned int probed:1;
842
843 struct snd_soc_card *card;
844 struct list_head list;
845 struct list_head card_list;
846
835 struct snd_soc_component component;
836
837 struct snd_soc_dapm_context dapm;
838
839#ifdef CONFIG_DEBUG_FS
840 struct dentry *debugfs_platform_root;
841#endif
842};
843
844struct snd_soc_dai_link {

--- 260 unchanged lines hidden (view full) ---

1105 * Otherwise the behavior is undefined.
1106 */
1107static inline struct snd_soc_codec *snd_soc_component_to_codec(
1108 struct snd_soc_component *component)
1109{
1110 return container_of(component, struct snd_soc_codec, component);
1111}
1112
847 struct snd_soc_dapm_context dapm;
848
849#ifdef CONFIG_DEBUG_FS
850 struct dentry *debugfs_platform_root;
851#endif
852};
853
854struct snd_soc_dai_link {

--- 260 unchanged lines hidden (view full) ---

1115 * Otherwise the behavior is undefined.
1116 */
1117static inline struct snd_soc_codec *snd_soc_component_to_codec(
1118 struct snd_soc_component *component)
1119{
1120 return container_of(component, struct snd_soc_codec, component);
1121}
1122
1113/**
1114 * snd_soc_component_to_platform() - Casts a component to the platform it is embedded in
1115 * @component: The component to cast to a platform
1116 *
1117 * This function must only be used on components that are known to be platforms.
1118 * Otherwise the behavior is undefined.
1119 */
1120static inline struct snd_soc_platform *snd_soc_component_to_platform(
1121 struct snd_soc_component *component)
1122{
1123 return container_of(component, struct snd_soc_platform, component);
1124}
1125
1126/* codec IO */
1127unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
1128unsigned int snd_soc_write(struct snd_soc_codec *codec,
1129 unsigned int reg, unsigned int val);
1130
1131/* device driver data */
1132
1133static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,

--- 92 unchanged lines hidden (view full) ---

1226 return component->active != 0;
1227}
1228
1229static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
1230{
1231 return snd_soc_component_is_active(&codec->component);
1232}
1233
1123/* codec IO */
1124unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
1125unsigned int snd_soc_write(struct snd_soc_codec *codec,
1126 unsigned int reg, unsigned int val);
1127
1128/* device driver data */
1129
1130static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,

--- 92 unchanged lines hidden (view full) ---

1223 return component->active != 0;
1224}
1225
1226static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
1227{
1228 return snd_soc_component_is_active(&codec->component);
1229}
1230
1234/**
1235 * snd_soc_kcontrol_codec() - Returns the CODEC that registered the control
1236 * @kcontrol: The control for which to get the CODEC
1237 *
1238 * Note: This function will only work correctly if the control has been
1239 * registered with snd_soc_add_codec_controls() or via table based setup of
1240 * snd_soc_codec_driver. Otherwise the behavior is undefined.
1241 */
1242static inline struct snd_soc_codec *snd_soc_kcontrol_codec(
1243 struct snd_kcontrol *kcontrol)
1244{
1245 return snd_kcontrol_chip(kcontrol);
1246}
1247
1248/**
1249 * snd_soc_kcontrol_platform() - Returns the platform that registerd the control
1250 * @kcontrol: The control for which to get the platform
1251 *
1252 * Note: This function will only work correctly if the control has been
1253 * registered with snd_soc_add_platform_controls() or via table based setup of
1254 * a snd_soc_platform_driver. Otherwise the behavior is undefined.
1255 */
1256static inline struct snd_soc_codec *snd_soc_kcontrol_platform(
1257 struct snd_kcontrol *kcontrol)
1258{
1259 return snd_kcontrol_chip(kcontrol);
1260}
1261
1262int snd_soc_util_init(void);
1263void snd_soc_util_exit(void);
1264
1265int snd_soc_of_parse_card_name(struct snd_soc_card *card,
1266 const char *propname);
1267int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
1268 const char *propname);
1269int snd_soc_of_parse_tdm_slot(struct device_node *np,

--- 29 unchanged lines hidden ---
1231int snd_soc_util_init(void);
1232void snd_soc_util_exit(void);
1233
1234int snd_soc_of_parse_card_name(struct snd_soc_card *card,
1235 const char *propname);
1236int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
1237 const char *propname);
1238int snd_soc_of_parse_tdm_slot(struct device_node *np,

--- 29 unchanged lines hidden ---