diff mbox

ARM: DaVinci: ASoC: Define AIC3x setup info

Message ID 1251302890-27535-1-git-send-email-chaithrika@ti.com (mailing list archive)
State Superseded
Headers show

Commit Message

chaithrika@ti.com Aug. 26, 2009, 4:08 p.m. UTC
The codec setup data structure has to be defined for
successful probe.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
---
Applies to temp/asoc branch of DaVinci GIT tree.

 sound/soc/davinci/davinci-evm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

Kevin Hilman Aug. 26, 2009, 7:28 a.m. UTC | #1
Chaithrika U S <chaithrika@ti.com> writes:

> The codec setup data structure has to be defined for
> successful probe.
>
> Signed-off-by: Chaithrika U S <chaithrika@ti.com>
> ---
> Applies to temp/asoc branch of DaVinci GIT tree.

Thanks Chaithrika,

OK, I pushed a new 'temp/asoc' branch with Chaithrika's changes folded
into mine, changing the author to Chaithrika.

Now there's one patch for DaVinci git and the other for ASoC.

I'll pull the one into DaVinci git master today and add it to my
for-next.  Mark can merge the other and then we should be back to
building/working audio in linux-next.

Kevin


>  sound/soc/davinci/davinci-evm.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
> index 81628ac..67414f6 100644
> --- a/sound/soc/davinci/davinci-evm.c
> +++ b/sound/soc/davinci/davinci-evm.c
> @@ -206,27 +206,33 @@ static struct snd_soc_card da850_snd_soc_card = {
>  	.num_links = 1,
>  };
>  
> +static struct aic3x_setup_data aic3x_setup;
> +
>  /* evm audio subsystem */
>  static struct snd_soc_device evm_snd_devdata = {
>  	.card = &snd_soc_card_evm,
>  	.codec_dev = &soc_codec_dev_aic3x,
> +	.codec_data = &aic3x_setup,
>  };
>  
>  /* evm audio subsystem */
>  static struct snd_soc_device dm6467_evm_snd_devdata = {
>  	.card = &dm6467_snd_soc_card_evm,
>  	.codec_dev = &soc_codec_dev_aic3x,
> +	.codec_data = &aic3x_setup,
>  };
>  
>  /* evm audio subsystem */
>  static struct snd_soc_device da830_evm_snd_devdata = {
>  	.card = &da830_snd_soc_card,
>  	.codec_dev = &soc_codec_dev_aic3x,
> +	.codec_data = &aic3x_setup,
>  };
>  
>  static struct snd_soc_device da850_evm_snd_devdata = {
>  	.card		= &da850_snd_soc_card,
>  	.codec_dev	= &soc_codec_dev_aic3x,
> +	.codec_data	= &aic3x_setup,
>  };
>  
>  static struct platform_device *evm_snd_device;
> -- 
> 1.5.6
chaithrika@ti.com Aug. 26, 2009, 11:03 a.m. UTC | #2
On Wed, Aug 26, 2009 at 14:58:02, Mark Brown wrote:
> On Wed, Aug 26, 2009 at 12:08:10PM -0400, Chaithrika U S wrote:
> > The codec setup data structure has to be defined for
> > successful probe.
> 
> This would be better fixed in the CODEC driver - if there's nothing in
> the setup data it should cope.  Please try the patch below, it should
> eliminate the need for the setup data but I've not even compile tested
> it:
> 

Mark,

Agree. I did a quick try of this patch on DA850/OMAP-L138 EVM and
it is working fine. Thank you for the patch.

Regards, 
Chaithrika

> diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
> index 5d54767..3395cf9 100644
> --- a/sound/soc/codecs/tlv320aic3x.c
> +++ b/sound/soc/codecs/tlv320aic3x.c
> @@ -1385,15 +1385,14 @@ static int aic3x_probe(struct platform_device *pdev)
>  	socdev->card->codec = codec;
>  	setup = socdev->codec_data;
>  
> -	if (!setup) {
> -		dev_err(&pdev->dev, "No setup data supplied\n");
> -		return -EINVAL;
> +	if (setup) {
> +		/* setup GPIO functions */
> +		aic3x_write(codec, AIC3X_GPIO1_REG,
> +			    (setup->gpio_func[0] & 0xf) << 4);
> +		aic3x_write(codec, AIC3X_GPIO2_REG,
> +			    (setup->gpio_func[1] & 0xf) << 4);
>  	}
>  
> -	/* setup GPIO functions */
> -	aic3x_write(codec, AIC3X_GPIO1_REG, (setup->gpio_func[0] & 0xf) << 4);
> -	aic3x_write(codec, AIC3X_GPIO2_REG, (setup->gpio_func[1] & 0xf) << 4);
> -
>  	/* register pcms */
>  	ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
>  	if (ret < 0) {
>
diff mbox

Patch

diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 81628ac..67414f6 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -206,27 +206,33 @@  static struct snd_soc_card da850_snd_soc_card = {
 	.num_links = 1,
 };
 
+static struct aic3x_setup_data aic3x_setup;
+
 /* evm audio subsystem */
 static struct snd_soc_device evm_snd_devdata = {
 	.card = &snd_soc_card_evm,
 	.codec_dev = &soc_codec_dev_aic3x,
+	.codec_data = &aic3x_setup,
 };
 
 /* evm audio subsystem */
 static struct snd_soc_device dm6467_evm_snd_devdata = {
 	.card = &dm6467_snd_soc_card_evm,
 	.codec_dev = &soc_codec_dev_aic3x,
+	.codec_data = &aic3x_setup,
 };
 
 /* evm audio subsystem */
 static struct snd_soc_device da830_evm_snd_devdata = {
 	.card = &da830_snd_soc_card,
 	.codec_dev = &soc_codec_dev_aic3x,
+	.codec_data = &aic3x_setup,
 };
 
 static struct snd_soc_device da850_evm_snd_devdata = {
 	.card		= &da850_snd_soc_card,
 	.codec_dev	= &soc_codec_dev_aic3x,
+	.codec_data	= &aic3x_setup,
 };
 
 static struct platform_device *evm_snd_device;