ASoC updates
Subsystems (10)
cover ASoC updates
The following changes since commit 28a1d869560a49d960ba2a3b450ec965712e5560:
Daniel Mack (1):
ASoC: tlv320aic3x: control additions and cleanups
are available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asoc for-tiwai
Mark Brown (9):
ASoC: Add card registration API
ASoC: Add DAI registration API
ASoC: Register platform DAIs
ASoC: Add platform registration API
ASoC: Register platform drivers
ASoC: Register non-AC97 codec DAIs
ASoC: Initial framework for dynamic card instantiation
ASoC: Wait for non-AC97 codec DAIs before instantiating
ASoC: Convert WM8900 to allow registration by machine code
Peter Ujfalusi (9):
ASoC: TWL4030: Correct DAPM_DAC with power control
ASoC: TWL4030: Add Analog PGA control switch to DAPM
ASoC: TWL4030: Add DAPM event handler for output MUX selection
ASoC: TWL4030: DAPM mapping of the Earpiece output
ASoC: TWL4030: DAPM mapping of the PreDriv outputs
ASoC: TWL4030: DAPM mapping of the Headset outputs
ASoC: TWL4030: DAPM mapping of the Carkit outputs
ASoC: TWL4030: DAPM mapping of the Handsfree outputs
ASoC: TWL4030: Do not alter the Headset output volume on power-up/down
include/sound/soc-dai.h | 8 + include/sound/soc.h | 10 ++ sound/soc/atmel/atmel-pcm.c | 12 ++ sound/soc/atmel/atmel_ssc_dai.c | 11 ++ sound/soc/au1x/dbdma2.c | 3 +- sound/soc/au1x/psc-ac97.c | 3 +- sound/soc/au1x/psc-i2s.c | 3 +- sound/soc/blackfin/bf5xx-ac97-pcm.c | 12 ++ sound/soc/blackfin/bf5xx-ac97.c | 12 ++ sound/soc/blackfin/bf5xx-i2s-pcm.c | 12 ++ sound/soc/blackfin/bf5xx-i2s.c | 12 ++ sound/soc/codecs/ad73311.c | 12 ++ sound/soc/codecs/ak4535.c | 12 ++ sound/soc/codecs/cs4270.c | 12 ++ sound/soc/codecs/pcm3008.c | 12 ++ sound/soc/codecs/ssm2602.c | 12 ++ sound/soc/codecs/tlv320aic23.c | 12 ++ sound/soc/codecs/tlv320aic26.c | 15 ++- sound/soc/codecs/tlv320aic3x.c | 12 ++ sound/soc/codecs/twl4030.c | 277 +++++++++++++++++++++++++++++++-- sound/soc/codecs/uda134x.c | 12 ++ sound/soc/codecs/uda1380.c | 12 ++ sound/soc/codecs/wm8510.c | 12 ++ sound/soc/codecs/wm8580.c | 12 ++ sound/soc/codecs/wm8728.c | 12 ++ sound/soc/codecs/wm8731.c | 12 ++ sound/soc/codecs/wm8750.c | 12 ++ sound/soc/codecs/wm8753.c | 12 ++ sound/soc/codecs/wm8900.c | 105 ++++--------- sound/soc/codecs/wm8903.c | 12 ++ sound/soc/codecs/wm8971.c | 12 ++ sound/soc/codecs/wm8990.c | 12 ++ sound/soc/davinci/davinci-i2s.c | 12 ++ sound/soc/davinci/davinci-pcm.c | 12 ++ sound/soc/fsl/fsl_dma.c | 12 ++ sound/soc/fsl/fsl_ssi.c | 10 ++ sound/soc/fsl/mpc5200_psc_i2s.c | 4 + sound/soc/omap/omap-mcbsp.c | 13 ++ sound/soc/omap/omap-pcm.c | 12 ++ sound/soc/pxa/pxa-ssp.c | 12 ++ sound/soc/pxa/pxa2xx-ac97.c | 12 ++ sound/soc/pxa/pxa2xx-i2s.c | 13 ++- sound/soc/pxa/pxa2xx-pcm.c | 12 ++ sound/soc/s3c24xx/s3c2412-i2s.c | 13 ++ sound/soc/s3c24xx/s3c2443-ac97.c | 13 ++ sound/soc/s3c24xx/s3c24xx-i2s.c | 12 ++ sound/soc/s3c24xx/s3c24xx-pcm.c | 12 ++ sound/soc/sh/dma-sh7760.c | 12 ++ sound/soc/sh/hac.c | 12 ++ sound/soc/sh/ssi.c | 12 ++ sound/soc/soc-core.c | 291 +++++++++++++++++++++++++++++++++-- 51 files changed, 1102 insertions(+), 110 deletions(-)
PATCH 1/18 ASoC: TWL4030: Correct DAPM_DAC with power control
From: Peter Ujfalusi <[email protected]>
Add all four DACs to dapm_widgets with power switch.
--- sound/soc/codecs/twl4030.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-)
sound/soc/codecs/twl4030.c +11 -4
@@ -616,8 +616,15 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_OUTPUT ("OUTL" ),SND_SOC_DAPM_OUTPUT ("OUTR" ), -SND_SOC_DAPM_DAC ("DACL" ,"Left Playback" ,SND_SOC_NOPM ,0 ,0 ), -SND_SOC_DAPM_DAC ("DACR" ,"Right Playback" ,SND_SOC_NOPM ,0 ,0 ), +/* DACs */ +SND_SOC_DAPM_DAC ("DACR1" ,"Right Front Playback" , +TWL4030_REG_AVDAC_CTL ,0 ,0 ), +SND_SOC_DAPM_DAC ("DACL1" ,"Left Front Playback" , +TWL4030_REG_AVDAC_CTL ,1 ,0 ), +SND_SOC_DAPM_DAC ("DACR2" ,"Right Rear Playback" , +TWL4030_REG_AVDAC_CTL ,2 ,0 ), +SND_SOC_DAPM_DAC ("DACL2" ,"Left Rear Playback" , +TWL4030_REG_AVDAC_CTL ,3 ,0 ),SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -625,8 +632,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {static const struct snd_soc_dapm_route intercon[] = {/* outputs */ - {"OUTL" ,NULL ,"DACL" }, - {"OUTR" ,NULL ,"DACR" }, + {"OUTL" ,NULL ,"DACL2" }, + {"OUTR" ,NULL ,"DACR2" },/* inputs */ {"ADCL" ,NULL ,"INL" },
Signature · 1 line
1.5.6.5
PATCH 2/18 ASoC: TWL4030: Add Analog PGA control switch to DAPM
From: Peter Ujfalusi <[email protected]>
Add all four APGA switch to DAPM routing and widgets. Add user control for DA enable for all APGA as normal control.
--- sound/soc/codecs/twl4030.c | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +23 -2
@@ -562,6 +562,12 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = {SOC_DOUBLE_R_TLV ("DAC2 Analog Playback Volume" ,TWL4030_REG_ARXL2_APGA_CTL ,TWL4030_REG_ARXR2_APGA_CTL ,3 ,0x12 ,1 , analog_tlv), +SOC_DOUBLE_R ("DAC1 Analog Playback Switch" , +TWL4030_REG_ARXL1_APGA_CTL ,TWL4030_REG_ARXR1_APGA_CTL , +1 ,1 ,0 ), +SOC_DOUBLE_R ("DAC2 Analog Playback Switch" , +TWL4030_REG_ARXL2_APGA_CTL ,TWL4030_REG_ARXR2_APGA_CTL , +1 ,1 ,0 ),/* Separate output gain controls */ SOC_DOUBLE_R_TLV_TWL4030("PreDriv Playback Volume",
@@ -626,14 +632,29 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_DAC ("DACL2" ,"Left Rear Playback" ,TWL4030_REG_AVDAC_CTL ,3 ,0 ), +/* Analog PGAs */ +SND_SOC_DAPM_PGA ("ARXR1_APGA" ,TWL4030_REG_ARXR1_APGA_CTL , +0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_PGA ("ARXL1_APGA" ,TWL4030_REG_ARXL1_APGA_CTL , +0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_PGA ("ARXR2_APGA" ,TWL4030_REG_ARXR2_APGA_CTL , +0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_PGA ("ARXL2_APGA" ,TWL4030_REG_ARXL2_APGA_CTL , +0 ,0 ,NULL ,0 ), +SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), };static const struct snd_soc_dapm_route intercon[] = { + {"ARXL1_APGA" ,NULL ,"DACL1" }, + {"ARXR1_APGA" ,NULL ,"DACR1" }, + {"ARXL2_APGA" ,NULL ,"DACL2" }, + {"ARXR2_APGA" ,NULL ,"DACR2" }, +/* outputs */ - {"OUTL" ,NULL ,"DACL2" }, - {"OUTR" ,NULL ,"DACR2" }, + {"OUTL" ,NULL ,"ARXL2_APGA" }, + {"OUTR" ,NULL ,"ARXR2_APGA" },/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 3/18 ASoC: TWL4030: Add DAPM event handler for output MUX selection
From: Peter Ujfalusi <[email protected]>
DAPM event handler is set to filter out invalid MUX settings for certain outputs.
Earpiece:
- 0 = Off
- 1 = DACL1
- 2 = DACL2
- 3 = *** Invalid ***
- 4 = DACR1
PreDriveL/R:
- 0 = Off/Off
- 1 = DACL1/DACR1
- 2 = DACL2/DACR2
- 3 = *** Invalid/Invalid ***
- 4 = DACR2/DACL2
--- sound/soc/codecs/twl4030.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +24 -0
@@ -190,6 +190,30 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) } +static int outmixer_event (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol,int event) +{ +struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; +int ret =0 ; +int val; + +switch (e->reg) { +case TWL4030_REG_PREDL_CTL : +case TWL4030_REG_PREDR_CTL : +case TWL4030_REG_EAR_CTL : + val = w->value >> e->shift_l; +if (val ==3 ) { +printk (KERN_WARNING +"Invalid MUX setting for register 0x%02x (%d)\n" , + e->reg, val); + ret =-1 ; + } +break ; + } + +return ret; +} +/* * Some of the gain controls in TWL (mostly those which are associated with * the outputs) are implemented in an interesting way:
Signature · 1 line
1.5.6.5
PATCH 4/18 ASoC: TWL4030: DAPM mapping of the Earpiece output
From: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Earpiece output.
--- sound/soc/codecs/twl4030.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +27 -0
@@ -190,6 +190,19 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) } +/* Earpiece */ +static const char *twl4030_earpiece_texts[] = + {"Off" ,"DACL1" ,"DACL2" ,"Invalid" , +"DACR1" }; + +static const struct soc_enum twl4030_earpiece_enum = +SOC_ENUM_SINGLE (TWL4030_REG_EAR_CTL ,1 , +ARRAY_SIZE (twl4030_earpiece_texts), + twl4030_earpiece_texts); + +static const struct snd_kcontrol_new twl4030_dapm_earpiece_control = +SOC_DAPM_ENUM ("Route" , twl4030_earpiece_enum); +static int outmixer_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -645,6 +658,7 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_OUTPUT ("OUTL" ),SND_SOC_DAPM_OUTPUT ("OUTR" ), +SND_SOC_DAPM_OUTPUT ("EARPIECE" ),/* DACs */ SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -666,6 +680,12 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_PGA ("ARXL2_APGA" ,TWL4030_REG_ARXL2_APGA_CTL ,0 ,0 ,NULL ,0 ), +/* Output MUX controls */ +/* Earpiece */ +SND_SOC_DAPM_MUX_E ("Earpiece Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_earpiece_control, outmixer_event, +SND_SOC_DAPM_PRE_REG ), +SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), };
@@ -676,9 +696,16 @@ static const struct snd_soc_dapm_route intercon[] = { {"ARXL2_APGA", NULL, "DACL2"}, {"ARXR2_APGA", NULL, "DACR2"}, +/* Internal playback routings */ +/* Earpiece */ + {"Earpiece Mux", "DACL1", "ARXL1_APGA"}, + {"Earpiece Mux", "DACL2", "ARXL2_APGA"}, + {"Earpiece Mux", "DACR1", "ARXR1_APGA"}, +/* outputs */ {"OUTL", NULL, "ARXL2_APGA"}, {"OUTR", NULL, "ARXR2_APGA"}, + {"EARPIECE", NULL, "Earpiece Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 5/18 ASoC: TWL4030: DAPM mapping of the PreDriv outputs
From: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the PreDrive outputs.
--- sound/soc/codecs/twl4030.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +45 -0
@@ -203,6 +203,32 @@ static const struct soc_enum twl4030_earpiece_enum =static const struct snd_kcontrol_new twl4030_dapm_earpiece_control =SOC_DAPM_ENUM ("Route" , twl4030_earpiece_enum); +/* PreDrive Left */ +static const char *twl4030_predrivel_texts[] = + {"Off" ,"DACL1" ,"DACL2" ,"Invalid" , +"DACR2" }; + +static const struct soc_enum twl4030_predrivel_enum = +SOC_ENUM_SINGLE (TWL4030_REG_PREDL_CTL ,1 , +ARRAY_SIZE (twl4030_predrivel_texts), + twl4030_predrivel_texts); + +static const struct snd_kcontrol_new twl4030_dapm_predrivel_control = +SOC_DAPM_ENUM ("Route" , twl4030_predrivel_enum); + +/* PreDrive Right */ +static const char *twl4030_predriver_texts[] = + {"Off" ,"DACR1" ,"DACR2" ,"Invalid" , +"DACL2" }; + +static const struct soc_enum twl4030_predriver_enum = +SOC_ENUM_SINGLE (TWL4030_REG_PREDR_CTL ,1 , +ARRAY_SIZE (twl4030_predriver_texts), + twl4030_predriver_texts); + +static const struct snd_kcontrol_new twl4030_dapm_predriver_control = +SOC_DAPM_ENUM ("Route" , twl4030_predriver_enum); +static int outmixer_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -659,6 +685,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_OUTPUT ("OUTL" ),SND_SOC_DAPM_OUTPUT ("OUTR" ),SND_SOC_DAPM_OUTPUT ("EARPIECE" ), +SND_SOC_DAPM_OUTPUT ("PREDRIVEL" ), +SND_SOC_DAPM_OUTPUT ("PREDRIVER" ),/* DACs */ SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -685,6 +713,13 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_MUX_E ("Earpiece Mux" ,SND_SOC_NOPM ,0 ,0 , &twl4030_dapm_earpiece_control, outmixer_event,SND_SOC_DAPM_PRE_REG ), +/* PreDrivL/R */ +SND_SOC_DAPM_MUX_E ("PredriveL Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_predrivel_control, outmixer_event, +SND_SOC_DAPM_PRE_REG ), +SND_SOC_DAPM_MUX_E ("PredriveR Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_predriver_control, outmixer_event, +SND_SOC_DAPM_PRE_REG ),SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -701,11 +736,21 @@ static const struct snd_soc_dapm_route intercon[] = { {"Earpiece Mux", "DACL1", "ARXL1_APGA"}, {"Earpiece Mux", "DACL2", "ARXL2_APGA"}, {"Earpiece Mux", "DACR1", "ARXR1_APGA"}, +/* PreDrivL */ + {"PredriveL Mux", "DACL1", "ARXL1_APGA"}, + {"PredriveL Mux", "DACL2", "ARXL2_APGA"}, + {"PredriveL Mux", "DACR2", "ARXR2_APGA"}, +/* PreDrivR */ + {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, + {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, + {"PredriveR Mux", "DACL2", "ARXL2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"}, {"OUTR", NULL, "ARXR2_APGA"}, {"EARPIECE", NULL, "Earpiece Mux"}, + {"PREDRIVEL", NULL, "PredriveL Mux"}, + {"PREDRIVER", NULL, "PredriveR Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 7/18 ASoC: TWL4030: DAPM mapping of the Carkit outputs
In reply to Mark BrownFrom: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Carkit outputs.
--- sound/soc/codecs/twl4030.c | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +37 -0
@@ -253,6 +253,30 @@ static const struct soc_enum twl4030_hsor_enum =static const struct snd_kcontrol_new twl4030_dapm_hsor_control =SOC_DAPM_ENUM ("Route" , twl4030_hsor_enum); +/* Carkit Left */ +static const char *twl4030_carkitl_texts[] = + {"Off" ,"DACL1" ,"DACL2" }; + +static const struct soc_enum twl4030_carkitl_enum = +SOC_ENUM_SINGLE (TWL4030_REG_PRECKL_CTL ,1 , +ARRAY_SIZE (twl4030_carkitl_texts), + twl4030_carkitl_texts); + +static const struct snd_kcontrol_new twl4030_dapm_carkitl_control = +SOC_DAPM_ENUM ("Route" , twl4030_carkitl_enum); + +/* Carkit Right */ +static const char *twl4030_carkitr_texts[] = + {"Off" ,"DACR1" ,"DACR2" }; + +static const struct soc_enum twl4030_carkitr_enum = +SOC_ENUM_SINGLE (TWL4030_REG_PRECKR_CTL ,1 , +ARRAY_SIZE (twl4030_carkitr_texts), + twl4030_carkitr_texts); + +static const struct snd_kcontrol_new twl4030_dapm_carkitr_control = +SOC_DAPM_ENUM ("Route" , twl4030_carkitr_enum); +static int outmixer_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -751,6 +775,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { &twl4030_dapm_hsol_control),SND_SOC_DAPM_MUX ("HeadsetR Mux" ,SND_SOC_NOPM ,0 ,0 , &twl4030_dapm_hsor_control), +/* CarkitL/R */ +SND_SOC_DAPM_MUX ("CarkitL Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_carkitl_control), +SND_SOC_DAPM_MUX ("CarkitR Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_carkitr_control),SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -781,6 +810,12 @@ static const struct snd_soc_dapm_route intercon[] = {/* HeadsetR */ {"HeadsetR Mux", "DACR1", "ARXR1_APGA"}, {"HeadsetR Mux", "DACR2", "ARXR2_APGA"}, +/* CarkitL */ + {"CarkitL Mux", "DACL1", "ARXL1_APGA"}, + {"CarkitL Mux", "DACL2", "ARXL2_APGA"}, +/* CarkitR */ + {"CarkitR Mux", "DACR1", "ARXR1_APGA"}, + {"CarkitR Mux", "DACR2", "ARXR2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"},
@@ -790,6 +825,8 @@ static const struct snd_soc_dapm_route intercon[] = { {"PREDRIVER", NULL, "PredriveR Mux"}, {"HSOL", NULL, "HeadsetL Mux"}, {"HSOR", NULL, "HeadsetR Mux"}, + {"CARKITL", NULL, "CarkitL Mux"}, + {"CARKITR", NULL, "CarkitR Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 10/18 ASoC: Add card registration API
In reply to Mark BrownASoC v2 allows cards, codecs and platforms to instantiate separately, with the overall ASoC device only being instantiated once all the required components have registered. As part of backporting Liam's work introduce an initial version of the card registration functions. At present these do nothing active and are internal only, they will be exposed to machine drivers after further backporting. Adding this now allows the datastructures used for dynamic card instantiation to be built up gradually.
--- include/sound/soc.h | 5 ++++ sound/soc/soc-core.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 0 deletions(-)
include/sound/soc.h +5 -0
@@ -333,6 +333,11 @@ struct snd_soc_dai_link {/* SoC card */ struct snd_soc_card {char *name; +struct device *dev; + +struct list_head list; + +int instantiated;int (*probe)(struct platform_device *pdev);int (*remove)(struct platform_device *pdev);
sound/soc/soc-core.c +62 -0
86 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 12/18 ASoC: Register platform DAIs
In reply to Mark BrownRegister all platform DAIs with the core. In line with current behaviour this is done at module probe time rather than when the devices are probed (since currently that only happens as the entire ASoC card is registered except for those drivers that currently implement some kind of hotplug). Since the core currently ignores DAI registration this has no practical effect.
--- sound/soc/atmel/atmel_ssc_dai.c | 11 +++++++++++ sound/soc/au1x/psc-ac97.c | 3 ++- sound/soc/au1x/psc-i2s.c | 3 ++- sound/soc/blackfin/bf5xx-ac97.c | 12 ++++++++++++ sound/soc/blackfin/bf5xx-i2s.c | 12 ++++++++++++ sound/soc/davinci/davinci-i2s.c | 12 ++++++++++++ sound/soc/fsl/fsl_ssi.c | 10 ++++++++++ sound/soc/omap/omap-mcbsp.c | 13 +++++++++++++ sound/soc/pxa/pxa-ssp.c | 12 ++++++++++++ sound/soc/pxa/pxa2xx-ac97.c | 12 ++++++++++++ sound/soc/pxa/pxa2xx-i2s.c | 13 ++++++++++++- sound/soc/s3c24xx/s3c2412-i2s.c | 13 +++++++++++++ sound/soc/s3c24xx/s3c2443-ac97.c | 13 +++++++++++++ sound/soc/s3c24xx/s3c24xx-i2s.c | 12 ++++++++++++ sound/soc/sh/hac.c | 12 ++++++++++++ sound/soc/sh/ssi.c | 12 ++++++++++++ 16 files changed, 172 insertions(+), 3 deletions(-)
sound/soc/atmel/atmel_ssc_dai.c +11 -0
@@ -772,6 +772,17 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { };EXPORT_SYMBOL_GPL (atmel_ssc_dai); +static int __devinit atmel_ssc_modinit (void ) +{ +return snd_soc_register_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); +} +module_init (snd_soc_init); + +static void __exit snd_soc_exit(void) +{ +snd_soc_unregister_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); +} +/* Module information */ MODULE_AUTHOR ("Sedji Gaouaou, [email protected], www.atmel.com" );MODULE_DESCRIPTION ("ATMEL SSC ASoC Interface" );
sound/soc/au1x/psc-ac97.c +2 -1
@@ -371,11 +371,12 @@ EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai);static int __init au1xpsc_ac97_init (void ) { au1xpsc_ac97_workdata =NULL ; -return 0 ; +return snd_soc_register_dai (&au1xpsc_ac97_dai); } static void __exit au1xpsc_ac97_exit(void) { +snd_soc_unregister_dai (&au1xpsc_ac97_dai); }module_init (au1xpsc_ac97_init);
sound/soc/au1x/psc-i2s.c +2 -1
@@ -396,11 +396,12 @@ EXPORT_SYMBOL(au1xpsc_i2s_dai);static int __init au1xpsc_i2s_init (void ) { au1xpsc_i2s_workdata =NULL ; -return 0 ; +return snd_soc_register_dai (&au1xpsc_i2s_dai); } static void __exit au1xpsc_i2s_exit(void) { +snd_soc_unregister_dai (&au1xpsc_i2s_dai); }module_init (au1xpsc_i2s_init);
sound/soc/blackfin/bf5xx-ac97.c +12 -0
@@ -431,6 +431,18 @@ struct snd_soc_dai bfin_ac97_dai = { };EXPORT_SYMBOL_GPL (bfin_ac97_dai); +static int __devinit bfin_ac97_init (void ) +{ +return snd_soc_register_dai (&bfin_ac97_dai); +} +module_init (bfin_ac97_init); + +static void __exit bfin_ac97_exit(void) +{ +snd_soc_unregister_dai (&bfin_ac97_dai); +} +module_exit (bfin_ac97_exit); +MODULE_AUTHOR ("Roy Huang" );MODULE_DESCRIPTION ("AC97 driver for ADI Blackfin" );MODULE_LICENSE ("GPL" );
sound/soc/blackfin/bf5xx-i2s.c +12 -0
@@ -313,6 +313,18 @@ struct snd_soc_dai bf5xx_i2s_dai = { };EXPORT_SYMBOL_GPL (bf5xx_i2s_dai); +static int __devinit bfin_i2s_init (void ) +{ +return snd_soc_register_dai (&bfin_i2s_dai); +} +module_init (bfin_i2s_init); + +static void __exit bfin_i2s_exit(void) +{ +snd_soc_unregister_dai (&bfin_i2s_dai); +} +module_exit (bfin_i2s_exit); +/* Module information */ MODULE_AUTHOR ("Cliff Cai" );MODULE_DESCRIPTION ("I2S driver for ADI Blackfin" );
sound/soc/davinci/davinci-i2s.c +12 -0
@@ -481,6 +481,18 @@ struct snd_soc_dai davinci_i2s_dai = { };EXPORT_SYMBOL_GPL (davinci_i2s_dai); +static int __devinit davinci_i2s_init (void ) +{ +return snd_soc_register_dai (&davinci_i2s_dai); +} +module_init (davinci_i2s_init); + +static void __exit davinci_i2s_exit(void) +{ +snd_soc_unregister_dai (&davinci_i2s_dai); +} +module_exit (davinci_i2s_exit); +MODULE_AUTHOR ("Vladimir Barinov" );MODULE_DESCRIPTION ("TI DAVINCI I2S (McBSP) SoC Interface" );MODULE_LICENSE ("GPL" );
sound/soc/fsl/fsl_ssi.c +10 -0
@@ -673,6 +673,14 @@ struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info) fsl_ssi_dai->private_data = ssi_private; fsl_ssi_dai->name = ssi_private->name; fsl_ssi_dai->id = ssi_info->id; + fsl_ssi_dai->dev = ssi_info->dev; + + ret =snd_soc_register_dai (fsl_ssi_dai); +if (ret !=0 ) { +dev_err (ssi_info->dev,"failed to register DAI: %d\n" , ret); +kfree (fsl_ssi_dai); +return NULL ; + }return fsl_ssi_dai; }
@@ -690,6 +698,8 @@ void fsl_ssi_destroy_dai(struct snd_soc_dai *fsl_ssi_dai)device_remove_file (ssi_private->dev, &ssi_private->dev_attr); +snd_soc_unregister_dai (&ssi_private->cpu_dai); +kfree (ssi_private); }EXPORT_SYMBOL_GPL (fsl_ssi_destroy_dai);
sound/soc/omap/omap-mcbsp.c +13 -0
@@ -499,6 +499,19 @@ struct snd_soc_dai omap_mcbsp_dai[] = {EXPORT_SYMBOL_GPL (omap_mcbsp_dai); +static int __devinit omap_mcbsp_init (void ) +{ +return snd_soc_register_dais (omap_mcbsp_dai, +ARRAY_SIZE (omap_mcbsp_dai)); +} +module_init (omap_mcbsp_init); + +static void __exit omap_mcbsp_exit(void) +{ +snd_soc_unregister_dais (omap_mcbsp_dai,ARRAY_SIZE (omap_mcbsp_dai)); +} +module_exit (omap_mcbsp_exit); +MODULE_AUTHOR ("Jarkko Nikula <[email protected]>" );MODULE_DESCRIPTION ("OMAP I2S SoC Interface" );MODULE_LICENSE ("GPL" );
sound/soc/pxa/pxa-ssp.c +12 -0
@@ -913,6 +913,18 @@ struct snd_soc_dai pxa_ssp_dai[] = { };EXPORT_SYMBOL_GPL (pxa_ssp_dai); +static int __devinit pxa_ssp_init (void ) +{ +return snd_soc_register_dais (pxa_ssp_dai,ARRAY_SIZE (pxa_ssp_dai)); +} +module_init (pxa_ssp_init); + +static void __exit pxa_ssp_exit(void) +{ +snd_soc_unregister_dais (pxa_ssp_dai,ARRAY_SIZE (pxa_ssp_dai)); +} +module_exit (pxa_ssp_exit); +/* Module information */ MODULE_AUTHOR ("Mark Brown <[email protected]>" );MODULE_DESCRIPTION ("PXA SSP/PCM SoC Interface" );
sound/soc/pxa/pxa2xx-ac97.c +12 -0
@@ -228,6 +228,18 @@ struct snd_soc_dai pxa_ac97_dai[] = {EXPORT_SYMBOL_GPL (pxa_ac97_dai);EXPORT_SYMBOL_GPL (soc_ac97_ops); +static int __devinit pxa_ac97_init (void ) +{ +return snd_soc_register_dais (pxa_ac97_dai,ARRAY_SIZE (pxa_ac97_dai)); +} +module_init (pxa_ac97_init); + +static void __exit pxa_ac97_exit(void) +{ +snd_soc_unregister_dais (pxa_ac97_dai,ARRAY_SIZE (pxa_ac97_dai)); +} +module_exit (pxa_ac97_exit); +MODULE_AUTHOR ("Nicolas Pitre" );MODULE_DESCRIPTION ("AC97 driver for the Intel PXA2xx chip" );MODULE_LICENSE ("GPL" );
sound/soc/pxa/pxa2xx-i2s.c +12 -1
@@ -364,12 +364,23 @@ EXPORT_SYMBOL_GPL(pxa_i2s_dai);static int pxa2xx_i2s_probe (struct platform_device *dev) { +int ret; + clk_i2s =clk_get (&dev->dev,"I2SCLK" ); -return IS_ERR (clk_i2s) ?PTR_ERR (clk_i2s) :0 ; +if (IS_ERR (clk_i2s)) +return PTR_ERR (clk_i2s); + + pxa_i2s_dai.dev = &dev->dev; + ret =snd_soc_register_dai (&pxa_i2s_dai); +if (ret !=0 ) +clk_put (clk_i2s); + +return ret; } static int __devexit pxa2xx_i2s_remove(struct platform_device *dev) { +snd_soc_unregister_dai (&pxa_i2s_dai);clk_put (clk_i2s); clk_i2s =ERR_PTR (-ENOENT );return 0 ;
sound/soc/s3c24xx/s3c2412-i2s.c +13 -0
@@ -736,6 +736,19 @@ struct snd_soc_dai s3c2412_i2s_dai = { };EXPORT_SYMBOL_GPL (s3c2412_i2s_dai); +static int __devinit s3c2412_i2s_init (void ) +{ +return snd_soc_register_dai (&s3c2412_i2s_dai); +} +module_init (s3c2412_i2s_init); + +static void __exit s3c2412_i2s_exit(void) +{ +snd_soc_unregister_dai (&s3c2412_i2s_dai); +} +module_exit (s3c2412_i2s_exit); + +/* Module information */ MODULE_AUTHOR ("Ben Dooks, <[email protected]>" );MODULE_DESCRIPTION ("S3C2412 I2S SoC Interface" );
sound/soc/s3c24xx/s3c2443-ac97.c +13 -0
@@ -396,6 +396,19 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {EXPORT_SYMBOL_GPL (s3c2443_ac97_dai);EXPORT_SYMBOL_GPL (soc_ac97_ops); +static int __devinit s3c2443_ac97_init (void ) +{ +return snd_soc_register_dai (&s3c2443_ac97_dai); +} +module_init (s3c2443_ac97_init); + +static void __exit s3c2443_ac97_exit(void) +{ +snd_soc_unregister_dai (&s3c2443_ac97_dai); +} +module_exit (s3c2443_ac97_exit); + +MODULE_AUTHOR ("Graeme Gregory" );MODULE_DESCRIPTION ("AC97 driver for the Samsung s3c2443 chip" );MODULE_LICENSE ("GPL" );
sound/soc/s3c24xx/s3c24xx-i2s.c +12 -0
@@ -482,6 +482,18 @@ struct snd_soc_dai s3c24xx_i2s_dai = { };EXPORT_SYMBOL_GPL (s3c24xx_i2s_dai); +static int __devinit s3c24xx_i2s_init (void ) +{ +return snd_soc_register_dai (&s3c24xx_i2s_dai); +} +module_init (s3c24xx_i2s_init); + +static void __exit s3c24xx_i2s_exit(void) +{ +snd_soc_unregister_dai (&s3c24xx_i2s_dai); +} +module_exit (s3c24xx_i2s_exit); +/* Module information */ MODULE_AUTHOR ("Ben Dooks, <[email protected]>" );MODULE_DESCRIPTION ("s3c24xx I2S SoC Interface" );
sound/soc/sh/hac.c +12 -0
@@ -314,6 +314,18 @@ struct snd_soc_dai sh4_hac_dai[] = { };EXPORT_SYMBOL_GPL (sh4_hac_dai); +static int __devinit sh4_hac_init (void ) +{ +return snd_soc_register_dais (sh4_hac_dai,ARRAY_SIZE (sh4_hac_dai)); +} +module_init (sh4_hac_init); + +static void __exit sh4_hac_exit(void) +{ +snd_soc_unregister_dais (sh4_hac_dai,ARRAY_SIZE (sh4_hac_dai)); +} +module_exit (sh4_hac_exit); +MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SuperH onchip HAC (AC97) audio driver" );MODULE_AUTHOR ("Manuel Lauss <[email protected]>" );
sound/soc/sh/ssi.c +12 -0
@@ -392,6 +392,18 @@ struct snd_soc_dai sh4_ssi_dai[] = { };EXPORT_SYMBOL_GPL (sh4_ssi_dai); +static int __devinit sh4_ssi_init (void ) +{ +return snd_soc_register_dais (sh4_ssi_dai,ARRAY_SIZE (sh4_ssi_dai)); +} +module_init (sh4_ssi_init); + +static void __exit sh4_ssi_exit(void) +{ +snd_soc_unregister_dais (sh4_ssi_dai,ARRAY_SIZE (sh4_ssi_dai)); +} +module_exit (sh4_ssi_exit); +MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SuperH onchip SSI (I2S) audio driver" );MODULE_AUTHOR ("Manuel Lauss <[email protected]>" );
Signature · 1 line
1.5.6.5
PATCH 13/18 ASoC: Add platform registration API
ASoC v2 allows platform drivers to instantiate independantly of the overall ASoC card. This API allows drivers to notify the core when they are registered.
--- include/sound/soc.h | 5 +++++ sound/soc/soc-core.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 0 deletions(-)
include/sound/soc.h +5 -0
@@ -149,6 +149,7 @@ struct snd_soc_ops;struct snd_soc_dai_mode ;struct snd_soc_pcm_runtime ;struct snd_soc_dai ; +struct snd_soc_platform ;struct snd_soc_codec ;struct soc_enum ;struct snd_soc_ac97_ops ;
@@ -158,6 +159,9 @@ typedef int (*hw_read_t)(void *,char* ,int);extern struct snd_ac97_bus_ops soc_ac97_ops; +int snd_soc_register_platform (struct snd_soc_platform *platform); +void snd_soc_unregister_platform (struct snd_soc_platform *platform); +/* pcm <-> DAI connect */ void snd_soc_free_pcms (struct snd_soc_device *socdev);int snd_soc_new_pcms (struct snd_soc_device *socdev,int idx,const char *xid);
@@ -296,6 +300,7 @@ struct snd_soc_codec_device {/* SoC platform interface */ struct snd_soc_platform {char *name; +struct list_head list;int (*probe)(struct platform_device *pdev);int (*remove)(struct platform_device *pdev);
sound/soc/soc-core.c +38 -0
@@ -46,6 +46,7 @@ static struct dentry *debugfs_root;static DEFINE_MUTEX (client_mutex);static LIST_HEAD (card_list);static LIST_HEAD (dai_list); +static LIST_HEAD (platform_list);static int snd_soc_register_card (struct snd_soc_card *card);static int snd_soc_unregister_card (struct snd_soc_card *card);
@@ -2102,6 +2103,43 @@ void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count) }EXPORT_SYMBOL_GPL (snd_soc_unregister_dais); +/** +* snd_soc_register_platform - Register a platform with the ASoC core +* +* @param platform platform to register +*/ +int snd_soc_register_platform (struct snd_soc_platform *platform) +{ +if (!platform->name) +return -EINVAL ; + +INIT_LIST_HEAD (&platform->list); + +mutex_lock (&client_mutex); +list_add (&platform->list, &platform_list); +mutex_unlock (&client_mutex); + +pr_debug ("Registered platform '%s'\n" , platform->name); + +return 0 ; +} +EXPORT_SYMBOL_GPL (snd_soc_register_platform); + +/** +* snd_soc_unregister_platform - Unregister a platform from the ASoC core +* +* @param platform platform to unregister +*/ +void snd_soc_unregister_platform (struct snd_soc_platform *platform) +{ +mutex_lock (&client_mutex); +list_del (&platform->list); +mutex_unlock (&client_mutex); + +pr_debug ("Unregistered platform '%s'\n" , platform->name); +} +EXPORT_SYMBOL_GPL (snd_soc_unregister_platform); +static int __devinit snd_soc_init (void ) {#ifdef CONFIG_DEBUG_FS
Signature · 1 line
1.5.6.5
PATCH 14/18 ASoC: Register platform drivers
This is done at modprobe time, mirroring current behaviour, except for mpc5200_psc_i2s where we do registration at the same time as we register with soc-of-simple. Since the core currently ignores registration this has no practical impact.
--- sound/soc/atmel/atmel-pcm.c | 12 ++++++++++++ sound/soc/au1x/dbdma2.c | 3 ++- sound/soc/blackfin/bf5xx-ac97-pcm.c | 12 ++++++++++++ sound/soc/blackfin/bf5xx-i2s-pcm.c | 12 ++++++++++++ sound/soc/davinci/davinci-pcm.c | 12 ++++++++++++ sound/soc/fsl/fsl_dma.c | 12 ++++++++++++ sound/soc/fsl/mpc5200_psc_i2s.c | 4 ++++ sound/soc/omap/omap-pcm.c | 12 ++++++++++++ sound/soc/pxa/pxa2xx-pcm.c | 12 ++++++++++++ sound/soc/s3c24xx/s3c24xx-pcm.c | 12 ++++++++++++ sound/soc/sh/dma-sh7760.c | 12 ++++++++++++ 11 files changed, 114 insertions(+), 1 deletions(-)
sound/soc/atmel/atmel-pcm.c +12 -0
@@ -477,6 +477,18 @@ struct snd_soc_platform atmel_soc_platform = { };EXPORT_SYMBOL_GPL (atmel_soc_platform); +static int __devinit atmel_pcm_modinit (void ) +{ +return snd_soc_register_platform (&atmel_soc_platform); +} +module_init (atmel_pcm_modinit); + +static void __exit atmel_pcm_exit(void) +{ +snd_soc_unregister_platform (&atmel_soc_platform); +} +module_exit (atmel_pcm_modexit); +MODULE_AUTHOR ("Sedji Gaouaou <[email protected]>" );MODULE_DESCRIPTION ("Atmel PCM module" );MODULE_LICENSE ("GPL" );
sound/soc/au1x/dbdma2.c +2 -1
@@ -406,11 +406,12 @@ static int __init au1xpsc_audio_dbdma_init(void) { au1xpsc_audio_pcmdma[PCM_TX ] =NULL ; au1xpsc_audio_pcmdma[PCM_RX ] =NULL ; -return 0 ; +return snd_soc_register_platform (&au1xpsc_soc_platform); } static void __exit au1xpsc_audio_dbdma_exit(void) { +snd_soc_unregister_platform (&au1xpsc_soc_platform); }module_init (au1xpsc_audio_dbdma_init);
sound/soc/blackfin/bf5xx-ac97-pcm.c +12 -0
@@ -451,6 +451,18 @@ struct snd_soc_platform bf5xx_ac97_soc_platform = { };EXPORT_SYMBOL_GPL (bf5xx_ac97_soc_platform); +static int __devinit bfin_ac97_init (void ) +{ +return snd_soc_register_platform (&bf5xx_ac97_soc_platform); +} +module_init (bfin_ac97_init); + +static void __exit bfin_ac97_exit(void) +{ +snd_soc_unregister_platform (&bf5xx_ac97_soc_platform); +} +module_exit (bfin_ac97_exit); +MODULE_AUTHOR ("Cliff Cai" );MODULE_DESCRIPTION ("ADI Blackfin AC97 PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/blackfin/bf5xx-i2s-pcm.c +12 -0
@@ -283,6 +283,18 @@ struct snd_soc_platform bf5xx_i2s_soc_platform = { };EXPORT_SYMBOL_GPL (bf5xx_i2s_soc_platform); +static int __devinit bfin_i2s_init (void ) +{ +return snd_soc_register_platform (&bf5xx_i2s_soc_platform); +} +module_init (bfin_i2s_init); + +static void __exit bfin_i2s_exit(void) +{ +snd_soc_unregister_platform (&bf5xx_i2s_soc_platform); +} +module_exit (bfin_i2s_exit); +MODULE_AUTHOR ("Cliff Cai" );MODULE_DESCRIPTION ("ADI Blackfin I2S PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/davinci/davinci-pcm.c +12 -0
@@ -384,6 +384,18 @@ struct snd_soc_platform davinci_soc_platform = { };EXPORT_SYMBOL_GPL (davinci_soc_platform); +static int __devinit davinci_soc_platform_init (void ) +{ +return snd_soc_register_platform (&davinci_soc_platform); +} +module_init (davinci_soc_platform_init); + +static void __exit davinci_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&davinci_soc_platform); +} +module_exit (davinci_soc_platform_exit); +MODULE_AUTHOR ("Vladimir Barinov" );MODULE_DESCRIPTION ("TI DAVINCI PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/fsl/fsl_dma.c +12 -0
@@ -853,6 +853,18 @@ int fsl_dma_configure(struct fsl_dma_info *dma_info) }EXPORT_SYMBOL_GPL (fsl_dma_configure); +static int __devinit fsl_soc_platform_init (void ) +{ +return snd_soc_register_platform (&fsl_soc_platform); +} +module_init (fsl_soc_platform_init); + +static void __exit fsl_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&fsl_soc_platform); +} +module_exit (fsl_soc_platform_exit); +MODULE_AUTHOR ("Timur Tabi <[email protected]>" );MODULE_DESCRIPTION ("Freescale Elo DMA ASoC PCM module" );MODULE_LICENSE ("GPL" );
sound/soc/fsl/mpc5200_psc_i2s.c +4 -0
@@ -828,6 +828,8 @@ static int __devinit psc_i2s_of_probe(struct of_device *op,if (rc)dev_info (psc_i2s->dev,"error creating sysfs files\n" ); +snd_soc_register_platform (&psc_i2s_pcm_soc_platform); +/* Tell the ASoC OF helpers about it */ of_snd_soc_register_platform (&psc_i2s_pcm_soc_platform, op->node, &psc_i2s->dai);
@@ -841,6 +843,8 @@ static int __devexit psc_i2s_of_remove(struct of_device *op)dev_dbg (&op->dev,"psc_i2s_remove()\n" ); +snd_soc_unregister_platform (&psc_i2s_pcm_soc_platform); +bcom_gen_bd_rx_release (psc_i2s->capture.bcom_task);bcom_gen_bd_tx_release (psc_i2s->playback.bcom_task);
sound/soc/omap/omap-pcm.c +12 -0
@@ -354,6 +354,18 @@ struct snd_soc_platform omap_soc_platform = { };EXPORT_SYMBOL_GPL (omap_soc_platform); +static int __devinit omap_soc_platform_init (void ) +{ +return snd_soc_register_platform (&omap_soc_platform); +} +module_init (omap_soc_platform_init); + +static void __exit omap_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&omap_soc_platform); +} +module_exit (omap_soc_platform_exit); +MODULE_AUTHOR ("Jarkko Nikula <[email protected]>" );MODULE_DESCRIPTION ("OMAP PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/pxa/pxa2xx-pcm.c +12 -0
@@ -118,6 +118,18 @@ struct snd_soc_platform pxa2xx_soc_platform = { };EXPORT_SYMBOL_GPL (pxa2xx_soc_platform); +static int __devinit pxa2xx_soc_platform_init (void ) +{ +return snd_soc_register_platform (&pxa2xx_soc_platform); +} +module_init (pxa2xx_soc_platform_init); + +static void __exit pxa2xx_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&pxa2xx_soc_platform); +} +module_exit (pxa2xx_soc_platform_exit); +MODULE_AUTHOR ("Nicolas Pitre" );MODULE_DESCRIPTION ("Intel PXA2xx PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/s3c24xx/s3c24xx-pcm.c +12 -0
@@ -465,6 +465,18 @@ struct snd_soc_platform s3c24xx_soc_platform = { };EXPORT_SYMBOL_GPL (s3c24xx_soc_platform); +static int __devinit s3c24xx_soc_platform_init (void ) +{ +return snd_soc_register_platform (&s3c24xx_soc_platform); +} +module_init (s3c24xx_soc_platform_init); + +static void __exit s3c24xx_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&s3c24xx_soc_platform); +} +module_exit (s3c24xx_soc_platform_exit); +MODULE_AUTHOR ("Ben Dooks, <[email protected]>" );MODULE_DESCRIPTION ("Samsung S3C24XX PCM DMA module" );MODULE_LICENSE ("GPL" );
sound/soc/sh/dma-sh7760.c +12 -0
@@ -348,6 +348,18 @@ struct snd_soc_platform sh7760_soc_platform = { };EXPORT_SYMBOL_GPL (sh7760_soc_platform); +static int __devinit sh7760_soc_platform_init (void ) +{ +return snd_soc_register_platform (&sh7760_soc_platform); +} +module_init (sh7760_soc_platform_init); + +static void __exit sh7760_soc_platform_exit(void) +{ +snd_soc_unregister_platform (&sh7760_soc_platform); +} +module_exit (sh7760_soc_platform_exit); +MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SH7760 Audio DMA (DMABRG) driver" );MODULE_AUTHOR ("Manuel Lauss <[email protected]>" );
Signature · 1 line
1.5.6.5
PATCH 15/18 ASoC: Register non-AC97 codec DAIs
Currently this is done at module probe time since ASoC ties in codec device probe to the instantiation of the entire ASoC device. Subsequent patches will refactor the codec drivers to handle probing separately. Note that the core does not yet use this information.
AC97 is special since the codec is controlled over the AC97 link but we want to give the machine driver a chance to set up the system before trying to instantiate since it may need to do configuration before the AC97 link will operate
--- sound/soc/codecs/ad73311.c | 12 ++++++++++++ sound/soc/codecs/ak4535.c | 12 ++++++++++++ sound/soc/codecs/cs4270.c | 12 ++++++++++++ sound/soc/codecs/pcm3008.c | 12 ++++++++++++ sound/soc/codecs/ssm2602.c | 12 ++++++++++++ sound/soc/codecs/tlv320aic23.c | 12 ++++++++++++ sound/soc/codecs/tlv320aic26.c | 15 ++++++++++++--- sound/soc/codecs/tlv320aic3x.c | 12 ++++++++++++ sound/soc/codecs/twl4030.c | 14 +++++++++++++- sound/soc/codecs/uda134x.c | 12 ++++++++++++ sound/soc/codecs/uda1380.c | 12 ++++++++++++ sound/soc/codecs/wm8510.c | 12 ++++++++++++ sound/soc/codecs/wm8580.c | 12 ++++++++++++ sound/soc/codecs/wm8728.c | 12 ++++++++++++ sound/soc/codecs/wm8731.c | 12 ++++++++++++ sound/soc/codecs/wm8750.c | 12 ++++++++++++ sound/soc/codecs/wm8753.c | 12 ++++++++++++ sound/soc/codecs/wm8900.c | 12 ++++++++++++ sound/soc/codecs/wm8903.c | 12 ++++++++++++ sound/soc/codecs/wm8971.c | 12 ++++++++++++ sound/soc/codecs/wm8990.c | 12 ++++++++++++ 21 files changed, 253 insertions(+), 4 deletions(-)
sound/soc/codecs/ad73311.c +12 -0
@@ -98,6 +98,18 @@ struct snd_soc_codec_device soc_codec_dev_ad73311 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_ad73311); +static int __devinit ad73311_init (void ) +{ +return snd_soc_register_dai (&ad73311_dai); +} +module_init (ad73311_init); + +static void __exit ad73311_exit(void) +{ +snd_soc_unregister_dai (&ad73311_dai); +} +module_exit (ad73311_exit); +MODULE_DESCRIPTION ("ASoC ad73311 driver" );MODULE_AUTHOR ("Cliff Cai " );MODULE_LICENSE ("GPL" );
sound/soc/codecs/ak4535.c +12 -0
@@ -688,6 +688,18 @@ struct snd_soc_codec_device soc_codec_dev_ak4535 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_ak4535); +static int __devinit ak4535_modinit (void ) +{ +return snd_soc_register_dai (&ak4535_dai); +} +module_init (ak4535_modinit); + +static void __exit ak4535_exit(void) +{ +snd_soc_unregister_dai (&ak4535_dai); +} +module_exit (ak4535_exit); +MODULE_DESCRIPTION ("Soc AK4535 driver" );MODULE_AUTHOR ("Richard Purdie" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/cs4270.c +12 -0
@@ -774,6 +774,18 @@ struct snd_soc_codec_device soc_codec_device_cs4270 = { };EXPORT_SYMBOL_GPL (soc_codec_device_cs4270); +static int __devinit cs4270_init (void ) +{ +return snd_soc_register_dai (&cs4270_dai); +} +module_init (cs4270_init); + +static void __exit cs4270_exit(void) +{ +snd_soc_unregister_dai (&cs4270_dai); +} +module_exit (cs4270_exit); +MODULE_AUTHOR ("Timur Tabi <[email protected]>" );MODULE_DESCRIPTION ("Cirrus Logic CS4270 ALSA SoC Codec Driver" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/pcm3008.c +12 -0
@@ -195,6 +195,18 @@ struct snd_soc_codec_device soc_codec_dev_pcm3008 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_pcm3008); +static int __devinit pcm3008_init (void ) +{ +return snd_soc_register_dai (&pcm3008_dai); +} +module_init (pcm3008_init); + +static void __exit pcm3008_exit(void) +{ +snd_soc_unregister_dai (&pcm3008_dai); +} +module_exit (pcm3008_exit); +MODULE_DESCRIPTION ("Soc PCM3008 driver" );MODULE_AUTHOR ("Hugo Villeneuve" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/ssm2602.c +12 -0
@@ -793,6 +793,18 @@ struct snd_soc_codec_device soc_codec_dev_ssm2602 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_ssm2602); +static int __devinit ssm2602_modinit (void ) +{ +return snd_soc_register_dai (&ssm2602_dai); +} +module_init (ssm2602_modinit); + +static void __exit ssm2602_exit(void) +{ +snd_soc_unregister_dai (&ssm2602_dai); +} +module_exit (ssm2602_exit); +MODULE_DESCRIPTION ("ASoC ssm2602 driver" );MODULE_AUTHOR ("Cliff Cai" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/tlv320aic23.c +12 -0
@@ -847,6 +847,18 @@ struct snd_soc_codec_device soc_codec_dev_tlv320aic23 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_tlv320aic23); +static int __devinit tlv320aic23_modinit (void ) +{ +return snd_soc_register_dai (&tlv320aic23_dai); +} +module_init (tlv320aic23_modinit); + +static void __exit tlv320aic23_exit(void) +{ +snd_soc_unregister_dai (&tlv320aic23_dai); +} +module_exit (tlv320aic23_exit); +MODULE_DESCRIPTION ("ASoC TLV320AIC23 codec driver" );MODULE_AUTHOR ("Arun KS <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/tlv320aic26.c +12 -3
@@ -426,7 +426,7 @@ static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set);static int aic26_spi_probe (struct spi_device *spi) {struct aic26 *aic26; -int rc, i, reg; +int ret, i, reg;dev_dbg (&spi->dev,"probing tlv320aic26 spi device\n" );
@@ -456,6 +456,14 @@ static int aic26_spi_probe(struct spi_device *spi) aic26->codec.reg_cache_size =AIC26_NUM_REGS ; aic26->codec.reg_cache = aic26->reg_cache; + aic26_dai.dev = &spi->dev; + ret =snd_soc_register_dai (&aic26_dai); +if (ret !=0 ) { +dev_err (&spi->dev,"Failed to register DAI: %d\n" , ret); +kfree (aic26); +return ret; + } +/* Reset the codec to power on defaults */ aic26_reg_write (&aic26->codec,AIC26_REG_RESET ,0xBB00 );
@@ -474,8 +482,8 @@ static int aic26_spi_probe(struct spi_device *spi)/* Register the sysfs files for debugging */ /* Create SysFS files */ - rc =device_create_file (&spi->dev, &dev_attr_keyclick); -if (rc) + ret =device_create_file (&spi->dev, &dev_attr_keyclick); +if (ret)dev_info (&spi->dev,"error creating sysfs files\n" );#if defined(CONFIG_SND_SOC_OF_SIMPLE )
@@ -492,6 +500,7 @@ static int aic26_spi_remove(struct spi_device *spi) {struct aic26 *aic26 =dev_get_drvdata (&spi->dev); +snd_soc_unregister_dai (&aic26_dai);kfree (aic26);return 0 ;
sound/soc/codecs/tlv320aic3x.c +12 -0
@@ -1411,6 +1411,18 @@ struct snd_soc_codec_device soc_codec_dev_aic3x = { };EXPORT_SYMBOL_GPL (soc_codec_dev_aic3x); +static int __devinit aic3x_modinit (void ) +{ +return snd_soc_register_dai (&aic3x_dai); +} +module_init (aic3x_modinit); + +static void __exit aic3x_exit(void) +{ +snd_soc_unregister_dai (&aic3x_dai); +} +module_exit (aic3x_exit); +MODULE_DESCRIPTION ("ASoC TLV320AIC3X codec driver" );MODULE_AUTHOR ("Vladimir Barinov" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/twl4030.c +13 -1
@@ -358,7 +358,7 @@ static int outmixer_event(struct snd_soc_dapm_widget *w, .put = snd_soc_put_volsw_r2_twl4030, \ .private_value = (unsigned long)&(struct soc_mixer_control) \ {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ - .max = xmax, .invert = xinvert} } + .rshift = xshift, .max = xmax, .invert = xinvert} }#define SOC_SINGLE_TLV_TWL4030 (xname, xreg, xshift, xmax, xinvert, tlv_array) \ SOC_DOUBLE_TLV_TWL4030(xname, xreg, xshift, xshift, xmax, \ xinvert, tlv_array)
@@ -1275,6 +1275,18 @@ struct snd_soc_codec_device soc_codec_dev_twl4030 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_twl4030); +static int __devinit twl4030_init (void ) +{ +return snd_soc_register_dai (&twl4030_dai); +} +module_init (twl4030_init); + +static void __exit twl4030_exit(void) +{ +snd_soc_unregister_dai (&twl4030_dai); +} +module_exit (twl4030_exit); +MODULE_DESCRIPTION ("ASoC TWL4030 codec driver" );MODULE_AUTHOR ("Steve Sakoman" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/uda134x.c +12 -0
@@ -651,6 +651,18 @@ struct snd_soc_codec_device soc_codec_dev_uda134x = { };EXPORT_SYMBOL_GPL (soc_codec_dev_uda134x); +static int __devinit uda134x_init (void ) +{ +return snd_soc_register_dai (&uda134x_dai); +} +module_init (uda134x_init); + +static void __exit uda134x_exit(void) +{ +snd_soc_unregister_dai (&uda134x_dai); +} +module_exit (uda134x_exit); +MODULE_DESCRIPTION ("UDA134X ALSA soc codec driver" );MODULE_AUTHOR ("Zoltan Devai, Christian Pellegrin <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/uda1380.c +12 -0
@@ -841,6 +841,18 @@ struct snd_soc_codec_device soc_codec_dev_uda1380 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_uda1380); +static int __devinit uda1380_modinit (void ) +{ +return snd_soc_register_dais (uda1380_dai,ARRAY_SIZE (uda1380_dai)); +} +module_init (uda1380_modinit); + +static void __exit uda1380_exit(void) +{ +snd_soc_unregister_dais (uda1380_dai,ARRAY_SIZE (uda1380_dai)); +} +module_exit (uda1380_exit); +MODULE_AUTHOR ("Giorgio Padrin" );MODULE_DESCRIPTION ("Audio support for codec Philips UDA1380" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8510.c +12 -0
@@ -889,6 +889,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8510 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8510); +static int __devinit wm8510_modinit (void ) +{ +return snd_soc_register_dai (&wm8510_dai); +} +module_init (wm8510_modinit); + +static void __exit wm8510_exit(void) +{ +snd_soc_unregister_dai (&wm8510_dai); +} +module_exit (wm8510_exit); +MODULE_DESCRIPTION ("ASoC WM8510 driver" );MODULE_AUTHOR ("Liam Girdwood" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8580.c +12 -0
@@ -1042,6 +1042,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8580 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8580); +static int __devinit wm8580_modinit (void ) +{ +return snd_soc_register_dais (wm8580_dai,ARRAY_SIZE (wm8580_dai)); +} +module_init (wm8580_modinit); + +static void __exit wm8580_exit(void) +{ +snd_soc_unregister_dais (wm8580_dai,ARRAY_SIZE (wm8580_dai)); +} +module_exit (wm8580_exit); +MODULE_DESCRIPTION ("ASoC WM8580 driver" );MODULE_AUTHOR ("Mark Brown <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8728.c +12 -0
@@ -568,6 +568,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8728 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8728); +static int __devinit wm8728_modinit (void ) +{ +return snd_soc_register_dai (&wm8728_dai); +} +module_init (wm8728_modinit); + +static void __exit wm8728_exit(void) +{ +snd_soc_unregister_dai (&wm8728_dai); +} +module_exit (wm8728_exit); +MODULE_DESCRIPTION ("ASoC WM8728 driver" );MODULE_AUTHOR ("Mark Brown <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8731.c +12 -0
@@ -793,6 +793,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8731 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8731); +static int __devinit wm8731_modinit (void ) +{ +return snd_soc_register_dai (&wm8731_dai); +} +module_init (wm8731_modinit); + +static void __exit wm8731_exit(void) +{ +snd_soc_unregister_dai (&wm8731_dai); +} +module_exit (wm8731_exit); +MODULE_DESCRIPTION ("ASoC WM8731 driver" );MODULE_AUTHOR ("Richard Purdie" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8750.c +12 -0
@@ -1085,6 +1085,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8750 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8750); +static int __devinit wm8750_modinit (void ) +{ +return snd_soc_register_dai (&wm8750_dai); +} +module_init (wm8750_modinit); + +static void __exit wm8750_exit(void) +{ +snd_soc_unregister_dai (&wm8750_dai); +} +module_exit (wm8750_exit); +MODULE_DESCRIPTION ("ASoC WM8750 driver" );MODULE_AUTHOR ("Liam Girdwood" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8753.c +12 -0
@@ -1874,6 +1874,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8753); +static int __devinit wm8753_modinit (void ) +{ +return snd_soc_register_dais (wm8753_dai,ARRAY_SIZE (wm8753_dai)); +} +module_init (wm8753_modinit); + +static void __exit wm8753_exit(void) +{ +snd_soc_unregister_dais (wm8753_dai,ARRAY_SIZE (wm8753_dai)); +} +module_exit (wm8753_exit); +MODULE_DESCRIPTION ("ASoC WM8753 driver" );MODULE_AUTHOR ("Liam Girdwood" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8900.c +12 -0
@@ -1530,6 +1530,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8900 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8900); +static int __devinit wm8900_modinit (void ) +{ +return snd_soc_register_dai (&wm8900_dai); +} +module_init (wm8900_modinit); + +static void __exit wm8900_exit(void) +{ +snd_soc_unregister_dai (&wm8900_dai); +} +module_exit (wm8900_exit); +MODULE_DESCRIPTION ("ASoC WM8900 driver" );MODULE_AUTHOR ("Mark Brown <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8903.c +12 -0
@@ -1809,6 +1809,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8903 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8903); +static int __devinit wm8903_modinit (void ) +{ +return snd_soc_register_dai (&wm8903_dai); +} +module_init (wm8903_modinit); + +static void __exit wm8903_exit(void) +{ +snd_soc_unregister_dai (&wm8903_dai); +} +module_exit (wm8903_exit); +MODULE_DESCRIPTION ("ASoC WM8903 driver" );MODULE_AUTHOR ("Mark Brown <[email protected]>" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8971.c +12 -0
@@ -935,6 +935,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8971 = {EXPORT_SYMBOL_GPL (soc_codec_dev_wm8971); +static int __devinit wm8971_modinit (void ) +{ +return snd_soc_register_dai (&wm8971_dai); +} +module_init (wm8971_modinit); + +static void __exit wm8971_exit(void) +{ +snd_soc_unregister_dai (&wm8971_dai); +} +module_exit (wm8971_exit); +MODULE_DESCRIPTION ("ASoC WM8971 driver" );MODULE_AUTHOR ("Lab126" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/wm8990.c +12 -0
@@ -1643,6 +1643,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8990 = { };EXPORT_SYMBOL_GPL (soc_codec_dev_wm8990); +static int __devinit wm8990_modinit (void ) +{ +return snd_soc_register_dai (&wm8990_dai); +} +module_init (wm8990_modinit); + +static void __exit wm8990_exit(void) +{ +snd_soc_unregister_dai (&wm8990_dai); +} +module_exit (wm8990_exit); +MODULE_DESCRIPTION ("ASoC WM8990 driver" );MODULE_AUTHOR ("Liam Girdwood" );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.5.6.5
PATCH 16/18 ASoC: Initial framework for dynamic card instantiation
Use the lists of platforms, platform DAIs and cards to check to see that everything has registered. Since relationships are still specified by direct references to the structures in the drivers and the drivers all register everything at modprobe there should be no practical effect yet.
--- sound/soc/soc-core.c | 97 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 78 insertions(+), 19 deletions(-)
sound/soc/soc-core.c +79 -20
@@ -780,30 +780,54 @@ static int soc_resume(struct platform_device *pdev)#define soc_resume NULL#endif -/* probes a new socdev */ -static int soc_probe (struct platform_device *pdev) -{ -int ret =0 , i; -struct snd_soc_device *socdev =platform_get_drvdata (pdev); -struct snd_soc_card *card = socdev->card; -struct snd_soc_platform *platform = card->platform; -struct snd_soc_codec_device *codec_dev = socdev->codec_dev; - -/* Bodge while we push things out of socdev */ - card->socdev = socdev; +static void snd_soc_instantiate_card (struct snd_soc_card *card) +{ +struct platform_device *pdev =container_of (card->dev, + struct platform_device, + dev); +struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev; +struct snd_soc_platform *platform; +struct snd_soc_dai *dai; +int i, found, ret; + +if (card->instantiated) +return ; + + found =0 ; +list_for_each_entry (platform, &platform_list, list) +if (card->platform == platform) { + found =1 ; +break ; + } +if (!found) { +dev_dbg (card->dev,"Platform %s not registered\n" , + card->platform->name); +return ; + } -/* Bodge while we unpick instantiation */ - card->dev = &pdev->dev; - ret =snd_soc_register_card (card); -if (ret !=0 ) { -dev_err (&pdev->dev,"Failed to register card\n" ); -return ret; +for (i =0 ; i < card->num_links; i++) { + found =0 ; +list_for_each_entry (dai, &dai_list, list) +if (card->dai_link[i].cpu_dai == dai) { + found =1 ; +break ; + } +if (!found) { +dev_dbg (card->dev,"DAI %s not registered\n" , + card->dai_link[i].cpu_dai->name); +return ; + } } +/* Note that we do not current check for codec components */ + +dev_dbg (card->dev,"All components present, instantiating\n" ); + +/* Found everything, bring it up */ if (card->probe) { ret = card->probe (pdev);if (ret <0 ) -return ret; +return ; }for (i =0 ; i < card->num_links; i++) {
@@ -834,7 +858,9 @@ static int soc_probe(struct platform_device *pdev)INIT_WORK (&card->deferred_resume_work, soc_resume_deferred);#endif -return 0 ; + card->instantiated =1 ; + +return ; platform_err:if (codec_dev->remove)
@@ -849,8 +875,38 @@ cpu_dai_err:if (card->remove) card->remove (pdev); +} -return ret; +/* +* Attempt to initialise any uninitalised cards. Must be called with +* client_mutex. +*/ +static void snd_soc_instantiate_cards (void ) +{ +struct snd_soc_card *card; +list_for_each_entry (card, &card_list, list) +snd_soc_instantiate_card (card); +} + +/* probes a new socdev */ +static int soc_probe (struct platform_device *pdev) +{ +int ret =0 ; +struct snd_soc_device *socdev =platform_get_drvdata (pdev); +struct snd_soc_card *card = socdev->card; + +/* Bodge while we push things out of socdev */ + card->socdev = socdev; + +/* Bodge while we unpick instantiation */ + card->dev = &pdev->dev; + ret =snd_soc_register_card (card); +if (ret !=0 ) { +dev_err (&pdev->dev,"Failed to register card\n" ); +return ret; + } + +return 0 ; }/* removes a socdev */
@@ -1994,6 +2050,7 @@ static int snd_soc_register_card(struct snd_soc_card *card)mutex_lock (&client_mutex);list_add (&card->list, &card_list); +snd_soc_instantiate_cards ();mutex_unlock (&client_mutex);dev_dbg (card->dev,"Registered card '%s'\n" , card->name);
@@ -2039,6 +2096,7 @@ int snd_soc_register_dai(struct snd_soc_dai *dai)mutex_lock (&client_mutex);list_add (&dai->list, &dai_list); +snd_soc_instantiate_cards ();mutex_unlock (&client_mutex);pr_debug ("Registered DAI '%s'\n" , dai->name);
@@ -2117,6 +2175,7 @@ int snd_soc_register_platform(struct snd_soc_platform *platform)mutex_lock (&client_mutex);list_add (&platform->list, &platform_list); +snd_soc_instantiate_cards ();mutex_unlock (&client_mutex);pr_debug ("Registered platform '%s'\n" , platform->name);
Signature · 1 line
1.5.6.5
PATCH 17/18 ASoC: Wait for non-AC97 codec DAIs before instantiating
This will allow codec drivers to be refactored to allow them to be registered out of line with the ASoC device registration.
--- sound/soc/soc-core.c | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-)
sound/soc/soc-core.c +26 -1
@@ -788,7 +788,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev;struct snd_soc_platform *platform;struct snd_soc_dai *dai; -int i, found, ret; +int i, found, ret, ac97;if (card->instantiated)return ;
@@ -805,6 +805,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)return ; } + ac97 =0 ;for (i =0 ; i < card->num_links; i++) { found =0 ;list_for_each_entry (dai, &dai_list, list)
@@ -817,8 +818,32 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) card->dai_link[i].cpu_dai->name);return ; } + +if (card->dai_link[i].cpu_dai->ac97_control) + ac97 =1 ; } +/* If we have AC97 in the system then don't wait for the +* codec. This will need revisiting if we have to handle +* systems with mixed AC97 and non-AC97 parts. Only check for +* DAIs currently; we can't do this per link since some AC97 +* codecs have non-AC97 DAIs. +*/ +if (!ac97) +for (i =0 ; i < card->num_links; i++) { + found =0 ; +list_for_each_entry (dai, &dai_list, list) +if (card->dai_link[i].codec_dai == dai) { + found =1 ; +break ; + } +if (!found) { +dev_dbg (card->dev,"DAI %s not registered\n" , + card->dai_link[i].codec_dai->name); +return ; + } + } +/* Note that we do not current check for codec components */ dev_dbg (card->dev,"All components present, instantiating\n" );
Signature · 1 line
1.5.6.5
PATCH 6/18 ASoC: TWL4030: DAPM mapping of the Headset outputs
In reply to Mark BrownFrom: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Headset outputs.
--- sound/soc/codecs/twl4030.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +39 -0
@@ -229,6 +229,30 @@ static const struct soc_enum twl4030_predriver_enum =static const struct snd_kcontrol_new twl4030_dapm_predriver_control =SOC_DAPM_ENUM ("Route" , twl4030_predriver_enum); +/* Headset Left */ +static const char *twl4030_hsol_texts[] = + {"Off" ,"DACL1" ,"DACL2" }; + +static const struct soc_enum twl4030_hsol_enum = +SOC_ENUM_SINGLE (TWL4030_REG_HS_SEL ,1 , +ARRAY_SIZE (twl4030_hsol_texts), + twl4030_hsol_texts); + +static const struct snd_kcontrol_new twl4030_dapm_hsol_control = +SOC_DAPM_ENUM ("Route" , twl4030_hsol_enum); + +/* Headset Right */ +static const char *twl4030_hsor_texts[] = + {"Off" ,"DACR1" ,"DACR2" }; + +static const struct soc_enum twl4030_hsor_enum = +SOC_ENUM_SINGLE (TWL4030_REG_HS_SEL ,4 , +ARRAY_SIZE (twl4030_hsor_texts), + twl4030_hsor_texts); + +static const struct snd_kcontrol_new twl4030_dapm_hsor_control = +SOC_DAPM_ENUM ("Route" , twl4030_hsor_enum); +static int outmixer_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -687,6 +711,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_OUTPUT ("EARPIECE" ),SND_SOC_DAPM_OUTPUT ("PREDRIVEL" ),SND_SOC_DAPM_OUTPUT ("PREDRIVER" ), +SND_SOC_DAPM_OUTPUT ("HSOL" ), +SND_SOC_DAPM_OUTPUT ("HSOR" ),/* DACs */ SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -720,6 +746,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_MUX_E ("PredriveR Mux" ,SND_SOC_NOPM ,0 ,0 , &twl4030_dapm_predriver_control, outmixer_event,SND_SOC_DAPM_PRE_REG ), +/* HeadsetL/R */ +SND_SOC_DAPM_MUX ("HeadsetL Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_hsol_control), +SND_SOC_DAPM_MUX ("HeadsetR Mux" ,SND_SOC_NOPM ,0 ,0 , + &twl4030_dapm_hsor_control),SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -744,6 +775,12 @@ static const struct snd_soc_dapm_route intercon[] = { {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, {"PredriveR Mux", "DACL2", "ARXL2_APGA"}, +/* HeadsetL */ + {"HeadsetL Mux", "DACL1", "ARXL1_APGA"}, + {"HeadsetL Mux", "DACL2", "ARXL2_APGA"}, +/* HeadsetR */ + {"HeadsetR Mux", "DACR1", "ARXR1_APGA"}, + {"HeadsetR Mux", "DACR2", "ARXR2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"},
@@ -751,6 +788,8 @@ static const struct snd_soc_dapm_route intercon[] = { {"EARPIECE", NULL, "Earpiece Mux"}, {"PREDRIVEL", NULL, "PredriveL Mux"}, {"PREDRIVER", NULL, "PredriveR Mux"}, + {"HSOL", NULL, "HeadsetL Mux"}, + {"HSOR", NULL, "HeadsetR Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 8/18 ASoC: TWL4030: DAPM mapping of the Handsfree outputs
In reply to Mark BrownFrom: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Handsfree outputs.
--- sound/soc/codecs/twl4030.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +41 -0
@@ -277,6 +277,30 @@ static const struct soc_enum twl4030_carkitr_enum =static const struct snd_kcontrol_new twl4030_dapm_carkitr_control =SOC_DAPM_ENUM ("Route" , twl4030_carkitr_enum); +/* Handsfree Left */ +static const char *twl4030_handsfreel_texts[] = + {"Voice" ,"DACL1" ,"DACL2" ,"DACR2" }; + +static const struct soc_enum twl4030_handsfreel_enum = +SOC_ENUM_SINGLE (TWL4030_REG_HFL_CTL ,0 , +ARRAY_SIZE (twl4030_handsfreel_texts), + twl4030_handsfreel_texts); + +static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control = +SOC_DAPM_ENUM ("Route" , twl4030_handsfreel_enum); + +/* Handsfree Right */ +static const char *twl4030_handsfreer_texts[] = + {"Voice" ,"DACR1" ,"DACR2" ,"DACL2" }; + +static const struct soc_enum twl4030_handsfreer_enum = +SOC_ENUM_SINGLE (TWL4030_REG_HFR_CTL ,0 , +ARRAY_SIZE (twl4030_handsfreer_texts), + twl4030_handsfreer_texts); + +static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = +SOC_DAPM_ENUM ("Route" , twl4030_handsfreer_enum); +static int outmixer_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {
@@ -737,6 +761,8 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {SND_SOC_DAPM_OUTPUT ("PREDRIVER" ),SND_SOC_DAPM_OUTPUT ("HSOL" ),SND_SOC_DAPM_OUTPUT ("HSOR" ), +SND_SOC_DAPM_OUTPUT ("HFL" ), +SND_SOC_DAPM_OUTPUT ("HFR" ),/* DACs */ SND_SOC_DAPM_DAC("DACR1", "Right Front Playback",
@@ -780,6 +806,11 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { &twl4030_dapm_carkitl_control),SND_SOC_DAPM_MUX ("CarkitR Mux" ,SND_SOC_NOPM ,0 ,0 , &twl4030_dapm_carkitr_control), +/* HandsfreeL/R */ +SND_SOC_DAPM_MUX ("HandsfreeL Mux" ,TWL4030_REG_HFL_CTL ,5 ,0 , + &twl4030_dapm_handsfreel_control), +SND_SOC_DAPM_MUX ("HandsfreeR Mux" ,TWL4030_REG_HFR_CTL ,5 ,0 , + &twl4030_dapm_handsfreer_control),SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
@@ -816,6 +847,14 @@ static const struct snd_soc_dapm_route intercon[] = {/* CarkitR */ {"CarkitR Mux", "DACR1", "ARXR1_APGA"}, {"CarkitR Mux", "DACR2", "ARXR2_APGA"}, +/* HandsfreeL */ + {"HandsfreeL Mux", "DACL1", "ARXL1_APGA"}, + {"HandsfreeL Mux", "DACL2", "ARXL2_APGA"}, + {"HandsfreeL Mux", "DACR2", "ARXR2_APGA"}, +/* HandsfreeR */ + {"HandsfreeR Mux", "DACR1", "ARXR1_APGA"}, + {"HandsfreeR Mux", "DACR2", "ARXR2_APGA"}, + {"HandsfreeR Mux", "DACL2", "ARXL2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"},
@@ -827,6 +866,8 @@ static const struct snd_soc_dapm_route intercon[] = { {"HSOR", NULL, "HeadsetR Mux"}, {"CARKITL", NULL, "CarkitL Mux"}, {"CARKITR", NULL, "CarkitR Mux"}, + {"HFL", NULL, "HandsfreeL Mux"}, + {"HFR", NULL, "HandsfreeR Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Signature · 1 line
1.5.6.5
PATCH 9/18 ASoC: TWL4030: Do not alter the Headset output volume on power-up/down
From: Peter Ujfalusi <[email protected]>
There is a separate gain control for the Headset output already. Do not reset the gain to 0 dB at power up.
In power-down, there is no need to set the Headset output gain to power-down mode, since if the CODECPDZ is in powered off this setting has no effect.
--- sound/soc/codecs/twl4030.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-)
sound/soc/codecs/twl4030.c +2 -10
@@ -887,7 +887,7 @@ static int twl4030_add_widgets(struct snd_soc_codec *codec)static void twl4030_power_up (struct snd_soc_codec *codec) { -u8 anamicl, regmisc1, byte, popn, hsgain; +u8 anamicl, regmisc1, byte, popn;int i =0 ;/* set CODECPDZ to turn on codec */
@@ -925,10 +925,6 @@ static void twl4030_power_up(struct snd_soc_codec *codec) popn |=TWL4030_VMID_EN ;twl4030_write (codec,TWL4030_REG_HS_POPN_SET , popn); -/* enable output stage and gain setting */ - hsgain =TWL4030_HSR_GAIN_0DB |TWL4030_HSL_GAIN_0DB ; -twl4030_write (codec,TWL4030_REG_HS_GAIN_SET , hsgain); -/* enable anti-pop ramp */ popn |=TWL4030_RAMP_EN ;twl4030_write (codec,TWL4030_REG_HS_POPN_SET , popn);
@@ -936,17 +932,13 @@ static void twl4030_power_up(struct snd_soc_codec *codec)static void twl4030_power_down (struct snd_soc_codec *codec) { -u8 popn, hsgain; +u8 popn;/* disable anti-pop ramp */ popn =twl4030_read_reg_cache (codec,TWL4030_REG_HS_POPN_SET ); popn &= ~TWL4030_RAMP_EN ;twl4030_write (codec,TWL4030_REG_HS_POPN_SET , popn); -/* disable output stage and gain setting */ - hsgain =TWL4030_HSR_GAIN_PWR_DOWN |TWL4030_HSL_GAIN_PWR_DOWN ; -twl4030_write (codec,TWL4030_REG_HS_GAIN_SET , hsgain); -/* disable bias out */ popn &= ~TWL4030_VMID_EN ;twl4030_write (codec,TWL4030_REG_HS_POPN_SET , popn);
Signature · 1 line
1.5.6.5
PATCH 11/18 ASoC: Add DAI registration API
In reply to Mark BrownAdd API calls to register and unregister DAIs with the core. Currently these APIs are ineffective. Since multiple DAIs for a given device are a common case bulk variants are provided.
--- include/sound/soc-dai.h | 8 ++++ sound/soc/soc-core.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-)
include/sound/soc-dai.h +8 -0
@@ -100,6 +100,12 @@ struct snd_soc_dai_ops;struct snd_soc_dai ;struct snd_ac97_bus_ops ; +/* Digital Audio Interface registration */ +int snd_soc_register_dai (struct snd_soc_dai *dai); +void snd_soc_unregister_dai (struct snd_soc_dai *dai); +int snd_soc_register_dais (struct snd_soc_dai *dai,size_t count); +void snd_soc_unregister_dais (struct snd_soc_dai *dai,size_t count); +/* Digital Audio Interface clocking API.*/ int snd_soc_dai_set_sysclk (struct snd_soc_dai *dai,int clk_id,unsigned int freq,int dir);
@@ -186,6 +192,8 @@ struct snd_soc_dai {unsigned int id;int ac97_control; +struct device *dev; +/* DAI callbacks */ int (*probe)(struct platform_device *pdev,struct snd_soc_dai *dai);
sound/soc/soc-core.c +83 -0
95 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 18/18 ASoC: Convert WM8900 to allow registration by machine code
In reply to Mark BrownThis makes use of the support for delayed DAI registration to allow the WM8900 I2C device to be registered by general platform/architecture code rather than as part of the ASoC device probe.
--- sound/soc/codecs/wm8900.c | 97 +++++++++----------------------------------- 1 files changed, 20 insertions(+), 77 deletions(-)
sound/soc/codecs/wm8900.c +20 -77
@@ -1382,32 +1382,21 @@ priv_err:return ret; } -static struct snd_soc_device *wm8900_socdev; +static struct i2c_client *wm8900_client; -#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE ) - -/* If the i2c layer weren't so broken, we could pass this kind of data -around */ static int wm8900_i2c_probe (struct i2c_client *i2c,const struct i2c_device_id *id) { -struct snd_soc_device *socdev = wm8900_socdev; -struct snd_soc_codec *codec = socdev->codec; -int ret; - -i2c_set_clientdata (i2c, codec); - codec->control_data = i2c; - - ret =wm8900_init (socdev); -if (ret <0 ) -dev_err (&i2c->dev,"failed to initialise WM8900\n" ); -return ret; + wm8900_client = i2c; + wm8900_dai.dev = &i2c->dev; +return snd_soc_register_dai (&wm8900_dai); }static int wm8900_i2c_remove (struct i2c_client *client) { -struct snd_soc_codec *codec =i2c_get_clientdata (client); -kfree (codec->reg_cache); +snd_soc_unregister_dai (&wm8900_dai); + wm8900_dai.dev =NULL ; + wm8900_client =NULL ;return 0 ; }
@@ -1427,57 +1416,17 @@ static struct i2c_driver wm8900_i2c_driver = { .id_table = wm8900_i2c_id, }; -static int wm8900_add_i2c_device (struct platform_device *pdev, -const struct wm8900_setup_data *setup) -{ -struct i2c_board_info info; -struct i2c_adapter *adapter; -struct i2c_client *client; -int ret; - - ret =i2c_add_driver (&wm8900_i2c_driver); -if (ret !=0 ) { -dev_err (&pdev->dev,"can't add i2c driver\n" ); -return ret; - } - -memset (&info,0 ,sizeof (struct i2c_board_info )); - info.addr = setup->i2c_address; -strlcpy (info.type,"wm8900" ,I2C_NAME_SIZE ); - - adapter =i2c_get_adapter (setup->i2c_bus); -if (!adapter) { -dev_err (&pdev->dev,"can't get i2c adapter %d\n" , - setup->i2c_bus); - goto err_driver; - } - - client =i2c_new_device (adapter, &info); -i2c_put_adapter (adapter); -if (!client) { -dev_err (&pdev->dev,"can't add i2c device at 0x%x\n" , - (unsigned int )info.addr); - goto err_driver; - } - -return 0 ; - -err_driver: -i2c_del_driver (&wm8900_i2c_driver); -return -ENODEV ; -} -#endif -static int wm8900_probe (struct platform_device *pdev) {struct snd_soc_device *socdev =platform_get_drvdata (pdev); -struct wm8900_setup_data *setup;struct snd_soc_codec *codec;int ret =0 ; -dev_info (&pdev->dev,"WM8900 Audio Codec\n" ); +if (!wm8900_client) { +dev_err (&pdev->dev,"I2C client not yet instantiated\n" ); +return -ENODEV ; + } - setup = socdev->codec_data; codec =kzalloc (sizeof (struct snd_soc_codec ),GFP_KERNEL );if (codec ==NULL )return -ENOMEM ;
@@ -1490,15 +1439,13 @@ static int wm8900_probe(struct platform_device *pdev) codec->set_bias_level = wm8900_set_bias_level; - wm8900_socdev = socdev; -#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE ) -if (setup->i2c_address) { - codec->hw_write = (hw_write_t )i2c_master_send; - ret =wm8900_add_i2c_device (pdev, setup); - } -#else -#error Non-I2C interfaces not yet supported -#endif + codec->hw_write = (hw_write_t )i2c_master_send; + codec->control_data = wm8900_client; + + ret =wm8900_init (socdev); +if (ret !=0 ) +kfree (codec); +return ret; }
@@ -1513,10 +1460,6 @@ static int wm8900_remove(struct platform_device *pdev)snd_soc_free_pcms (socdev);snd_soc_dapm_free (socdev); -#if defined(CONFIG_I2C ) || defined(CONFIG_I2C_MODULE ) -i2c_unregister_device (codec->control_data); -i2c_del_driver (&wm8900_i2c_driver); -#endif kfree (codec);return 0 ;
@@ -1532,13 +1475,13 @@ EXPORT_SYMBOL_GPL(soc_codec_dev_wm8900);static int __devinit wm8900_modinit (void ) { -return snd_soc_register_dai (&wm8900_dai); +return i2c_add_driver (&wm8900_i2c_driver); }module_init (wm8900_modinit); static void __exit wm8900_exit(void) { -snd_soc_unregister_dai (&wm8900_dai); +i2c_del_driver (&wm8900_i2c_driver); }module_exit (wm8900_exit);
Signature · 1 line
1.5.6.5
Re: [PATCH 10/18] ASoC: Add card registration API
In reply to Mark BrownAt Tue, 9 Dec 2008 14:01:34 +0000,
Quoted 11 lines · Mark Brown
ASoC v2 allows cards, codecs and platforms to instantiate separately, with the overall ASoC device only being instantiated once all the required components have registered. As part of backporting Liam's work introduce an initial version of the card registration functions. At present these do nothing active and are internal only, they will be exposed to machine drivers after further backporting. Adding this now allows the datastructures used for dynamic card instantiation to be built up gradually.
Signed-off-by Mark Brown <[email protected]>
(snip)
Quoted 4 lines
sound/soc/soc-core.c +0
-0
(snip)
sound/soc/soc-core.c static int soc_probe(struct platform_device *pdev) · line 800
Quoted 12 lines
sound/soc/soc-core.c +8
-0@@ -784,6 +790,14 @@ static int soc_probe(struct platform_device *pdev)/* Bodge while we push things out of socdev */ card->socdev = socdev; +/* Bodge while we unpick instantiation */ + card->dev = &pdev->dev; + ret =snd_soc_register_card (card); +if (ret !=0 ) { +dev_err (&pdev->dev,"Failed to register card\n" ); +return ret; + } +
I guess unregister call is missing in the error path of soc_probe()?
Takashi
Re: [PATCH 10/18] ASoC: Add card registration API
At Tue, 09 Dec 2008 15:17:16 +0100,
Quoted 24 lines · I wrote:
At Tue, 9 Dec 2008 14:01:34 +0000,
Quoted 11 lines · Mark Brown
ASoC v2 allows cards, codecs and platforms to instantiate separately, with the overall ASoC device only being instantiated once all the required components have registered. As part of backporting Liam's work introduce an initial version of the card registration functions. At present these do nothing active and are internal only, they will be exposed to machine drivers after further backporting. Adding this now allows the datastructures used for dynamic card instantiation to be built up gradually.
Signed-off-by Mark Brown <[email protected]>(snip)
Quoted 4 lines
sound/soc/soc-core.c +0
-0(snip)
Quoted 4 lines
sound/soc/soc-core.c +0
-0@@ -784,6 +790,14 @@ static int soc_probe(struct platform_device *pdev)/* Bodge while we push things out of socdev */ card->socdev = socdev;
Quoted 10 lines
sound/soc/soc-core.c static int soc_probe(struct platform_device *pdev) · line 800
Quoted 8 lines
sound/soc/soc-core.c +8
-0+/* Bodge while we unpick instantiation */ + card->dev = &pdev->dev; + ret =snd_soc_register_card (card); +if (ret !=0 ) { +dev_err (&pdev->dev,"Failed to register card\n" ); +return ret; + } +I guess unregister call is missing in the error path of
soc_probe()?
Looking further, the patch 16/18 changes the code again, thus the error check there will be irrelevant. Then no need to fix here...
Takashi
Re: [PATCH 14/18] ASoC: Register platform drivers
In reply to Mark BrownAt Tue, 9 Dec 2008 14:01:38 +0000,
Quoted 5 lines · Mark Brown
sound/soc/atmel/atmel-pcm.c +0
-0
sound/soc/atmel/atmel-pcm.c struct snd_soc_platform atmel_soc_platform = { · line 486
Quoted 10 lines
sound/soc/atmel/atmel-pcm.c +7
-0@@ -477,6 +477,18 @@ struct snd_soc_platform atmel_soc_platform = { };EXPORT_SYMBOL_GPL (atmel_soc_platform); +static int __devinit atmel_pcm_modinit (void ) +{ +return snd_soc_register_platform (&atmel_soc_platform); +} +module_init (atmel_pcm_modinit); + +static void __exit atmel_pcm_exit(void)
Typo either here...
sound/soc/atmel/atmel-pcm.c struct snd_soc_platform atmel_soc_platform = { · line 490
Quoted 4 lines
sound/soc/atmel/atmel-pcm.c +4
-0+{ +snd_soc_unregister_platform (&atmel_soc_platform); +} +module_exit (atmel_pcm_modexit);
... or here.
Takashi
At Tue, 9 Dec 2008 14:01:01 +0000,
Quoted 8 lines · Mark Brown
The following changes since commit
28a1d869560a49d960ba2a3b450ec965712e5560:
Daniel Mack (1):
ASoC: tlv320aic3x: control additions and cleanupsare available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asocfor-tiwai
Thanks, now I pulled this. But it seems that there are few build problems.
Takashi
Re: [PATCH 12/18] ASoC: Register platform DAIs
In reply to Mark BrownAt Tue, 9 Dec 2008 14:01:36 +0000,
Quoted 6 lines · Mark Brown
sound/soc/atmel/atmel_ssc_dai.c +0
-0
sound/soc/atmel/atmel_ssc_dai.c struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { · line 779
Quoted 8 lines
sound/soc/atmel/atmel_ssc_dai.c +5
-0@@ -772,6 +772,17 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { };EXPORT_SYMBOL_GPL (atmel_ssc_dai); +static int __devinit atmel_ssc_modinit (void ) +{ +return snd_soc_register_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); +} +module_init (snd_soc_init);
Typo.
sound/soc/atmel/atmel_ssc_dai.c struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { · line 785
Quoted 6 lines
sound/soc/atmel/atmel_ssc_dai.c +6
-0+ +static void __exit snd_soc_exit(void) +{ +snd_soc_unregister_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); +} +
No module_exit() is defined.
Takashi
Quoted 2 lines · Takashi Iwai
Thanks, now I pulled this. But it seems that there are few build problems.
Any beyond the Atmel ones you pointed out already for which:
The following changes since commit f0752331b89ce79063f765545dd7dd5f49d9a713:
Mark Brown (1):
ASoC: Convert WM8900 to allow registration by machine code
are available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asoc for-tiwai
Mark Brown (1):
ASoC: Fix typos in Atmel module registration
sound/soc/atmel/atmel-pcm.c | 2 +- sound/soc/atmel/atmel_ssc_dai.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
PATCH 1/1 ASoC: Fix typos in Atmel module registration
I wish I had boards which work with unmodified kernels :/
--- sound/soc/atmel/atmel-pcm.c | 2 +- sound/soc/atmel/atmel_ssc_dai.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/atmel/atmel-pcm.c +1 -1
@@ -483,7 +483,7 @@ static int __devinit atmel_pcm_modinit(void) }module_init (atmel_pcm_modinit); -static void __exit atmel_pcm_exit(void) +static void __exit atmel_pcm_modexit(void) {snd_soc_unregister_platform (&atmel_soc_platform); }
sound/soc/atmel/atmel_ssc_dai.c +3 -2
@@ -776,12 +776,13 @@ static int __devinit atmel_ssc_modinit(void) {return snd_soc_register_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); } -module_init (snd_soc_init); +module_init (atmel_ssc_modinit); -static void __exit snd_soc_exit(void) +static void __exit atmel_ssc_modexit(void) {snd_soc_unregister_dais (atmel_ssc_dai,ARRAY_SIZE (atmel_ssc_dai)); } +module_exit (atmel_ssc_modexit);/* Module information */ MODULE_AUTHOR ("Sedji Gaouaou, [email protected], www.atmel.com" );
Signature · 1 line
1.5.6.5
At Tue, 9 Dec 2008 15:01:11 +0000,
Quoted 8 lines · Mark Brown
Quoted 2 lines · Takashi Iwai
Thanks, now I pulled this. But it seems that there are few build problems.
Any beyond the Atmel ones you pointed out already for which:
Quoted 7 lines
The following changes since commit
f0752331b89ce79063f765545dd7dd5f49d9a713:
Mark Brown (1):
ASoC: Convert WM8900 to allow registration by machine codeare available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asocfor-tiwai
Thanks, pulled this one now.
Takashi
Quoted 8 lines
Mark Brown (1):
ASoC: Fix typos in Atmel module registrationsound/soc/atmel/atmel-pcm.c | 2 +- sound/soc/atmel/atmel_ssc_dai.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
Re: [PATCH 06/18] ASoC: TWL4030: DAPM mapping of the Headset outputs
In reply to Mark BrownQuoted 10 lines · Mark Brown
From: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Headset outputs.
Signed-off-by Peter Ujfalusi <[email protected]>Signed-off-by Mark Brown <[email protected]>--- sound/soc/codecs/twl4030.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
<snip>
sound/soc/codecs/twl4030.c static const struct snd_soc_dapm_route intercon[] = { · line 780
Quoted 10 lines
sound/soc/codecs/twl4030.c +3
-0SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),@@ -744,6 +775,12 @@ static const struct snd_soc_dapm_route intercon[] = { {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, {"PredriveR Mux", "DACL2", "ARXL2_APGA"}, +/* HeadsetL */ + {"HeadsetL Mux", "DACL1", "ARXL1_APGA"}, + {"HeadsetL Mux", "DACL2", "ARXL2_APGA"},
The control names "DACR1","DACR2","DACL1","DACL2" have the same name with the widgets in the first patch. I suggest you change a different name to avoid confusion.
Stanley.
Quoted 15 lines
sound/soc/codecs/twl4030.c +5
-0+/* HeadsetR */ + {"HeadsetR Mux", "DACR1", "ARXR1_APGA"}, + {"HeadsetR Mux", "DACR2", "ARXR2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"},@@ -751,6 +788,8 @@ static const struct snd_soc_dapm_route intercon[] = { {"EARPIECE", NULL, "Earpiece Mux"}, {"PREDRIVEL", NULL, "PredriveL Mux"}, {"PREDRIVER", NULL, "PredriveR Mux"}, + {"HSOL", NULL, "HeadsetL Mux"}, + {"HSOR", NULL, "HeadsetR Mux"},/* inputs */ {"ADCL", NULL, "INL"},
Re: [PATCH 06/18] ASoC: TWL4030: DAPM mapping of the Headset outputs
Quoted 14 lines · On Wednesday 10 December 2008 10:27:44 ext stanley.miao wrote:
Quoted 10 lines · Mark Brown
From: Peter Ujfalusi <[email protected]>
Adds DAPM muxing, routing for the Headset outputs.
Signed-off-by Peter Ujfalusi <[email protected]>Signed-off-by Mark Brown <[email protected]>--- sound/soc/codecs/twl4030.c | 39+++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
<snip>
Quoted 13 lines
sound/soc/codecs/twl4030.c static const struct snd_soc_dapm_route intercon[] = · line 780
Quoted 9 lines
sound/soc/codecs/twl4030.c +3
-0SND_SOC_DAPM_ADC ("ADCL" ,"Left Capture" ,SND_SOC_NOPM ,0 ,0 ), SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),@@ -744,6 +775,12 @@ static const struct snd_soc_dapm_route intercon[] = { {"PredriveR Mux", "DACR1", "ARXR1_APGA"}, {"PredriveR Mux", "DACR2", "ARXR2_APGA"}, {"PredriveR Mux", "DACL2", "ARXL2_APGA"}, +/* HeadsetL */ + {"HeadsetL Mux", "DACL1", "ARXL1_APGA"}, + {"HeadsetL Mux", "DACL2", "ARXL2_APGA"},The control names "DACR1","DACR2","DACL1","DACL2" have the same name with the widgets in the first patch. I suggest you change a different name to avoid confusion.
Yes, this can be confusing... I'm thinking of changing either the control names like this:
"DACR1" -> "DAC Right1" or "Audio Out R1" or "Out R1"
"DACR2" -> "DAC Right2" or "Audio Out R2" or "Out R1"
...
I think the "DAC Right1" type reflects better the functionality of the mux...
or make the same name change, but with the SND_SOC_DAPM_DAC
Quoted 2 lines
Stanley.
Signature · 1 line
Péter
Quoted 16 lines
Quoted 16 lines
sound/soc/codecs/twl4030.c +5
-0+/* HeadsetR */ + {"HeadsetR Mux", "DACR1", "ARXR1_APGA"}, + {"HeadsetR Mux", "DACR2", "ARXR2_APGA"},/* outputs */ {"OUTL", NULL, "ARXL2_APGA"},@@ -751,6 +788,8 @@ static const struct snd_soc_dapm_route intercon[] = { {"EARPIECE", NULL, "Earpiece Mux"}, {"PREDRIVEL", NULL, "PredriveL Mux"}, {"PREDRIVER", NULL, "PredriveR Mux"}, + {"HSOL", NULL, "HeadsetL Mux"}, + {"HSOR", NULL, "HeadsetR Mux"},/* inputs */ {"ADCL", NULL, "INL"},