From: "Ding, Shenghao" <shenghao-ding@ti.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"perex@perex.cz" <perex@perex.cz>,
"pierre-louis.bossart@linux.intel.com"
<pierre-louis.bossart@linux.intel.com>,
"13916275206@139.com" <13916275206@139.com>,
"zhourui@huaqin.com" <zhourui@huaqin.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"Salazar, Ivan" <i-salazar@ti.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Chadha, Jasjot Singh" <j-chadha@ti.com>,
"liam.r.girdwood@intel.com" <liam.r.girdwood@intel.com>,
"Yue, Jaden" <jaden-yue@ti.com>,
"yung-chuan.liao@linux.intel.com"
<yung-chuan.liao@linux.intel.com>, "Rao, Dipa" <dipa@ti.com>,
"yuhsuan@google.com" <yuhsuan@google.com>,
"Lo, Henry" <henry.lo@ti.com>, "tiwai@suse.de" <tiwai@suse.de>,
"Xu, Baojun" <baojun.xu@ti.com>, "soyer@irl.hu" <soyer@irl.hu>,
"Baojun.Xu@fpt.com" <Baojun.Xu@fpt.com>,
"judyhsiao@google.com" <judyhsiao@google.com>,
"Navada Kanyana, Mukund" <navada@ti.com>,
"cujomalainey@google.com" <cujomalainey@google.com>,
"Kutty, Aanya" <aanya@ti.com>,
"Mahmud, Nayeem" <nayeem.mahmud@ti.com>,
"savyasanchi.shukla@netradyne.com"
<savyasanchi.shukla@netradyne.com>,
"flaviopr@microsoft.com" <flaviopr@microsoft.com>,
"Ji, Jesse" <jesse-ji@ti.com>,
"darren.ye@mediatek.com" <darren.ye@mediatek.com>
Subject: RE: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add new Kontrol to set tas2563 digital gain
Date: Sun, 11 Aug 2024 09:22:43 +0000 [thread overview]
Message-ID: <47d160554aa64aeb952fde980e3d4d0d@ti.com> (raw)
In-Reply-To: <ZrYzGWQRdsTlYxQg@smile.fi.intel.com>
Hi Andy
Answer inline
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Friday, August 9, 2024 11:18 PM
> To: Ding, Shenghao <shenghao-ding@ti.com>
> Cc: broonie@kernel.org; lgirdwood@gmail.com; perex@perex.cz; pierre-
> louis.bossart@linux.intel.com; 13916275206@139.com; zhourui@huaqin.com;
> alsa-devel@alsa-project.org; Salazar, Ivan <i-salazar@ti.com>; linux-
> kernel@vger.kernel.org; Chadha, Jasjot Singh <j-chadha@ti.com>;
> liam.r.girdwood@intel.com; Yue, Jaden <jaden-yue@ti.com>; yung-
> chuan.liao@linux.intel.com; Rao, Dipa <dipa@ti.com>; yuhsuan@google.com;
> Lo, Henry <henry.lo@ti.com>; tiwai@suse.de; Xu, Baojun <baojun.xu@ti.com>;
> soyer@irl.hu; Baojun.Xu@fpt.com; judyhsiao@google.com; Navada Kanyana,
> Mukund <navada@ti.com>; cujomalainey@google.com; Kutty, Aanya
> <aanya@ti.com>; Mahmud, Nayeem <nayeem.mahmud@ti.com>;
> savyasanchi.shukla@netradyne.com; flaviopr@microsoft.com; Ji, Jesse <jesse-
> ji@ti.com>; darren.ye@mediatek.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
>
prev parent reply other threads:[~2024-08-11 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 4:18 [PATCH v1] ASoc: tas2781: Add new Kontrol to set tas2563 digital gain Shenghao Ding
2024-06-28 12:27 ` Mark Brown
2024-08-09 15:17 ` Andy Shevchenko
2024-08-11 9:22 ` 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=47d160554aa64aeb952fde980e3d4d0d@ti.com \
--to=shenghao-ding@ti.com \
--cc=13916275206@139.com \
--cc=Baojun.Xu@fpt.com \
--cc=aanya@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=cujomalainey@google.com \
--cc=darren.ye@mediatek.com \
--cc=dipa@ti.com \
--cc=flaviopr@microsoft.com \
--cc=henry.lo@ti.com \
--cc=i-salazar@ti.com \
--cc=j-chadha@ti.com \
--cc=jaden-yue@ti.com \
--cc=jesse-ji@ti.com \
--cc=judyhsiao@google.com \
--cc=lgirdwood@gmail.com \
--cc=liam.r.girdwood@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=navada@ti.com \
--cc=nayeem.mahmud@ti.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=savyasanchi.shukla@netradyne.com \
--cc=soyer@irl.hu \
--cc=tiwai@suse.de \
--cc=yuhsuan@google.com \
--cc=yung-chuan.liao@linux.intel.com \
--cc=zhourui@huaqin.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