alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Erik Friesen <friesendrywall@gmail.com>
To: alsa-devel@alsa-project.org
Subject: SGTL5000 startup error on reboot
Date: Mon, 8 Feb 2016 07:53:20 -0500	[thread overview]
Message-ID: <CAEuupit7TCsr56MUOC4iyL+cP+TLFSOpjCZPrq1cTY4foX5Ykw@mail.gmail.com> (raw)

I find that the codec is getting a write failure at sgtl5000_fill_defaults at

{ SGTL5000_CHIP_ANA_POWER, 0x7060 },

about half the time following a software reboot, and with external
vddd powered with 1.8v.  Reading this register shows that it is
already at 0x7060, so I am not sure what is up with that, but I would
suspect a hardware bug in the codec.

Using this code has fixed this so far.

static int sgtl5000_fill_defaults(struct sgtl5000_priv *sgtl5000)
{
 int i, ret, val, index;
 int reg;
 for (i = 0; i < ARRAY_SIZE(sgtl5000_reg_defaults); i++) {
  val = sgtl5000_reg_defaults[i].def;
  index = sgtl5000_reg_defaults[i].reg;
  ret = regmap_read(sgtl5000->regmap, index, &reg);
  if (ret) {
   printk(KERN_WARNING "SGTL5000 probe read failed at %i\n", i);
  return ret;
  }
  if (reg != val) {
   ret = regmap_write(sgtl5000->regmap, index, val);
  }
  if (ret) {
   printk(KERN_WARNING "SGTL5000 probe write failed %x at %i index %i
@ %x\n", val, i, index,  reg);
   return ret;
  }
 }
 return 0;
}

             reply	other threads:[~2016-02-08 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 12:53 Erik Friesen [this message]
2016-02-15 14:58 ` SGTL5000 startup error on reboot Erik Friesen

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=CAEuupit7TCsr56MUOC4iyL+cP+TLFSOpjCZPrq1cTY4foX5Ykw@mail.gmail.com \
    --to=friesendrywall@gmail.com \
    --cc=alsa-devel@alsa-project.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;
as well as URLs for NNTP newsgroup(s).