public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Baojun Xu <baojun.xu@ti.com>,
	lgirdwood@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, kevin-lu@ti.com,
	shenghao-ding@ti.com, peeyush@ti.com, navada@ti.com,
	tiwai@suse.de
Subject: Re: [PATCH v3] ASoC: tas2783: Add source files for tas2783 driver.
Date: Mon, 30 Oct 2023 12:40:58 -0500	[thread overview]
Message-ID: <9b94488e-206d-419b-92ed-e70aab11907b@linux.intel.com> (raw)
In-Reply-To: <9d922584-288a-4b73-83ef-477d1bc58521@sirena.org.uk>



On 10/30/23 12:20, Mark Brown wrote:
> On Mon, Oct 30, 2023 at 11:05:39AM -0500, Pierre-Louis Bossart wrote:
> 
>>> +static bool tas2783_readable_register(struct device *dev, unsigned int reg)
>>> +{
>>> +	switch (reg) {
>>> +	case 0x000 ... 0x080:	/* Data port 0. */
> 
>> No, this is wrong. All the data port 'standard' registers are "owned" by
>> the SoundWire core and handled during the port prepare/configure/bank
>> switch routines. Do not use them for regmap.
> 
>> In other words, you *shall* only define vendor-specific registers in
>> this codec driver.
> 
> This seems to come up a moderate amount and is an understandable thing
> to do - could you (or someone else who knows SoundWire) perhaps send a
> patch for the regmap SoundWire integration which does some validation
> here during registration and at least prints a warning?

Good suggestion, we could indeed check that the registers are NOT in the
range [0,0xBF] for all ports - only the range [0xC0..FF] is allowed for
implementation-defined values. I'll try to cook something up.

> Also worth noting that the default is going to be that the registers are
> readable if the driver doesn't configure anything at all so perhaps at
> least for just readability this might be worth revisiting.

Having the interrupt registers as readable could be problematic, there's
a known race condition where the drivers need to do a read after a
write, and I am a bit worried if we have two agents reading the same
thing. It's the only case I am aware of where a read establishes a state.

>>> +static const struct snd_soc_dapm_widget tasdevice_dapm_widgets[] = {
>>> +	SND_SOC_DAPM_AIF_IN("ASI", "ASI Playback", 0, SND_SOC_NOPM, 0, 0),
>>> +	SND_SOC_DAPM_AIF_OUT("ASI OUT", "ASI Capture", 0, SND_SOC_NOPM,
>>> +		0, 0),
>>> +	SND_SOC_DAPM_SPK("SPK", NULL),
>>> +	SND_SOC_DAPM_OUTPUT("OUT"),
>>> +	SND_SOC_DAPM_INPUT("DMIC")
>>> +};
> 
>> Can you clarify what "ASI" is?
> 
> ASI seems to be a fairly commonly used name in TI devices...  In general
> naming that corresponds to the datasheet should be fine, especially for
> internal only things like this sort of DAPM widget.  I'd guess it's
> something like Audio Serial Interface but not actually gone and looked.

I was only asking was the acronym stood for to make it easier to
look-up. Not asking for any technical details.

  reply	other threads:[~2023-10-30 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  9:24 [PATCH v3] ASoC: tas2783: Add source files for tas2783 driver Baojun Xu
2023-10-28 14:40 ` Christophe JAILLET
2023-10-28 20:56 ` kernel test robot
2023-10-30 16:05 ` Pierre-Louis Bossart
2023-10-30 17:20   ` Mark Brown
2023-10-30 17:40     ` Pierre-Louis Bossart [this message]
2023-10-30 21:05       ` Pierre-Louis Bossart
2023-10-31 13:25         ` Mark Brown
2023-10-31 11:08 ` kernel test robot

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=9b94488e-206d-419b-92ed-e70aab11907b@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navada@ti.com \
    --cc=peeyush@ti.com \
    --cc=perex@perex.cz \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.de \
    /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