From: Lars-Peter Clausen <lars@metafoo.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: Shawn Guo <shawn.guo@linaro.org>,
alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>,
Troy Kisky <troy.kisky@boundarydevices.com>
Subject: Re: Codec driver gets probed prior to the machine driver
Date: Sun, 09 Jun 2013 17:12:57 +0200 [thread overview]
Message-ID: <51B49B79.2040007@metafoo.de> (raw)
In-Reply-To: <CAOMZO5BzaAmt0BNXvSw+a18QorOBmEjGwaA5PoQ_D6mVb6QiUw@mail.gmail.com>
On 06/09/2013 04:50 PM, Fabio Estevam wrote:
> Hi,
>
> When running linux-next 20130607 on a mx6qsabrelite I see that the audio
> drivers fail to probe. Added some printk's to better illustrate the
> problem:
>
> mmcblk0: mmc0:b5a1 SD04G 3.69 GiB **** reading the chip ID sgtl5000: probe
> of 0-000a failed with error -5 ****** enabling the codec clock
> imx-sgtl5000 sound.13: ASoC: CODEC (null) not registered imx-sgtl5000
> sound.13: snd_soc_register_card failed (-517) platform sound.13: Driver
> imx-sgtl5000 requests probe defer
>
> The problem here is that the codec driver (sgtl5000) is being probed prior
> to the machine driver (imx-sgtl5000).
>
> The reading of the chip ID fails because at this point in time there is no
> codec clock, which is turned on by imx-sgtl5000.
This sounds as if the CODEC driver should enable the CODEC clock and not the
machine driver.
>
> Running 3.10-rc4, the order of the events is as expected: imx-sgtl5000 is
> called first and sgtl5000 is called later. In this case the probe works as
> usual.
There are two probe functions one for the i2c driver, one for the codec. The
I2C driver probe will be called as soon as the I2C device gets registered.
The codec probe will be called once all components for the ASoC sound card
(CPU DAI, codec, platform) are ready. Since you are checking the ID in the
I2C probe callback there is no guarantee that it will be called before or
after the machine driver will be probed.
>
> Tried doing a bisect, but this was not succesful due to several bisect
> breakages (build issues and non-booting kernels) on its way.
>
Well, your commit b871f1ad ("ASoC: sgtl5000: Read SGTL5000_CHIP_ID in
i2c_probe") moved things around. From one probe callback to the other.
- Lars
next prev parent reply other threads:[~2013-06-09 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-09 14:50 Codec driver gets probed prior to the machine driver Fabio Estevam
2013-06-09 15:12 ` Lars-Peter Clausen [this message]
2013-06-09 15:41 ` Fabio Estevam
2013-06-10 9:14 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B49B79.2040007@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=shawn.guo@linaro.org \
--cc=troy.kisky@boundarydevices.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.