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) {
> 


_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to