[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47d160554aa64aeb952fde980e3d4d0d@ti.com>
Date: Sun, 11 Aug 2024 09:22:43 +0000
From: "Ding, Shenghao" <shenghao-ding@...com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: "broonie@...nel.org" <broonie@...nel.org>,
"lgirdwood@...il.com"
<lgirdwood@...il.com>,
"perex@...ex.cz" <perex@...ex.cz>,
"pierre-louis.bossart@...ux.intel.com"
<pierre-louis.bossart@...ux.intel.com>,
"13916275206@....com"
<13916275206@....com>,
"zhourui@...qin.com" <zhourui@...qin.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"Salazar, Ivan"
<i-salazar@...com>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"Chadha, Jasjot Singh" <j-chadha@...com>,
"liam.r.girdwood@...el.com" <liam.r.girdwood@...el.com>,
"Yue, Jaden"
<jaden-yue@...com>,
"yung-chuan.liao@...ux.intel.com"
<yung-chuan.liao@...ux.intel.com>,
"Rao, Dipa" <dipa@...com>, "yuhsuan@...gle.com" <yuhsuan@...gle.com>,
"Lo, Henry" <henry.lo@...com>, "tiwai@...e.de" <tiwai@...e.de>,
"Xu, Baojun" <baojun.xu@...com>, "soyer@....hu" <soyer@....hu>,
"Baojun.Xu@....com" <Baojun.Xu@....com>,
"judyhsiao@...gle.com" <judyhsiao@...gle.com>,
"Navada Kanyana, Mukund"
<navada@...com>,
"cujomalainey@...gle.com" <cujomalainey@...gle.com>,
"Kutty,
Aanya" <aanya@...com>,
"Mahmud, Nayeem" <nayeem.mahmud@...com>,
"savyasanchi.shukla@...radyne.com" <savyasanchi.shukla@...radyne.com>,
"flaviopr@...rosoft.com" <flaviopr@...rosoft.com>,
"Ji, Jesse"
<jesse-ji@...com>,
"darren.ye@...iatek.com" <darren.ye@...iatek.com>
Subject: RE: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add new Kontrol to set
tas2563 digital gain
Hi Andy
Answer inline
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Sent: Friday, August 9, 2024 11:18 PM
> To: Ding, Shenghao <shenghao-ding@...com>
> Cc: broonie@...nel.org; lgirdwood@...il.com; perex@...ex.cz; pierre-
> louis.bossart@...ux.intel.com; 13916275206@....com; zhourui@...qin.com;
> alsa-devel@...a-project.org; Salazar, Ivan <i-salazar@...com>; linux-
> kernel@...r.kernel.org; Chadha, Jasjot Singh <j-chadha@...com>;
> liam.r.girdwood@...el.com; Yue, Jaden <jaden-yue@...com>; yung-
> chuan.liao@...ux.intel.com; Rao, Dipa <dipa@...com>; yuhsuan@...gle.com;
> Lo, Henry <henry.lo@...com>; tiwai@...e.de; Xu, Baojun <baojun.xu@...com>;
> soyer@....hu; Baojun.Xu@....com; judyhsiao@...gle.com; Navada Kanyana,
> Mukund <navada@...com>; cujomalainey@...gle.com; Kutty, Aanya
> <aanya@...com>; Mahmud, Nayeem <nayeem.mahmud@...com>;
> savyasanchi.shukla@...radyne.com; flaviopr@...rosoft.com; Ji, Jesse <jesse-
> ji@...com>; darren.ye@...iatek.com
> Subject: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add new Kontrol to set
> tas2563 digital gain
>
> On Fri, Jun 28, 2024 at 12: 18: 43PM +0800, Shenghao Ding wrote: >
> Requriment from customer to add new kcontrol to set tas2563 digital gain >
> and set "Speaker Force Firmware Load" as the common kcontrol for both >
> tas27871 and tas2563. 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.
> <https://us-phishalarm-
> ewt.proofpoint.com/EWT/v1/G3vK!uBdnVVqmOIH3BkzsUFgO9QgWJ-
> u9qFEVKhhfo2Ubp9J6d6r4srvhwGiHZoYkKiQ5od83XAJWq9sCybuN7u4$>
> Report Suspicious
>
> ZjQcmQRYFpfptBannerEnd
> On Fri, Jun 28, 2024 at 12:18:43PM +0800, Shenghao Ding wrote:
> > Requriment from customer to add new kcontrol to set tas2563 digital
> > gain and set "Speaker Force Firmware Load" as the common kcontrol for
> > both
> > tas27871 and tas2563.
>
> ...
>
> > #include <sound/tas2781.h>
> > #include <sound/tlv.h>
> > #include <sound/tas2781-tlv.h>
>
> > +#include <asm/unaligned.h>
>
> Before sound would be better, but I'm not insisting.
[ding]Apply to the new patch.
>
> ...
>
> > + ret = tasdevice_dev_bulk_read(tas_dev, 0, reg, data, 4);
>
> Too many spaces.
>
> ...
>
> > + /* find out the member same as or closer to the current volume */
> > + ucontrol->value.integer.value[0] =
> > + abs(target - ar_l) <= abs(target - ar_r) ? l : r;
>
> Why do you need to have target to be applied here? IIUC arithmetics correctly
> it makes no value to use target in this equation.
[ding] target save the vol register value, and the code will calculate the closest value in the
tas2563_dvc_table. Sometimes, the target value is not same as the value in the table. It is
wise to find the closest one.
/* pow(10, db/20) * pow(2,30) */
static const unsigned char tas2563_dvc_table[][4] = {
{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
...
>
> ...
>
> > +out:
> > + mutex_unlock(&tas_dev->codec_lock);
>
> Why not using cleanup.h?
[ding] Accept.
>
> > + return 0;
>
> ...
>
> This all reminds me that I already gave same/similar comments in the past...
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
Powered by blists - more mailing lists