DT support for N900 soundcard (rx51-audio)
cover DT support for N900 soundcard (rx51-audio)
Hi,
This patchset adds DT support in rx51-audio. I tested it on my Nokia N900 and was able to play a wav file using aplay. I have not tested the whole functionality, but output via speakers, headphones and the related enable controls seem to work.
The patches can be applied cleanly to torvalds/linux.git:master and broonie/sound.git:for-next.
-- Sebastian
Pali Rohár (1):
ASoC: omap: rx51: Use devm_snd_soc_register_card
Sebastian Reichel (4):
ASoC: Allow Aux Codecs to be specified using DT
ASoC: RX-51: Add DT support to sound driver
ASoC: RX-51: Convert to table based DAPM setup
ASoC: tlv320aic3x: fix shared reset pin for DT
.../devicetree/bindings/sound/nokia,rx51.txt | 27 +++ include/sound/rx51.h | 18 ++ include/sound/soc.h | 13 +- sound/soc/codecs/tlv320aic3x.c | 9 +- sound/soc/omap/omap-mcbsp.c | 5 +- sound/soc/omap/omap-mcbsp.h | 2 +- sound/soc/omap/rx51.c | 248 +++++++++++++-------- sound/soc/soc-core.c | 68 +++--- 8 files changed, 266 insertions(+), 124 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h
Signature · 1 line
1.9.1
PATCH 1/5 ASoC: omap: rx51: Use devm_snd_soc_register_card
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use devm_snd_soc_register_card. It also adds module alias to support driver autoloading.
--- sound/soc/omap/rx51.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-)
sound/soc/omap/rx51.c +28 -20
@@ -394,10 +394,9 @@ static struct snd_soc_card rx51_sound_card = { .num_configs = ARRAY_SIZE(rx51_codec_conf), }; -static struct platform_device *rx51_snd_device; - -static int __init rx51_soc_init (void ) +static int rx51_soc_probe (struct platform_device *pdev) { +struct snd_soc_card *card = &rx51_sound_card;int err;if (!machine_is_nokia_rx51 () && !of_machine_is_compatible ("nokia,omap3-n900" ))
@@ -412,22 +411,17 @@ static int __init rx51_soc_init(void)if (err) goto err_gpio_eci_sw; - rx51_snd_device =platform_device_alloc ("soc-audio" ,-1 ); -if (!rx51_snd_device) { - err = -ENOMEM ; - goto err1; - } - -platform_set_drvdata (rx51_snd_device, &rx51_sound_card); + card->dev = &pdev->dev; - err =platform_device_add (rx51_snd_device); -if (err) - goto err2; + err =devm_snd_soc_register_card (card->dev, card); +if (err) { +dev_err (&pdev->dev,"snd_soc_register_card failed (%d)\n" , err); + goto err_snd; + }return 0 ; -err2: -platform_device_put (rx51_snd_device); -err1: +err_snd: + card->dev =NULL ;gpio_free (RX51_ECI_SW_GPIO ); err_gpio_eci_sw:gpio_free (RX51_TVOUT_SEL_GPIO );
@@ -436,19 +430,33 @@ err_gpio_tvout_sel:return err; } -static void __exit rx51_soc_exit(void) +static int rx51_soc_remove (struct platform_device *pdev) { +struct snd_soc_card *card =platform_get_drvdata (pdev); +snd_soc_jack_free_gpios (&rx51_av_jack,ARRAY_SIZE (rx51_av_jack_gpios), rx51_av_jack_gpios); -platform_device_unregister (rx51_snd_device); + card->dev =NULL ; +gpio_free (RX51_ECI_SW_GPIO );gpio_free (RX51_TVOUT_SEL_GPIO ); + +return 0 ; } -module_init (rx51_soc_init); -module_exit (rx51_soc_exit); +static struct platform_driver rx51_soc_driver = { + .driver = { + .name ="rx51-audio" , + .owner =THIS_MODULE , + }, + .probe = rx51_soc_probe, + .remove = rx51_soc_remove, +}; + +module_platform_driver (rx51_soc_driver);MODULE_AUTHOR ("Nokia Corporation" );MODULE_DESCRIPTION ("ALSA SoC Nokia RX-51" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:rx51-audio" );
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH 1/5] ASoC: omap: rx51: Use devm_snd_soc_register_card
Quoted 5 lines · Sebastian Reichel
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use
devm_snd_soc_register_card. It also adds module alias to support driver autoloading.
This doesn't apply against current code and since it does multiple things it should be multiple patches.
sound/soc/omap/rx51.c err_gpio_tvout_sel: · line 441
Quoted 10 lines
sound/soc/omap/rx51.c +5
-1+static int rx51_soc_remove (struct platform_device *pdev) { +struct snd_soc_card *card =platform_get_drvdata (pdev); +snd_soc_jack_free_gpios (&rx51_av_jack,ARRAY_SIZE (rx51_av_jack_gpios), rx51_av_jack_gpios); -platform_device_unregister (rx51_snd_device); + card->dev =NULL ; +
Why is this assignment being done?
Re: [alsa-devel] [PATCH 1/5] ASoC: omap: rx51: Use devm_snd_soc_register_card
In reply to Sebastian ReichelQuoted 47 lines · Sebastian Reichel
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use
devm_snd_soc_register_card. It also adds module alias to support driver autoloading.Signed-off-by Pali Rohár <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>--- sound/soc/omap/rx51.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-)sound/soc/omap/rx51.c +5
-13@@ -394,10 +394,9 @@ static struct snd_soc_card rx51_sound_card = { .num_configs = ARRAY_SIZE(rx51_codec_conf), }; -static struct platform_device *rx51_snd_device; - -static int __init rx51_soc_init (void ) +static int rx51_soc_probe (struct platform_device *pdev) { +struct snd_soc_card *card = &rx51_sound_card;int err;if (!machine_is_nokia_rx51 () && !of_machine_is_compatible ("nokia,omap3-n900" ))@@ -412,22 +411,17 @@ static int __init rx51_soc_init(void)if (err) goto err_gpio_eci_sw; - rx51_snd_device =platform_device_alloc ("soc-audio" ,-1 ); -if (!rx51_snd_device) { - err = -ENOMEM ; - goto err1; - } - -platform_set_drvdata (rx51_snd_device, &rx51_sound_card); + card->dev = &pdev->dev; - err =platform_device_add (rx51_snd_device); -if (err) - goto err2; + err =devm_snd_soc_register_card (card->dev, card); +if (err) {
sound/soc/omap/rx51.c static int __init rx51_soc_init(void) · line 424
Quoted 10 lines
sound/soc/omap/rx51.c +5
-3+dev_err (&pdev->dev,"snd_soc_register_card failed (%d)\n" , err); + goto err_snd; + }return 0 ; -err2: -platform_device_put (rx51_snd_device); -err1: +err_snd: + card->dev =NULL ;
Why this is required???
~Rajeev
Quoted 32 lines
sound/soc/omap/rx51.c +12
-4gpio_free (RX51_ECI_SW_GPIO ); err_gpio_eci_sw:gpio_free (RX51_TVOUT_SEL_GPIO );@@ -436,19 +430,33 @@ err_gpio_tvout_sel:return err; } -static void __exit rx51_soc_exit(void) +static int rx51_soc_remove (struct platform_device *pdev) { +struct snd_soc_card *card =platform_get_drvdata (pdev); +snd_soc_jack_free_gpios (&rx51_av_jack,ARRAY_SIZE (rx51_av_jack_gpios), rx51_av_jack_gpios); -platform_device_unregister (rx51_snd_device); + card->dev =NULL ; +gpio_free (RX51_ECI_SW_GPIO );gpio_free (RX51_TVOUT_SEL_GPIO ); + +return 0 ; } -module_init (rx51_soc_init); -module_exit (rx51_soc_exit); +static struct platform_driver rx51_soc_driver = { + .driver = { + .name ="rx51-audio" , + .owner =THIS_MODULE , + },
sound/soc/omap/rx51.c err_gpio_tvout_sel: · line 462
Quoted 10 lines
sound/soc/omap/rx51.c +6
-0+ .probe = rx51_soc_probe, + .remove = rx51_soc_remove, +}; + +module_platform_driver (rx51_soc_driver);MODULE_AUTHOR ("Nokia Corporation" );MODULE_DESCRIPTION ("ALSA SoC Nokia RX-51" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:rx51-audio" );
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/5 ASoC: Allow Aux Codecs to be specified using DT
In reply to Sebastian ReichelThis patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf and adds support for the changes to SoC core methods.
--- include/sound/soc.h | 13 +++++++++- sound/soc/soc-core.c | 68 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 27 deletions(-)
include/sound/soc.h +12 -1
@@ -931,7 +931,12 @@ struct snd_soc_dai_link { };struct snd_soc_codec_conf { +/* +* specify device either by device name, or by +* DT/OF node, but not both. +*/ const char *dev_name; +const struct device_node *of_node;/* * optional map of kcontrol, widget and path name prefixes that are
@@ -942,7 +947,13 @@ struct snd_soc_codec_conf {struct snd_soc_aux_dev {const char *name;/* Codec name */ -const char *codec_name;/* for multi-codec */ + +/* +* specify multi-codec either by device name, or by +* DT/OF node, but not both. +*/ +const char *codec_name; +const struct device_node *codec_of_node;/* codec/machine specific init - e.g. add machine controls */ int (*init)(struct snd_soc_dapm_context *dapm);
sound/soc/soc-core.c +42 -26
104 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH 2/5] ASoC: Allow Aux Codecs to be specified using DT
Quoted 5 lines · Sebastian Reichel
This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This change adds new fields to
snd_soc_aux_devandsnd_soc_codec_confand adds support for the changes to SoC core methods.
What binding is supposed to be implemented by this?
PATCH 3/5 ASoC: RX-51: Add DT support to sound driver
In reply to Sebastian ReichelThis patch adds device tree support to the Nokia N900 audio driver. It also removes GPIO defines and gets them from platform data / device tree, since some GPIO numbers may be different with DT boot.
The binding also changes a helper function in omap-mcbsp, which is currently only used by the Nokia N900. This change is needed, because DT instanced omap-mcbsp driver has no valid id assigned.
Last but not least the DT binding is documented.
--- .../devicetree/bindings/sound/nokia,rx51.txt | 27 ++++ include/sound/rx51.h | 18 +++ sound/soc/omap/omap-mcbsp.c | 5 +- sound/soc/omap/omap-mcbsp.h | 2 +- sound/soc/omap/rx51.c | 176 ++++++++++++++++----- 5 files changed, 183 insertions(+), 45 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +27 -0
@@ -0,0 +1,27 @@ +* Nokia N900 audio setup + +Required properties: +- compatible: Should contain "nokia,n900-audio" +- nokia,cpu-dai: phandle for the McBSP node +- nokia,audio-codec: phandles for the main TLV320AIC3X node and the + auxiliary TLV320AIC3X node (in this order) +- nokia,headphone-amplifier: phandle for the TPA6130A2 node +- tvout-selection-gpios: GPIO for tvout selection +- jack-detection-gpios: GPIO for jack detection +- eci-switch-gpios: GPIO for ECI (Enhancement Control Interface) switch +- speaker-amplifier-gpios: GPIO for speaker amplifier + +Example: + +sound { + compatible = "nokia,n900-audio"; + + nokia,cpu-dai = <&mcbsp2>; + nokia,audio-codec = <&tlv320aic3x>, <&tlv320aic3x_aux>; + nokia,headphone-amplifier = <&tpa6130a2>; + + tvout-selection-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ + jack-detection-gpios = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ + eci-switch-gpios = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ + speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; +};
include/sound/rx51.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Platform data for Nokia RX-51 SoC audio +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#ifndef __RX51_AUDIO_H__ +#define __RX51_AUDIO_H__ + +struct rx51_audio_pdata { +int tvout_selection_gpio; +int jack_detection_gpio; +int eci_sw_gpio; +int speaker_amp_gpio; +}; + +#endif
sound/soc/omap/omap-mcbsp.c +3 -2
@@ -691,7 +691,7 @@ OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 1 Volume", \OMAP_MCBSP_ST_CONTROLS (2 );OMAP_MCBSP_ST_CONTROLS (3 ); -int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd) +int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd,int port_id) {struct snd_soc_dai *cpu_dai = rtd->cpu_dai;struct omap_mcbsp *mcbsp =snd_soc_dai_get_drvdata (cpu_dai);
@@ -701,7 +701,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd)return 0 ; } -switch (mcbsp->id) { +switch (port_id) {case 2 :/* McBSP 2 */ return snd_soc_add_dai_controls(cpu_dai, omap_mcbsp2_st_controls,
@@ -711,6 +711,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) omap_mcbsp3_st_controls, ARRAY_SIZE(omap_mcbsp3_st_controls));default : +dev_err (mcbsp->dev,"Port %d not supported\n" , port_id);break ; }
sound/soc/omap/omap-mcbsp.h +1 -1
@@ -39,6 +39,6 @@ enum omap_mcbsp_div { OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */ }; -int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd); +int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd,int port_id);#endif
sound/soc/omap/rx51.c +134 -42
282 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH 3/5] ASoC: RX-51: Add DT support to sound driver
Quoted 3 lines · Sebastian Reichel
This patch adds device tree support to the Nokia N900 audio driver. It also removes GPIO defines and gets them from platform data / device tree, since some GPIO numbers may be different with DT boot.
This binding looks mostly fine, a few code things though which may influence the binding. The main thing is that you're doing a lot of changes here which aren't really related to adding the binding which aren't mentioned and make it harder to review - as well as making the change larger one of the things that's done in review is to check that the change did what it was described as doing. At least some of the time there isn't even any code overlap.
sound/soc/omap/rx51.c static const struct snd_kcontrol_new aic34_rx51_controlsb[] = { · line 294
Quoted 10 lines
sound/soc/omap/rx51.c +3
-0@@ -290,6 +286,9 @@ static const struct snd_kcontrol_new aic34_rx51_controlsb[] = {static int rx51_aic34_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_card *card = codec->card; +struct rx51_audio_pdata *pdata =snd_soc_card_get_drvdata (card); +struct snd_soc_dapm_context *dapm = &codec->dapm;int err;
Random blank line added here.
sound/soc/omap/rx51.c static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) · line 309
Quoted 12 lines
sound/soc/omap/rx51.c +3
-1@@ -301,8 +300,10 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)/* Add RX-51 specific controls */ err =snd_soc_add_card_controls (rtd->card, aic34_rx51_controls,ARRAY_SIZE (aic34_rx51_controls)); -if (err <0 ) +if (err <0 ) { +dev_err (card->dev,"Failed to add RX-51 specific controls\n" );return err; + }/* Add RX-51 specific widgets */ snd_soc_dapm_new_controls(dapm, aic34_dapm_widgets,
This is nothing to do with DT support, separate patch please. There's quite a few other things like this. You're also not printing any error codes in the messages.
sound/soc/omap/rx51.c static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) · line 319
Quoted 9 lines
sound/soc/omap/rx51.c +3
-1@@ -312,25 +313,39 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); err =tpa6130a2_add_controls (codec); -if (err <0 ) +if (err <0 ) { +dev_err (card->dev,"Failed to add TPA6130A2 controls\n" );return err; + }
If this is converted to DT and you've added aux CODEC support as part of that then why are we still manually adding the controls for the headphone amp? I would have expected this to be registered as an aux CODEC. This seems likely to feed through into the binding for referencing the components.
sound/soc/omap/rx51.c static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) · line 326
Quoted 5 lines
sound/soc/omap/rx51.c +4
-0+ err =omap_mcbsp_st_add_controls (rtd,2 ); +if (err <0 ) { +dev_err (card->dev,"Failed to add MCBSP controls\n" );return err; + }
Refactoring this as a separate patch would also help.
sound/soc/omap/rx51.c static struct snd_soc_card rx51_sound_card = { · line 493
Quoted 7 lines
sound/soc/omap/rx51.c +5
-1- err =gpio_request_one (RX51_ECI_SW_GPIO , +if (err) { +dev_err (card->dev,"could not setup tvout_sel\n" ); + goto error; + } + err =devm_gpio_request_one (card->dev, pdata->eci_sw_gpio,GPIOF_DIR_OUT |GPIOF_INIT_HIGH ,"eci_sw" );
Again, moving this refactoring into a separate patch will help a lot with review.
PATCH 4/5 ASoC: RX-51: Convert to table based DAPM setup
In reply to Sebastian ReichelUse table based setup to register the DAPM widgets and routes. This on one hand makes the code a bit cleaner and on the other hand the board level DAPM elements get registered in the card's DAPM context rather than in the CODEC's DAPM context. This fixes an issue with double prefixing of routes.
--- sound/soc/omap/rx51.c | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-)
sound/soc/omap/rx51.c +6 -42
@@ -233,9 +233,6 @@ static const struct snd_soc_dapm_widget aic34_dapm_widgets[] = {SND_SOC_DAPM_HP ("Headphone Jack" , rx51_hp_event),SND_SOC_DAPM_MIC ("HS Mic" ,NULL ),SND_SOC_DAPM_LINE ("FM Transmitter" ,NULL ), -}; - -static const struct snd_soc_dapm_widget aic34_dapm_widgetsb[] = { SND_SOC_DAPM_SPK("Earphone", NULL), };
@@ -249,9 +246,7 @@ static const struct snd_soc_dapm_route audio_map[] = { {"DMic Rate 64", NULL, "Mic Bias"}, {"Mic Bias", NULL, "DMic"}, -}; -static const struct snd_soc_dapm_route audio_mapb[] = { {"b LINE2R", NULL, "MONO_LOUT"}, {"Earphone", NULL, "b HPLOUT"},
@@ -277,9 +272,6 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {SOC_ENUM_EXT ("Jack Function" , rx51_enum[2 ], rx51_get_jack, rx51_set_jack),SOC_DAPM_PIN_SWITCH ("FM Transmitter" ), -}; - -static const struct snd_kcontrol_new aic34_rx51_controlsb[] = { SOC_DAPM_PIN_SWITCH("Earphone"), };
@@ -297,21 +289,6 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)snd_soc_dapm_nc_pin (dapm,"MIC3R" );snd_soc_dapm_nc_pin (dapm,"LINE1R" ); -/* Add RX-51 specific controls */ - err =snd_soc_add_card_controls (rtd->card, aic34_rx51_controls, -ARRAY_SIZE (aic34_rx51_controls)); -if (err <0 ) { -dev_err (card->dev,"Failed to add RX-51 specific controls\n" ); -return err; - } - -/* Add RX-51 specific widgets */ -snd_soc_dapm_new_controls (dapm, aic34_dapm_widgets, -ARRAY_SIZE (aic34_dapm_widgets)); - -/* Set up RX-51 specific audio path audio_map */ -snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); - err =tpa6130a2_add_controls (codec);if (err <0 ) {dev_err (card->dev,"Failed to add TPA6130A2 controls\n" );
@@ -348,24 +325,6 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)return 0 ; } -static int rx51_aic34b_init (struct snd_soc_dapm_context *dapm) -{ -int err; - - err =snd_soc_add_card_controls (dapm->card, aic34_rx51_controlsb, -ARRAY_SIZE (aic34_rx51_controlsb)); -if (err <0 ) -return err; - - err =snd_soc_dapm_new_controls (dapm, aic34_dapm_widgetsb, -ARRAY_SIZE (aic34_dapm_widgetsb)); -if (err <0 ) -return 0 ; - -return snd_soc_dapm_add_routes (dapm, audio_mapb, -ARRAY_SIZE (audio_mapb)); -} -/* Digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link rx51_dai[] = { {
@@ -386,7 +345,6 @@ static struct snd_soc_aux_dev rx51_aux_dev[] = { { .name = "TLV320AIC34b", .codec_name = "tlv320aic3x-codec.2-0019", - .init = rx51_aic34b_init, }, };
@@ -407,6 +365,12 @@ static struct snd_soc_card rx51_sound_card = { .num_aux_devs = ARRAY_SIZE(rx51_aux_dev), .codec_conf = rx51_codec_conf, .num_configs = ARRAY_SIZE(rx51_codec_conf), + .dapm_widgets = aic34_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(aic34_dapm_widgets), + .controls = aic34_rx51_controls, + .num_controls = ARRAY_SIZE(aic34_rx51_controls), + .dapm_routes = audio_map, + .num_dapm_routes = ARRAY_SIZE(audio_map), };static int rx51_soc_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH 4/5] ASoC: RX-51: Convert to table based DAPM setup
Quoted 4 lines · Sebastian Reichel
Use table based setup to register the DAPM widgets and routes. This on one hand makes the code a bit cleaner and on the other hand the board level DAPM elements get registered in the card's DAPM context rather than in the CODEC's DAPM context. This fixes an issue with double prefixing of routes.
Simple patches like this, especially ones that are bug fixes, should come at the start of the series to allow them to be applied first. This cuts down on review if multiple iterations are needed and allows bug fixes to be merged as such.
PATCH 5/5 ASoC: tlv320aic3x: fix shared reset pin for DT
In reply to Sebastian ReichelCurrently the second tlv320aic3x instance fails to be probed from DT if the reset pin is shared with the first one.
This patch fixes it by moving the list add of the
reset pin into the i2c_probe method.
--- sound/soc/codecs/tlv320aic3x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
sound/soc/codecs/tlv320aic3x.c +7 -2
@@ -1399,7 +1399,6 @@ static int aic3x_probe(struct snd_soc_codec *codec) }aic3x_add_widgets (codec); -list_add (&aic3x->list, &reset_list);return 0 ;
@@ -1569,7 +1568,13 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_aic3x, &aic3x_dai,1 ); -return ret; + +if (ret !=0 ) + goto err_gpio; + +list_add (&aic3x->list, &reset_list); + +return 0 ; err_gpio: if (gpio_is_valid(aic3x->gpio_reset) &&
Signature · 1 line
1.9.1
Re: [PATCH 5/5] ASoC: tlv320aic3x: fix shared reset pin for DT
Quoted 3 lines · Sebastian Reichel
Currently the second tlv320aic3x instance fails to be probed from DT if the reset pin is shared with the first one.
Applied, thanks.