public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: "Ding, Shenghao" <shenghao-ding@ti.com>
To: Terry Sanders <linux@vertone.co.uk>,
	"Kasargod, Sandeep" <sandeepk@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Xu, Baojun" <baojun.xu@ti.com>, "Lu, Kevin" <kevin-lu@ti.com>
Subject: RE: [EXTERNAL] Bug in tlv320adc3101 driver
Date: Wed, 31 Jul 2024 07:48:19 +0000	[thread overview]
Message-ID: <4ac767ce1c6e4ea9b803d6007acb2988@ti.com> (raw)
In-Reply-To: <5652371.ZASKD2KPVS@jupiter>

Let me loop @Kasargod, Sandeep<mailto:sandeepk@ti.com>
Hi Sandeep
Kindly support a request for Linux.

BR
Shenghao Ding
From: Terry Sanders <linux@vertone.co.uk>
Sent: Wednesday, July 31, 2024 3:45 PM
To: Ding, Shenghao <shenghao-ding@ti.com>; Lu, Kevin <kevin-lu@ti.com>; Xu, Baojun <baojun.xu@ti.com>
Cc: alsa-devel@alsa-project.org
Subject: [EXTERNAL] Bug in tlv320adc3101 driver

Hi, There is a bug in the code for the tlv320adc3101 driver when setting up the D value for PLL. The D value is set via I2C using page 0 registers 7 (MSB) and 8 (LSB). The data sheet has the following information for the registers: "Page 0 /
ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.

Do not click links or open attachments unless you recognize the source of this email and know the content is safe. If you wish to report this message to IT Security, please forward the message as an attachment to phishing@list.ti.com<mailto:phishing@list.ti.com>



ZjQcmQRYFpfptBannerEnd

Hi,



There is a bug in the code for the tlv320adc3101 driver when setting up the D value for PLL.



The D value is set via I2C using page 0 registers 7 (MSB) and 8 (LSB).  The data sheet has the following information for the registers:



     "Page 0 / Register 7 will be updated when Page 0 / Register 8 is written immediately after Page 0 / Register 7 is written"



and:



   "Page 0 / Register 8 must be written immediately after writing to Page 0 / Register 7"



The function that implements this is adc3xxx_setup_pll() in file    soc/codecs/tlv320adc3xxx.c line 1172 - 1189. The function is shown below:



static void adc3xxx_setup_pll(struct snd_soc_component *component,

                                                  int div_entry)

{

              int i = div_entry;



              /* P & R values */

              snd_soc_component_write(component, ADC3XXX_PLL_PROG_PR,

                                                           (adc3xxx_divs[i].pll_p << ADC3XXX_PLLP_SHIFT) |

                                                           (adc3xxx_divs[i].pll_r << ADC3XXX_PLLR_SHIFT));

              /* J value */

              snd_soc_component_write(component, ADC3XXX_PLL_PROG_J,

                                                           adc3xxx_divs[i].pll_j & ADC3XXX_PLLJ_MASK);

              /* D value */

              snd_soc_component_write(component, ADC3XXX_PLL_PROG_D_LSB,

                                                           adc3xxx_divs[i].pll_d & ADC3XXX_PLLD_LSB_MASK);

              snd_soc_component_write(component, ADC3XXX_PLL_PROG_D_MSB,

                                                           (adc3xxx_divs[i].pll_d >> 8) & ADC3XXX_PLLD_MSB_MASK);

}



In the function the LSB (register 8) is written first followed by the MSB (register 7). This is the wrong way around and should be swapped so that the MSB is written first.



Regards



Terry Sanders











      reply	other threads:[~2024-07-31  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  7:44 Bug in tlv320adc3101 driver Terry Sanders
2024-07-31  7:48 ` Ding, Shenghao [this message]

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=4ac767ce1c6e4ea9b803d6007acb2988@ti.com \
    --to=shenghao-ding@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=baojun.xu@ti.com \
    --cc=kevin-lu@ti.com \
    --cc=linux@vertone.co.uk \
    --cc=sandeepk@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox