All of lore.kernel.org
 help / color / mirror / Atom feed
* [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link
@ 2011-02-24 12:16 Koyamangalath, Abhilash
  0 siblings, 0 replies; 5+ messages in thread
From: Koyamangalath, Abhilash @ 2011-02-24 12:16 UTC (permalink / raw)
  To: alsa-devel-u79uwXL29TY76Z2rM5mHXA, linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Hiremath, Vaibhav

hi
I'm trying to get audio working on the TI AM3517EVM (which uses the tlv320aic23) on the 2.6.37, and I get the following error message while trying to bind:
	CODEC tlv320aic23-codec not registered
This is despite of the having gotten this msg before:
	Registered codec 'tlv320aic23-codec.2-001a'
Digging deeper and putting a printk in soc_bind_dai_link(),I realized that while finding this codec from the registered codecs, the names were not matching:
soc_bind_dai_link:1249:codec->name is tlv320aic23-codec.2-001a, dai_link->codec_name is tlv320aic23-codec

Now, I realized that earlier while calling snd_soc_register_codec() from tlv320aic23_codec_probe(), the dev is passed in as the i2c client device and the name of this device is 2-001a (I2C ID 0x1a on i2c bus 2), this I think is the name generated by the i2c client from the following board-info entry (in arch/arm/mach-omap2/board-am3517evm.c) :
	static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
        {
                I2C_BOARD_INFO("tlv320aic23", 0x1A),
        },

Now, when assigning the name to the codec through fmt_single_name(), the else of the following is getting taken:

	found = strstr(name, dev->driver->name);
	if (found) {
	:
	} else {
	:
		snprintf(tmp, NAME_SIZE, "%s.%s", dev->driver->name, name);
	:

This prepends the driver name (I,e. tlv320aic23-codec) to the device name ( 2-001a) and registers the codec with that name. While, during snd_soc_register_card(),dai_link->codec_name is taken from its init value in sound/soc/omap/am3517evm.c :
	static struct snd_soc_dai_link am3517evm_dai = {
			:
      	  .codec_name = "tlv320aic23-codec",
			:
	};
Now, this whole sequence used to work fine on 2.6.32. So, my question is where/why is this change that automatically assigns the device ID, because of which the else in the "if (found)" tends to be taken and finally there is a name mismatch.

On Omap3 EVM (which uses the TWL4030 codec - sound/soc/codecs/twl4030.c), this works fine as:
	snd_soc_register_codec(&pdev->dev, &soc_codec_dev_twl4030,
                        twl4030_dai, ARRAY_SIZE(twl4030_dai));
Is called instead of 
	snd_soc_register_codec(&i2c->dev,
                        &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1);
as in tlv320aic23 (sound/soc/codecs/tlv320aic23.c).
If I force the names to match (e,g. by appending 2-001a to am3517evm_dai.codec_name) - the card gets registered and I can see the device nodes getting created.

-Abhilash

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link
  2011-03-01  9:52 Koyamangalath, Abhilash
@ 2011-03-01 10:42 ` Jarkko Nikula
  2011-03-01 10:42 ` Jarkko Nikula
  1 sibling, 0 replies; 5+ messages in thread
From: Jarkko Nikula @ 2011-03-01 10:42 UTC (permalink / raw)
  To: Koyamangalath, Abhilash; +Cc: linux-omap, alsa-devel

On Tue, 1 Mar 2011 15:22:29 +0530
"Koyamangalath, Abhilash" <abhilash.kv@ti.com> wrote:

> Now, if I change the dai-link->codec_name to force-match by appending 2-001a to the codec_name in (sound/soc/omap/am3517evm.c):
> 	static struct snd_soc_dai_link am3517evm_dai = {
> 			:
>       	  .codec_name = "tlv320aic23-codec.2-001a ",
> 			:
> 	};
> 
> the registration proceeds smoothly and I can see device nodes getting created. 
> Since now there is no way to provide a customized i2c device name to a client device (or so I believe), what could be the best solution to this problem ?
> 
The fix above. Care to check also osk5912.c?


-- 
Jarkko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link
  2011-03-01  9:52 Koyamangalath, Abhilash
  2011-03-01 10:42 ` Jarkko Nikula
@ 2011-03-01 10:42 ` Jarkko Nikula
  1 sibling, 0 replies; 5+ messages in thread
From: Jarkko Nikula @ 2011-03-01 10:42 UTC (permalink / raw)
  To: alsa-devel; +Cc: linux-omap, alsa-devel

On Tue, 1 Mar 2011 15:22:29 +0530
"Koyamangalath, Abhilash" <abhilash.kv@ti.com> wrote:

> Now, if I change the dai-link->codec_name to force-match by appending 2-001a to the codec_name in (sound/soc/omap/am3517evm.c):
> 	static struct snd_soc_dai_link am3517evm_dai = {
> 			:
>       	  .codec_name = "tlv320aic23-codec.2-001a ",
> 			:
> 	};
> 
> the registration proceeds smoothly and I can see device nodes getting created. 
> Since now there is no way to provide a customized i2c device name to a client device (or so I believe), what could be the best solution to this problem ?
> 
The fix above. Care to check also osk5912.c?


-- 
Jarkko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link
@ 2011-03-01  9:52 Koyamangalath, Abhilash
  2011-03-01 10:42 ` Jarkko Nikula
  2011-03-01 10:42 ` Jarkko Nikula
  0 siblings, 2 replies; 5+ messages in thread
From: Koyamangalath, Abhilash @ 2011-03-01  9:52 UTC (permalink / raw)
  To: linux-omap, alsa-devel

While trying to register the sound card on the AM3517EVM (which uses a tlv320aic23 codec), with the 2.6.37 kernel I get the following error message:
	CODEC tlv320aic23-codec not registered
This is despite having gotten previously:
	Registered codec 'tlv320aic23-codec.2-001a'
I realized that there was a names' mismatch in soc_bind_dai_link():
	In fn soc_bind_dai_link:1249:codec->name is tlv320aic23-codec.2-001a, dai_link->codec_name is tlv320aic23-codec

The 2-001a is the <i2c_bus>-<i2c_address> pair as defined in arch/arm/mach-omap2/board-am3517evm.c:
	static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
       {
               I2C_BOARD_INFO("tlv320aic23", 0x1A),
       },
This is the device name of the i2c client set automatically by i2c_new_device() when __process_new_driver() on the device is called, in response to a i2c_register_driver() request.
Now, all devices with names in <i2c_bus>-<i2c_address> are assumed to be i2c clients by snd_soc_register_codec() and so <driver_name>.<dev_name> is the name supplied to the codec.
Now, if I change the dai-link->codec_name to force-match by appending 2-001a to the codec_name in (sound/soc/omap/am3517evm.c):
	static struct snd_soc_dai_link am3517evm_dai = {
			:
      	  .codec_name = "tlv320aic23-codec.2-001a ",
			:
	};

the registration proceeds smoothly and I can see device nodes getting created. 
Since now there is no way to provide a customized i2c device name to a client device (or so I believe), what could be the best solution to this problem ?

-Abhilash
PS: OMAP3 evm does not have this problem as the audio codec twl4030 is on platform bus, I believe.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link
@ 2011-03-01  9:52 Koyamangalath, Abhilash
  0 siblings, 0 replies; 5+ messages in thread
From: Koyamangalath, Abhilash @ 2011-03-01  9:52 UTC (permalink / raw)
  To: alsa-devel

While trying to register the sound card on the AM3517EVM (which uses a tlv320aic23 codec), with the 2.6.37 kernel I get the following error message:
	CODEC tlv320aic23-codec not registered
This is despite having gotten previously:
	Registered codec 'tlv320aic23-codec.2-001a'
I realized that there was a names' mismatch in soc_bind_dai_link():
	In fn soc_bind_dai_link:1249:codec->name is tlv320aic23-codec.2-001a, dai_link->codec_name is tlv320aic23-codec

The 2-001a is the <i2c_bus>-<i2c_address> pair as defined in arch/arm/mach-omap2/board-am3517evm.c:
	static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
       {
               I2C_BOARD_INFO("tlv320aic23", 0x1A),
       },
This is the device name of the i2c client set automatically by i2c_new_device() when __process_new_driver() on the device is called, in response to a i2c_register_driver() request.
Now, all devices with names in <i2c_bus>-<i2c_address> are assumed to be i2c clients by snd_soc_register_codec() and so <driver_name>.<dev_name> is the name supplied to the codec.
Now, if I change the dai-link->codec_name to force-match by appending 2-001a to the codec_name in (sound/soc/omap/am3517evm.c):
	static struct snd_soc_dai_link am3517evm_dai = {
			:
      	  .codec_name = "tlv320aic23-codec.2-001a ",
			:
	};

the registration proceeds smoothly and I can see device nodes getting created. 
Since now there is no way to provide a customized i2c device name to a client device (or so I believe), what could be the best solution to this problem ?

-Abhilash
PS: OMAP3 evm does not have this problem as the audio codec twl4030 is on platform bus, I believe.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-01 10:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-24 12:16 [TLV320AIC23] [AM3517EVM][AUDIO] codec name mis-match in soc_bind_dai_link Koyamangalath, Abhilash
2011-03-01  9:52 Koyamangalath, Abhilash
2011-03-01  9:52 Koyamangalath, Abhilash
2011-03-01 10:42 ` Jarkko Nikula
2011-03-01 10:42 ` Jarkko Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.