diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/pcm.h | 2 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 3 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 9 | ||||
-rw-r--r-- | include/sound/soc-dpcm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 48 |
5 files changed, 33 insertions, 31 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index e862497f7556..8bb00a27e219 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -184,6 +184,8 @@ struct snd_pcm_ops { | |||
184 | #define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8) | 184 | #define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8) |
185 | #define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE) | 185 | #define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE) |
186 | #define SNDRV_PCM_FMTBIT_DSD_U32_LE _SNDRV_PCM_FMTBIT(DSD_U32_LE) | 186 | #define SNDRV_PCM_FMTBIT_DSD_U32_LE _SNDRV_PCM_FMTBIT(DSD_U32_LE) |
187 | #define SNDRV_PCM_FMTBIT_DSD_U16_BE _SNDRV_PCM_FMTBIT(DSD_U16_BE) | ||
188 | #define SNDRV_PCM_FMTBIT_DSD_U32_BE _SNDRV_PCM_FMTBIT(DSD_U32_BE) | ||
187 | 189 | ||
188 | #ifdef SNDRV_LITTLE_ENDIAN | 190 | #ifdef SNDRV_LITTLE_ENDIAN |
189 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE | 191 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index a3738be45563..2df96b1384c7 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -268,7 +268,6 @@ struct snd_soc_dai { | |||
268 | unsigned int sample_bits; | 268 | unsigned int sample_bits; |
269 | 269 | ||
270 | /* parent platform/codec */ | 270 | /* parent platform/codec */ |
271 | struct snd_soc_platform *platform; | ||
272 | struct snd_soc_codec *codec; | 271 | struct snd_soc_codec *codec; |
273 | struct snd_soc_component *component; | 272 | struct snd_soc_component *component; |
274 | 273 | ||
@@ -276,8 +275,6 @@ struct snd_soc_dai { | |||
276 | unsigned int tx_mask; | 275 | unsigned int tx_mask; |
277 | unsigned int rx_mask; | 276 | unsigned int rx_mask; |
278 | 277 | ||
279 | struct snd_soc_card *card; | ||
280 | |||
281 | struct list_head list; | 278 | struct list_head list; |
282 | }; | 279 | }; |
283 | 280 | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 3a4d7da67b8d..89823cfe6f04 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -435,7 +435,7 @@ void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card); | |||
435 | unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); | 435 | unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); |
436 | 436 | ||
437 | /* Mostly internal - should not normally be used */ | 437 | /* Mostly internal - should not normally be used */ |
438 | void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); | 438 | void dapm_mark_endpoints_dirty(struct snd_soc_card *card); |
439 | 439 | ||
440 | /* dapm path query */ | 440 | /* dapm path query */ |
441 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, | 441 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, |
@@ -508,9 +508,9 @@ struct snd_soc_dapm_path { | |||
508 | 508 | ||
509 | /* status */ | 509 | /* status */ |
510 | u32 connect:1; /* source and sink widgets are connected */ | 510 | u32 connect:1; /* source and sink widgets are connected */ |
511 | u32 walked:1; /* path has been walked */ | ||
512 | u32 walking:1; /* path is in the process of being walked */ | 511 | u32 walking:1; /* path is in the process of being walked */ |
513 | u32 weak:1; /* path ignored for power management */ | 512 | u32 weak:1; /* path ignored for power management */ |
513 | u32 is_supply:1; /* At least one of the connected widgets is a supply */ | ||
514 | 514 | ||
515 | int (*connected)(struct snd_soc_dapm_widget *source, | 515 | int (*connected)(struct snd_soc_dapm_widget *source, |
516 | struct snd_soc_dapm_widget *sink); | 516 | struct snd_soc_dapm_widget *sink); |
@@ -544,11 +544,13 @@ struct snd_soc_dapm_widget { | |||
544 | unsigned char active:1; /* active stream on DAC, ADC's */ | 544 | unsigned char active:1; /* active stream on DAC, ADC's */ |
545 | unsigned char connected:1; /* connected codec pin */ | 545 | unsigned char connected:1; /* connected codec pin */ |
546 | unsigned char new:1; /* cnew complete */ | 546 | unsigned char new:1; /* cnew complete */ |
547 | unsigned char ext:1; /* has external widgets */ | ||
548 | unsigned char force:1; /* force state */ | 547 | unsigned char force:1; /* force state */ |
549 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ | 548 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
550 | unsigned char new_power:1; /* power from this run */ | 549 | unsigned char new_power:1; /* power from this run */ |
551 | unsigned char power_checked:1; /* power checked this run */ | 550 | unsigned char power_checked:1; /* power checked this run */ |
551 | unsigned char is_supply:1; /* Widget is a supply type widget */ | ||
552 | unsigned char is_sink:1; /* Widget is a sink type widget */ | ||
553 | unsigned char is_source:1; /* Widget is a source type widget */ | ||
552 | int subseq; /* sort within widget type */ | 554 | int subseq; /* sort within widget type */ |
553 | 555 | ||
554 | int (*power_check)(struct snd_soc_dapm_widget *w); | 556 | int (*power_check)(struct snd_soc_dapm_widget *w); |
@@ -567,6 +569,7 @@ struct snd_soc_dapm_widget { | |||
567 | struct list_head sinks; | 569 | struct list_head sinks; |
568 | 570 | ||
569 | /* used during DAPM updates */ | 571 | /* used during DAPM updates */ |
572 | struct list_head work_list; | ||
570 | struct list_head power_list; | 573 | struct list_head power_list; |
571 | struct list_head dirty; | 574 | struct list_head dirty; |
572 | int inputs; | 575 | int inputs; |
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 2883a7a6f9f3..98f2ade0266e 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h | |||
@@ -102,6 +102,8 @@ struct snd_soc_dpcm_runtime { | |||
102 | /* state and update */ | 102 | /* state and update */ |
103 | enum snd_soc_dpcm_update runtime_update; | 103 | enum snd_soc_dpcm_update runtime_update; |
104 | enum snd_soc_dpcm_state state; | 104 | enum snd_soc_dpcm_state state; |
105 | |||
106 | int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */ | ||
105 | }; | 107 | }; |
106 | 108 | ||
107 | /* can this BE stop and free */ | 109 | /* can this BE stop and free */ |
diff --git a/include/sound/soc.h b/include/sound/soc.h index b53234835936..a765c684bd7b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -36,6 +36,11 @@ | |||
36 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ | 36 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
37 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ | 37 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
38 | .invert = xinvert, .autodisable = xautodisable}) | 38 | .invert = xinvert, .autodisable = xautodisable}) |
39 | #define SOC_DOUBLE_S_VALUE(xreg, shift_left, shift_right, xmin, xmax, xsign_bit, xinvert, xautodisable) \ | ||
40 | ((unsigned long)&(struct soc_mixer_control) \ | ||
41 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ | ||
42 | .rshift = shift_right, .min = xmin, .max = xmax, .platform_max = xmax, \ | ||
43 | .sign_bit = xsign_bit, .invert = xinvert, .autodisable = xautodisable}) | ||
39 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ | 44 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ |
40 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable) | 45 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable) |
41 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 46 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
@@ -171,11 +176,9 @@ | |||
171 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 176 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
172 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | 177 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
173 | .tlv.p = (tlv_array), \ | 178 | .tlv.p = (tlv_array), \ |
174 | .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ | 179 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
175 | .put = snd_soc_put_volsw_s8, \ | 180 | .put = snd_soc_put_volsw, \ |
176 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 181 | .private_value = SOC_DOUBLE_S_VALUE(xreg, 0, 8, xmin, xmax, 7, 0, 0) } |
177 | {.reg = xreg, .min = xmin, .max = xmax, \ | ||
178 | .platform_max = xmax} } | ||
179 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xitems, xtexts) \ | 182 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xitems, xtexts) \ |
180 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ | 183 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ |
181 | .items = xitems, .texts = xtexts, \ | 184 | .items = xitems, .texts = xtexts, \ |
@@ -407,13 +410,9 @@ int devm_snd_soc_register_component(struct device *dev, | |||
407 | const struct snd_soc_component_driver *cmpnt_drv, | 410 | const struct snd_soc_component_driver *cmpnt_drv, |
408 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 411 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
409 | void snd_soc_unregister_component(struct device *dev); | 412 | void snd_soc_unregister_component(struct device *dev); |
410 | int snd_soc_cache_sync(struct snd_soc_codec *codec); | ||
411 | int snd_soc_cache_init(struct snd_soc_codec *codec); | 413 | int snd_soc_cache_init(struct snd_soc_codec *codec); |
412 | int snd_soc_cache_exit(struct snd_soc_codec *codec); | 414 | int snd_soc_cache_exit(struct snd_soc_codec *codec); |
413 | int snd_soc_cache_write(struct snd_soc_codec *codec, | 415 | |
414 | unsigned int reg, unsigned int value); | ||
415 | int snd_soc_cache_read(struct snd_soc_codec *codec, | ||
416 | unsigned int reg, unsigned int *value); | ||
417 | int snd_soc_platform_read(struct snd_soc_platform *platform, | 416 | int snd_soc_platform_read(struct snd_soc_platform *platform, |
418 | unsigned int reg); | 417 | unsigned int reg); |
419 | int snd_soc_platform_write(struct snd_soc_platform *platform, | 418 | int snd_soc_platform_write(struct snd_soc_platform *platform, |
@@ -557,12 +556,6 @@ int snd_soc_get_volsw_sx(struct snd_kcontrol *kcontrol, | |||
557 | struct snd_ctl_elem_value *ucontrol); | 556 | struct snd_ctl_elem_value *ucontrol); |
558 | int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, | 557 | int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, |
559 | struct snd_ctl_elem_value *ucontrol); | 558 | struct snd_ctl_elem_value *ucontrol); |
560 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, | ||
561 | struct snd_ctl_elem_info *uinfo); | ||
562 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | ||
563 | struct snd_ctl_elem_value *ucontrol); | ||
564 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | ||
565 | struct snd_ctl_elem_value *ucontrol); | ||
566 | int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, | 559 | int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, |
567 | struct snd_ctl_elem_info *uinfo); | 560 | struct snd_ctl_elem_info *uinfo); |
568 | int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, | 561 | int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, |
@@ -800,13 +793,11 @@ struct snd_soc_codec { | |||
800 | unsigned int cache_bypass:1; /* Suppress access to the cache */ | 793 | unsigned int cache_bypass:1; /* Suppress access to the cache */ |
801 | unsigned int suspended:1; /* Codec is in suspend PM state */ | 794 | unsigned int suspended:1; /* Codec is in suspend PM state */ |
802 | unsigned int cache_init:1; /* codec cache has been initialized */ | 795 | unsigned int cache_init:1; /* codec cache has been initialized */ |
803 | u32 cache_sync; /* Cache needs to be synced to hardware */ | ||
804 | 796 | ||
805 | /* codec IO */ | 797 | /* codec IO */ |
806 | void *control_data; /* codec control (i2c/3wire) data */ | 798 | void *control_data; /* codec control (i2c/3wire) data */ |
807 | hw_write_t hw_write; | 799 | hw_write_t hw_write; |
808 | void *reg_cache; | 800 | void *reg_cache; |
809 | struct mutex cache_rw_mutex; | ||
810 | 801 | ||
811 | /* component */ | 802 | /* component */ |
812 | struct snd_soc_component component; | 803 | struct snd_soc_component component; |
@@ -869,8 +860,6 @@ struct snd_soc_platform_driver { | |||
869 | 860 | ||
870 | int (*probe)(struct snd_soc_platform *); | 861 | int (*probe)(struct snd_soc_platform *); |
871 | int (*remove)(struct snd_soc_platform *); | 862 | int (*remove)(struct snd_soc_platform *); |
872 | int (*suspend)(struct snd_soc_dai *dai); | ||
873 | int (*resume)(struct snd_soc_dai *dai); | ||
874 | struct snd_soc_component_driver component_driver; | 863 | struct snd_soc_component_driver component_driver; |
875 | 864 | ||
876 | /* pcm creation and destruction */ | 865 | /* pcm creation and destruction */ |
@@ -895,7 +884,7 @@ struct snd_soc_platform_driver { | |||
895 | 884 | ||
896 | struct snd_soc_dai_link_component { | 885 | struct snd_soc_dai_link_component { |
897 | const char *name; | 886 | const char *name; |
898 | const struct device_node *of_node; | 887 | struct device_node *of_node; |
899 | const char *dai_name; | 888 | const char *dai_name; |
900 | }; | 889 | }; |
901 | 890 | ||
@@ -903,8 +892,6 @@ struct snd_soc_platform { | |||
903 | struct device *dev; | 892 | struct device *dev; |
904 | const struct snd_soc_platform_driver *driver; | 893 | const struct snd_soc_platform_driver *driver; |
905 | 894 | ||
906 | unsigned int suspended:1; /* platform is suspended */ | ||
907 | |||
908 | struct list_head list; | 895 | struct list_head list; |
909 | 896 | ||
910 | struct snd_soc_component component; | 897 | struct snd_soc_component component; |
@@ -999,7 +986,7 @@ struct snd_soc_codec_conf { | |||
999 | * DT/OF node, but not both. | 986 | * DT/OF node, but not both. |
1000 | */ | 987 | */ |
1001 | const char *dev_name; | 988 | const char *dev_name; |
1002 | const struct device_node *of_node; | 989 | struct device_node *of_node; |
1003 | 990 | ||
1004 | /* | 991 | /* |
1005 | * optional map of kcontrol, widget and path name prefixes that are | 992 | * optional map of kcontrol, widget and path name prefixes that are |
@@ -1016,7 +1003,7 @@ struct snd_soc_aux_dev { | |||
1016 | * DT/OF node, but not both. | 1003 | * DT/OF node, but not both. |
1017 | */ | 1004 | */ |
1018 | const char *codec_name; | 1005 | const char *codec_name; |
1019 | const struct device_node *codec_of_node; | 1006 | struct device_node *codec_of_node; |
1020 | 1007 | ||
1021 | /* codec/machine specific init - e.g. add machine controls */ | 1008 | /* codec/machine specific init - e.g. add machine controls */ |
1022 | int (*init)(struct snd_soc_component *component); | 1009 | int (*init)(struct snd_soc_component *component); |
@@ -1273,6 +1260,17 @@ unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); | |||
1273 | int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, | 1260 | int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, |
1274 | unsigned int val); | 1261 | unsigned int val); |
1275 | 1262 | ||
1263 | /** | ||
1264 | * snd_soc_cache_sync() - Sync the register cache with the hardware | ||
1265 | * @codec: CODEC to sync | ||
1266 | * | ||
1267 | * Note: This function will call regcache_sync() | ||
1268 | */ | ||
1269 | static inline int snd_soc_cache_sync(struct snd_soc_codec *codec) | ||
1270 | { | ||
1271 | return regcache_sync(codec->component.regmap); | ||
1272 | } | ||
1273 | |||
1276 | /* component IO */ | 1274 | /* component IO */ |
1277 | int snd_soc_component_read(struct snd_soc_component *component, | 1275 | int snd_soc_component_read(struct snd_soc_component *component, |
1278 | unsigned int reg, unsigned int *val); | 1276 | unsigned int reg, unsigned int *val); |