Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: broonie@linaro.org
Cc: alsa-devel@alsa-project.org
Subject: Broken alc562x codec in linus/master
Date: Thu, 10 Apr 2014 18:51:44 +0200	[thread overview]
Message-ID: <20140410165144.GI10240@lunn.ch> (raw)

Hi Mark

I found a few issues with the changes you have made to
sound/soc/codecs/alc5623.c which is currently in linus master branch.

The patch causing the trouble seems to be:

commit 0cd257bf9b9b0cbb4fa1a5c988a232506997867c
Author: Mark Brown <broonie@linaro.org>
Date:   Thu Feb 20 09:04:06 2014 +0900

    ASoC: alc5623: Convert to direct regmap API usage
    
    Convert to directly use the regmap API, allowing us to eliminate the last
    user of the ASoC level I/O implementations (there are still open coded
    I/O implementations in drivers), avoiding duplicating code in regmap.
    
    We no longer cache the entire CODEC register map on probe since the more
    advanced cache infrastructure in regmap is able to fill the cache on
    demand.
    
    Signed-off-by: Mark Brown <broonie@linaro.org>

At boot i see:

alc562x-codec 0-001a: unknown or wrong codec
alc562x-codec 0-001a: Expected 10ec:21, got ec10:2103

There are two issues here:

-       vid1 = i2c_smbus_read_word_data(client, ALC5623_VENDOR_ID1);
+       ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID1, &vid1);

It looks like these are returning different endianness. This explains
the 10ec vs ec10.

Can the regmap flip the endianness?

The second is:

-       vid2 = i2c_smbus_read_byte_data(client, ALC5623_VENDOR_ID2);
-       if (vid2 < 0) {
-               dev_err(&client->dev, "failed to read I2C\n");
-               return -EIO;
+       ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2);
+       if (ret < 0) {
+               dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret);
+               return ret;

It was reading a byte, but now it seems to get a word.  Hence 21 vs
2103. Once the endianness is sorted out, we can mask for the lower
byte.

      Thanks
	Andrew

                 reply	other threads:[~2014-04-10 16:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20140410165144.GI10240@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox