All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng-yi Chiang <cychiang@chromium.org>
To: Mark Brown <broonie@kernel.org>
Cc: "Oder Chiou" <oder_chiou@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	SteveS.Lee@maximintegrated.com, George.Song@maximintegrated.com,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	pierre-louis.bossart@linux.intel.com, "M R,
	Sathya Prakash" <sathya.prakash.m.r@intel.com>,
	jinho.ahn@maximintegrated.com,
	"Tzung-Bi Shih" <tzungbi@chromium.org>,
	"Derek [方德義]" <derek.fang@realtek.com>,
	"Shuming [范書銘]" <shumingf@realtek.com>,
	"Dylan Reid" <dgreid@chromium.org>,
	"Flove(HsinFu)" <flove@realtek.com>
Subject: Re: [alsa-devel] [PATCH] ASoC: rt1011: export r0 and temperature config
Date: Tue, 8 Oct 2019 19:22:17 +0800	[thread overview]
Message-ID: <CAFv8Nw+68LkmCmPnq5+rvf3Ffnh1kRROdjrx=nN8tgMTGEq+xQ@mail.gmail.com> (raw)
In-Reply-To: <20191008110643.GD4382@sirena.co.uk>

On Tue, Oct 8, 2019 at 7:06 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Oct 08, 2019 at 06:59:57PM +0800, Cheng-yi Chiang wrote:
>
> > The calibration data (R0 values and temperature) were measured and
> > written to VPD in the factory. When machine driver initializes sound
> > card, it reads the value from VPD and uses the exported API to set
> > calibration value for codec. The purpose is to protect speaker. This
>
> So the VPD is not part of the CODEC?  One question would be why the
> CODEC driver doesn't directly read this information.
+Maxim folks as they are also interested in setting calibration data in driver.

Hi Mark,
The VPD is not part of the codec.
It is a binary blob in system firmware where we can store important
information per-device.
The calibration data is written to RO section of VPD in the factory
during calibration step.
The codec driver is not suitable of reading this information directly
because the string format written into VPD is customized per board.
For example on cml_rt1011_rt5682.c there are four R0 values for four
speakers, and one temperature values . So in this case, there are
totally 5 values in a VPD dsm_calib key. In VPD, the format is like
"dsm_calib"="0x00278F09 0x00251E1B 0x0021AFE6 0x0022720A 0x0000012E"
We put all the information into one string to allow arbitrary
calibration data needed for smart amp calibration in the future.
On other system using smart amp, there might be two speakers, with two
temperature values..etc. The format will be changed accordingly.
Number of temperature values depends on number of temperature sensor
available near the speakers.
Since machine driver knows the combination of speakers and the
available temperature sensor, we think that machine driver is the
better place to put this per-board logic.
Thanks!
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-10-08 11:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  9:33 [alsa-devel] [PATCH] ASoC: rt1011: export r0 and temperature config Shuming [范書銘]
2019-10-08 10:51 ` Mark Brown
2019-10-08 10:59   ` Cheng-yi Chiang
2019-10-08 11:06     ` Mark Brown
2019-10-08 11:22       ` Cheng-yi Chiang [this message]
2019-10-08 12:38         ` Mark Brown
2019-10-14  3:28           ` Cheng-yi Chiang
2019-10-10 14:20 ` Mark Brown
2019-10-14  1:46   ` Shuming [范書銘]
2019-10-14  2:47     ` Jimmy Cheng-Yi Chiang

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='CAFv8Nw+68LkmCmPnq5+rvf3Ffnh1kRROdjrx=nN8tgMTGEq+xQ@mail.gmail.com' \
    --to=cychiang@chromium.org \
    --cc=George.Song@maximintegrated.com \
    --cc=SteveS.Lee@maximintegrated.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=dgreid@chromium.org \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=jinho.ahn@maximintegrated.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sathya.prakash.m.r@intel.com \
    --cc=shumingf@realtek.com \
    --cc=tzungbi@chromium.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 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.