Re: [alsa-devel] [PATCH] ASoC: rt5677: Reintroduce I2C device IDs

From: Andy Shevchenko
Date: Thu Aug 24 2017 - 13:16:23 EST


On Thu, 2017-08-24 at 18:06 +0200, Takashi Iwai wrote:
> On Thu, 24 Aug 2017 17:54:37 +0200,
> Tom Rini wrote:
> >
> > On Thu, Aug 24, 2017 at 04:52:35PM +0100, Mark Brown wrote:
> > > On Thu, Aug 24, 2017 at 05:42:11PM +0200, Takashi Iwai wrote:
> > >
> > > > OK, so the fix for 4.13 would be either to cherry-pick this
> > > > commit, or
> > > > just to re-add "RT5677CE:00" to i2c_id temporarily as a quick
> > > > band-aid
> > > > fix (and remove again in 4.14).
> > > > The former is cleaner, but it's bigger, while the latter is a
> > > > safer
> > > > oneliner at the late RC stage.
> > > > I leave the decision to Mark.
> > >
> > > I'm happier with the oneline change TBH, like you say it's pretty
> > > late
> > > in the release cycle.ÂÂCan you just apply the patch directly and
> > > send it
> > > to Linus with my ack or should I put together a pull request?
> >
> > FWIW, I'd be happy to give the change a quick spin and Tested-by it.
>
> Well, it's your patch, after all :)
> Below is the patch I'm going to queue.
>
>
> Takashi
>
> -- 8< --
> From: Tom Rini <trini@xxxxxxxxxxxx>
> Subject: [PATCH] ASoC: rt5677: Reintroduce I2C device IDs
>
> Not all devices with ACPI and this combination of sound devices will
> have the required information provided via ACPI.ÂÂReintroduce the I2C
> device ID to restore sound functionality on on the Chromebook 'Samus'
> model.
>
> [ More background note:
> Âthe commit a36afb0ab648 ("ASoC: rt5677: Introduce proper table...")
> Âmoved the i2c ID probed via ACPI ("RT5677CE:00") to a proper
> Âacpi_device_id table.ÂÂAlthough the action itself is correct per se,
> Âthe overseen issue is the reference id->driver_data at
> Ârt5677_i2c_probe() for retrieving the corresponding chip model for
> Âthe given id.ÂÂSince id=NULL is passed for ACPI matching case, we get
> Âan Oops now.
>
> ÂWe already have queued more fixes for 4.14 and they already address
> Âthe issue, but they are bigger changes that aren't preferable for the
> Âlate 4.13-rc stage.ÂÂSo, this patch just papers over the bug as a
> Âonce-off quick fix for a particular ACPI matching.ÂÂ-- tiwai ]
>
> Fixes: a36afb0ab648 ("ASoC: rt5677: Introduce proper table for ACPI
> enumeration")
> Signed-off-by: Tom Rini <trini@xxxxxxxxxxxx>
> Acked-by: Mark Brown <broonie@xxxxxxxxxx>
> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>

Thanks for this and sorry for bisectability issue. I didn't noticed it
before Takashi got my attention to the bug report.

I'm fine with this quick fix for v4.13 only.

> ---
> Âsound/soc/codecs/rt5677.c | 1 +
> Â1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
> index 36e530a36c82..6f629278d982 100644
> --- a/sound/soc/codecs/rt5677.c
> +++ b/sound/soc/codecs/rt5677.c
> @@ -5021,6 +5021,7 @@ static const struct regmap_config rt5677_regmap
> = {
> Âstatic const struct i2c_device_id rt5677_i2c_id[] = {
> Â { "rt5677", RT5677 },
> Â { "rt5676", RT5676 },
> + { "RT5677CE:00", RT5677 },
> Â { }
> Â};
> ÂMODULE_DEVICE_TABLE(i2c, rt5677_i2c_id);

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy