aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h2
-rw-r--r--include/sound/rcar_snd.h8
-rw-r--r--include/sound/rt5645.h4
-rw-r--r--include/sound/rt5677.h10
-rw-r--r--include/sound/soc-dai.h7
-rw-r--r--include/sound/soc-dapm.h9
-rw-r--r--include/sound/soc-dpcm.h2
-rw-r--r--include/sound/soc.h116
-rw-r--r--include/sound/uda134x.h12
9 files changed, 112 insertions, 58 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/rcar_snd.h b/include/sound/rcar_snd.h
index d76412b84b48..83284cae464c 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -36,14 +36,14 @@
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31) 36#define RSND_SSI_CLK_PIN_SHARE (1 << 31)
37#define RSND_SSI_NO_BUSIF (1 << 30) /* SSI+DMA without BUSIF */ 37#define RSND_SSI_NO_BUSIF (1 << 30) /* SSI+DMA without BUSIF */
38 38
39#define RSND_SSI(_dma_id, _pio_irq, _flags) \ 39#define RSND_SSI(_dma_id, _irq, _flags) \
40{ .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags } 40{ .dma_id = _dma_id, .irq = _irq, .flags = _flags }
41#define RSND_SSI_UNUSED \ 41#define RSND_SSI_UNUSED \
42{ .dma_id = -1, .pio_irq = -1, .flags = 0 } 42{ .dma_id = -1, .irq = -1, .flags = 0 }
43 43
44struct rsnd_ssi_platform_info { 44struct rsnd_ssi_platform_info {
45 int dma_id; 45 int dma_id;
46 int pio_irq; 46 int irq;
47 u32 flags; 47 u32 flags;
48}; 48};
49 49
diff --git a/include/sound/rt5645.h b/include/sound/rt5645.h
index a5352712194b..120d9610054e 100644
--- a/include/sound/rt5645.h
+++ b/include/sound/rt5645.h
@@ -23,6 +23,10 @@ struct rt5645_platform_data {
23 23
24 unsigned int hp_det_gpio; 24 unsigned int hp_det_gpio;
25 bool gpio_hp_det_active_high; 25 bool gpio_hp_det_active_high;
26
27 /* true if codec's jd function is used */
28 bool en_jd_func;
29 unsigned int jd_mode;
26}; 30};
27 31
28#endif 32#endif
diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h
index 082670e3a353..d9eb7d861cd0 100644
--- a/include/sound/rt5677.h
+++ b/include/sound/rt5677.h
@@ -27,6 +27,16 @@ struct rt5677_platform_data {
27 bool lout3_diff; 27 bool lout3_diff;
28 /* DMIC2 clock source selection */ 28 /* DMIC2 clock source selection */
29 enum rt5677_dmic2_clk dmic2_clk_pin; 29 enum rt5677_dmic2_clk dmic2_clk_pin;
30
31 /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */
32 u8 gpio_config[6];
33
34 /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */
35 unsigned int jd1_gpio;
36 /* jd2 and jd3 can select 0 ~ 3 as
37 OFF, GPIO4, GPIO5 and GPIO6 respectively */
38 unsigned int jd2_gpio;
39 unsigned int jd3_gpio;
30}; 40};
31 41
32#endif 42#endif
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index e8b3080d196a..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;
@@ -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);
435unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); 435unsigned 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 */
438void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); 438void dapm_mark_endpoints_dirty(struct snd_soc_card *card);
439 439
440/* dapm path query */ 440/* dapm path query */
441int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 441int 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 7ba7130037a0..b4fca9aed2a2 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, \
@@ -366,8 +369,6 @@ struct snd_soc_jack_gpio;
366 369
367typedef int (*hw_write_t)(void *,const char* ,int); 370typedef int (*hw_write_t)(void *,const char* ,int);
368 371
369extern struct snd_ac97_bus_ops *soc_ac97_ops;
370
371enum snd_soc_pcm_subclass { 372enum snd_soc_pcm_subclass {
372 SND_SOC_PCM_CLASS_PCM = 0, 373 SND_SOC_PCM_CLASS_PCM = 0,
373 SND_SOC_PCM_CLASS_BE = 1, 374 SND_SOC_PCM_CLASS_BE = 1,
@@ -409,13 +410,9 @@ int devm_snd_soc_register_component(struct device *dev,
409 const struct snd_soc_component_driver *cmpnt_drv, 410 const struct snd_soc_component_driver *cmpnt_drv,
410 struct snd_soc_dai_driver *dai_drv, int num_dai); 411 struct snd_soc_dai_driver *dai_drv, int num_dai);
411void snd_soc_unregister_component(struct device *dev); 412void snd_soc_unregister_component(struct device *dev);
412int snd_soc_cache_sync(struct snd_soc_codec *codec);
413int snd_soc_cache_init(struct snd_soc_codec *codec); 413int snd_soc_cache_init(struct snd_soc_codec *codec);
414int snd_soc_cache_exit(struct snd_soc_codec *codec); 414int snd_soc_cache_exit(struct snd_soc_codec *codec);
415int snd_soc_cache_write(struct snd_soc_codec *codec, 415
416 unsigned int reg, unsigned int value);
417int snd_soc_cache_read(struct snd_soc_codec *codec,
418 unsigned int reg, unsigned int *value);
419int snd_soc_platform_read(struct snd_soc_platform *platform, 416int snd_soc_platform_read(struct snd_soc_platform *platform,
420 unsigned int reg); 417 unsigned int reg);
421int snd_soc_platform_write(struct snd_soc_platform *platform, 418int snd_soc_platform_write(struct snd_soc_platform *platform,
@@ -500,14 +497,28 @@ int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
500int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, 497int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
501 unsigned int mask, unsigned int value); 498 unsigned int mask, unsigned int value);
502 499
503int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, 500#ifdef CONFIG_SND_SOC_AC97_BUS
504 struct snd_ac97_bus_ops *ops, int num); 501struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec);
505void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); 502void snd_soc_free_ac97_codec(struct snd_ac97 *ac97);
506 503
507int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); 504int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
508int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, 505int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
509 struct platform_device *pdev); 506 struct platform_device *pdev);
510 507
508extern struct snd_ac97_bus_ops *soc_ac97_ops;
509#else
510static 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
516static inline int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops)
517{
518 return 0;
519}
520#endif
521
511/* 522/*
512 *Controls 523 *Controls
513 */ 524 */
@@ -545,12 +556,6 @@ int snd_soc_get_volsw_sx(struct snd_kcontrol *kcontrol,
545 struct snd_ctl_elem_value *ucontrol); 556 struct snd_ctl_elem_value *ucontrol);
546int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, 557int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
547 struct snd_ctl_elem_value *ucontrol); 558 struct snd_ctl_elem_value *ucontrol);
548int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol,
549 struct snd_ctl_elem_info *uinfo);
550int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
551 struct snd_ctl_elem_value *ucontrol);
552int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
553 struct snd_ctl_elem_value *ucontrol);
554int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, 559int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
555 struct snd_ctl_elem_info *uinfo); 560 struct snd_ctl_elem_info *uinfo);
556int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, 561int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
@@ -780,24 +785,18 @@ struct snd_soc_codec {
780 struct device *dev; 785 struct device *dev;
781 const struct snd_soc_codec_driver *driver; 786 const struct snd_soc_codec_driver *driver;
782 787
783 struct mutex mutex;
784 struct list_head list; 788 struct list_head list;
785 struct list_head card_list; 789 struct list_head card_list;
786 790
787 /* runtime */ 791 /* runtime */
788 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
789 unsigned int cache_bypass:1; /* Suppress access to the cache */ 792 unsigned int cache_bypass:1; /* Suppress access to the cache */
790 unsigned int suspended:1; /* Codec is in suspend PM state */ 793 unsigned int suspended:1; /* Codec is in suspend PM state */
791 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
792 unsigned int ac97_created:1; /* Codec has been created by SoC */
793 unsigned int cache_init:1; /* codec cache has been initialized */ 794 unsigned int cache_init:1; /* codec cache has been initialized */
794 u32 cache_sync; /* Cache needs to be synced to hardware */
795 795
796 /* codec IO */ 796 /* codec IO */
797 void *control_data; /* codec control (i2c/3wire) data */ 797 void *control_data; /* codec control (i2c/3wire) data */
798 hw_write_t hw_write; 798 hw_write_t hw_write;
799 void *reg_cache; 799 void *reg_cache;
800 struct mutex cache_rw_mutex;
801 800
802 /* component */ 801 /* component */
803 struct snd_soc_component component; 802 struct snd_soc_component component;
@@ -860,8 +859,6 @@ struct snd_soc_platform_driver {
860 859
861 int (*probe)(struct snd_soc_platform *); 860 int (*probe)(struct snd_soc_platform *);
862 int (*remove)(struct snd_soc_platform *); 861 int (*remove)(struct snd_soc_platform *);
863 int (*suspend)(struct snd_soc_dai *dai);
864 int (*resume)(struct snd_soc_dai *dai);
865 struct snd_soc_component_driver component_driver; 862 struct snd_soc_component_driver component_driver;
866 863
867 /* pcm creation and destruction */ 864 /* pcm creation and destruction */
@@ -886,7 +883,7 @@ struct snd_soc_platform_driver {
886 883
887struct snd_soc_dai_link_component { 884struct snd_soc_dai_link_component {
888 const char *name; 885 const char *name;
889 const struct device_node *of_node; 886 struct device_node *of_node;
890 const char *dai_name; 887 const char *dai_name;
891}; 888};
892 889
@@ -894,8 +891,6 @@ struct snd_soc_platform {
894 struct device *dev; 891 struct device *dev;
895 const struct snd_soc_platform_driver *driver; 892 const struct snd_soc_platform_driver *driver;
896 893
897 unsigned int suspended:1; /* platform is suspended */
898
899 struct list_head list; 894 struct list_head list;
900 895
901 struct snd_soc_component component; 896 struct snd_soc_component component;
@@ -990,7 +985,7 @@ struct snd_soc_codec_conf {
990 * DT/OF node, but not both. 985 * DT/OF node, but not both.
991 */ 986 */
992 const char *dev_name; 987 const char *dev_name;
993 const struct device_node *of_node; 988 struct device_node *of_node;
994 989
995 /* 990 /*
996 * optional map of kcontrol, widget and path name prefixes that are 991 * optional map of kcontrol, widget and path name prefixes that are
@@ -1007,7 +1002,7 @@ struct snd_soc_aux_dev {
1007 * DT/OF node, but not both. 1002 * DT/OF node, but not both.
1008 */ 1003 */
1009 const char *codec_name; 1004 const char *codec_name;
1010 const struct device_node *codec_of_node; 1005 struct device_node *codec_of_node;
1011 1006
1012 /* codec/machine specific init - e.g. add machine controls */ 1007 /* codec/machine specific init - e.g. add machine controls */
1013 int (*init)(struct snd_soc_component *component); 1008 int (*init)(struct snd_soc_component *component);
@@ -1264,6 +1259,17 @@ unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
1264int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, 1259int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
1265 unsigned int val); 1260 unsigned int val);
1266 1261
1262/**
1263 * snd_soc_cache_sync() - Sync the register cache with the hardware
1264 * @codec: CODEC to sync
1265 *
1266 * Note: This function will call regcache_sync()
1267 */
1268static inline int snd_soc_cache_sync(struct snd_soc_codec *codec)
1269{
1270 return regcache_sync(codec->component.regmap);
1271}
1272
1267/* component IO */ 1273/* component IO */
1268int snd_soc_component_read(struct snd_soc_component *component, 1274int snd_soc_component_read(struct snd_soc_component *component,
1269 unsigned int reg, unsigned int *val); 1275 unsigned int reg, unsigned int *val);
@@ -1277,6 +1283,45 @@ void snd_soc_component_async_complete(struct snd_soc_component *component);
1277int snd_soc_component_test_bits(struct snd_soc_component *component, 1283int snd_soc_component_test_bits(struct snd_soc_component *component,
1278 unsigned int reg, unsigned int mask, unsigned int value); 1284 unsigned int reg, unsigned int mask, unsigned int value);
1279 1285
1286#ifdef CONFIG_REGMAP
1287
1288void snd_soc_component_init_regmap(struct snd_soc_component *component,
1289 struct regmap *regmap);
1290void snd_soc_component_exit_regmap(struct snd_soc_component *component);
1291
1292/**
1293 * snd_soc_codec_init_regmap() - Initialize regmap instance for the CODEC
1294 * @codec: The CODEC for which to initialize the regmap instance
1295 * @regmap: The regmap instance that should be used by the CODEC
1296 *
1297 * This function allows deferred assignment of the regmap instance that is
1298 * associated with the CODEC. Only use this if the regmap instance is not yet
1299 * ready when the CODEC is registered. The function must also be called before
1300 * the first IO attempt of the CODEC.
1301 */
1302static inline void snd_soc_codec_init_regmap(struct snd_soc_codec *codec,
1303 struct regmap *regmap)
1304{
1305 snd_soc_component_init_regmap(&codec->component, regmap);
1306}
1307
1308/**
1309 * snd_soc_codec_exit_regmap() - De-initialize regmap instance for the CODEC
1310 * @codec: The CODEC for which to de-initialize the regmap instance
1311 *
1312 * Calls regmap_exit() on the regmap instance associated to the CODEC and
1313 * removes the regmap instance from the CODEC.
1314 *
1315 * This function should only be used if snd_soc_codec_init_regmap() was used to
1316 * initialize the regmap instance.
1317 */
1318static inline void snd_soc_codec_exit_regmap(struct snd_soc_codec *codec)
1319{
1320 snd_soc_component_exit_regmap(&codec->component);
1321}
1322
1323#endif
1324
1280/* device driver data */ 1325/* device driver data */
1281 1326
1282static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card, 1327static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
@@ -1451,6 +1496,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
1451 struct device_node **framemaster); 1496 struct device_node **framemaster);
1452int snd_soc_of_get_dai_name(struct device_node *of_node, 1497int snd_soc_of_get_dai_name(struct device_node *of_node,
1453 const char **dai_name); 1498 const char **dai_name);
1499int snd_soc_of_get_dai_link_codecs(struct device *dev,
1500 struct device_node *of_node,
1501 struct snd_soc_dai_link *dai_link);
1454 1502
1455#include <sound/soc-dai.h> 1503#include <sound/soc-dai.h>
1456 1504
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h
index e475659bd3be..509efb050176 100644
--- a/include/sound/uda134x.h
+++ b/include/sound/uda134x.h
@@ -18,18 +18,6 @@ struct uda134x_platform_data {
18 struct l3_pins l3; 18 struct l3_pins l3;
19 void (*power) (int); 19 void (*power) (int);
20 int model; 20 int model;
21 /*
22 ALSA SOC usually puts the device in standby mode when it's not used
23 for sometime. If you unset is_powered_on_standby the driver will
24 turn off the ADC/DAC when this callback is invoked and turn it back
25 on when needed. Unfortunately this will result in a very light bump
26 (it can be audible only with good earphones). If this bothers you
27 set is_powered_on_standby, you will have slightly higher power
28 consumption. Please note that sending the L3 command for ADC is
29 enough to make the bump, so it doesn't make difference if you
30 completely take off power from the codec.
31 */
32 int is_powered_on_standby;
33#define UDA134X_UDA1340 1 21#define UDA134X_UDA1340 1
34#define UDA134X_UDA1341 2 22#define UDA134X_UDA1341 2
35#define UDA134X_UDA1344 3 23#define UDA134X_UDA1344 3