All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
	Mark Brown <broonie@kernel.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH] ASoC: wm8962: Do not access WM8962_GPIO_BASE
Date: Mon, 3 Aug 2020 10:07:06 +0800	[thread overview]
Message-ID: <CAA+D8AM8EKowXs_0nyNKMa0odyEAF=Sgu8y2n48pGFnEbE0Mpg@mail.gmail.com> (raw)
In-Reply-To: <20200717135959.19212-1-festevam@gmail.com>

Hi Fabio, Mark

On Fri, Jul 17, 2020 at 10:02 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> According to the WM8962 datasheet, there is no register at address 0x200.
>
> WM8962_GPIO_BASE is just a base address for the GPIO registers and not a
> real register, so remove it from wm8962_readable_register().
>
> Also, Register 515 (WM8962_GPIO_BASE + 3) does not exist, so skip
> its access.
>
> This fixes the following errors:
>
> wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16
> wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> Hi,
>
> There is still one more soc_component_read_no_lock error left on register 48.
>
> I can get rid of it with the below change:
>
> --- a/sound/soc/codecs/wm8962.c
> +++ b/sound/soc/codecs/wm8962.c
> @@ -151,6 +151,7 @@ static const struct reg_default wm8962_reg[] = {
>         { 40, 0x0000 },   /* R40    - SPKOUTL volume */
>         { 41, 0x0000 },   /* R41    - SPKOUTR volume */
>
> +       { 48, 0x0000 },   /* R48    - Additional control(4) */
>         { 49, 0x0010 },   /* R49    - Class D Control 1 */
>         { 51, 0x0003 },   /* R51    - Class D Control 2 */
>
> @@ -841,7 +842,6 @@ static bool wm8962_readable_register(struct device *dev, unsigned int reg)
>         case WM8962_SPKOUTL_VOLUME:
>         case WM8962_SPKOUTR_VOLUME:
>         case WM8962_THERMAL_SHUTDOWN_STATUS:
> -       case WM8962_ADDITIONAL_CONTROL_4:

WM8962_ADDITIONAL_CONTROL_4 should not be removed
from the readable registers,  after this change, there is distortion
on output sound. but this patch has been merged.

"[PATCH RESEND] ASoC: wm8962: Do not access WM8962_GPIO_BASE"
that patch is correct.

best regards
wang shengjiu

wang shengjiu


>         case WM8962_CLASS_D_CONTROL_1:
>         case WM8962_CLASS_D_CONTROL_2:
>         case WM8962_CLOCKING_4:
>
> I haven't submitted it yet because I don't know if this is the correct
> approach.
>
> Please advise.
>
> Thanks
>
>  sound/soc/codecs/wm8962.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
> index df8cdc71357d..8159a3866cde 100644
> --- a/sound/soc/codecs/wm8962.c
> +++ b/sound/soc/codecs/wm8962.c
> @@ -956,7 +956,6 @@ static bool wm8962_readable_register(struct device *dev, unsigned int reg)
>         case WM8962_EQ39:
>         case WM8962_EQ40:
>         case WM8962_EQ41:
> -       case WM8962_GPIO_BASE:
>         case WM8962_GPIO_2:
>         case WM8962_GPIO_3:
>         case WM8962_GPIO_5:
> @@ -3437,7 +3436,13 @@ static int wm8962_probe(struct snd_soc_component *component)
>         /* Save boards having to disable DMIC when not in use */
>         dmicclk = false;
>         dmicdat = false;
> -       for (i = 0; i < WM8962_MAX_GPIO; i++) {
> +       for (i = 1; i < WM8962_MAX_GPIO; i++) {
> +               /*
> +                * Register 515 (WM8962_GPIO_BASE + 3) does not exist,
> +                * so skip its access
> +                */
> +               if (i == 3)
> +                       continue;
>                 switch (snd_soc_component_read(component, WM8962_GPIO_BASE + i)
>                         & WM8962_GP2_FN_MASK) {
>                 case WM8962_GPIO_FN_DMICCLK:
> --
> 2.17.1
>

  parent reply	other threads:[~2020-08-03  2:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 13:59 [PATCH] ASoC: wm8962: Do not access WM8962_GPIO_BASE Fabio Estevam
2020-07-23  9:11 ` Charles Keepax
2020-07-23  9:21 ` Charles Keepax
2020-07-23 19:59   ` Fabio Estevam
2020-07-27 13:27     ` Charles Keepax
2020-07-27 13:57       ` Fabio Estevam
2020-07-30 22:27 ` Mark Brown
2020-08-03  2:07 ` Shengjiu Wang [this message]
2020-08-03 10:51   ` Mark Brown
2020-08-03 11:58     ` Fabio Estevam

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='CAA+D8AM8EKowXs_0nyNKMa0odyEAF=Sgu8y2n48pGFnEbE0Mpg@mail.gmail.com' \
    --to=shengjiu.wang@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=festevam@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=shengjiu.wang@nxp.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.