public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Mark Brown <broonie@kernel.org>, Niranjan H Y <niranjan.hy@ti.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	ckeepax@opensource.cirrus.com, lgirdwood@gmail.com,
	perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com,
	peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	baojun.xu@ti.com, shenghao-ding@ti.com, sandeepk@ti.com,
	v-hampiholi@ti.com
Subject: Re: [PATCH v15 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver
Date: Mon, 4 May 2026 19:41:12 +0200	[thread overview]
Message-ID: <71f22f63-c772-42c5-86e2-2703be7fb056@linux.dev> (raw)
In-Reply-To: <afikt0VzLDHrTjvM@sirena.co.uk>

On 5/4/26 15:52, Mark Brown wrote:
> On Mon, May 04, 2026 at 06:27:14PM +0530, Niranjan H Y wrote:
>> Add codec driver for tac5xx2 family of devices.
> 
>> +static s32 tac5xx2_sdca_dev_resume(struct device *dev)
>> +{
>> +	struct tac5xx2_prv *tac_dev = dev_get_drvdata(dev);
>> +	struct sdw_slave *slave = dev_to_sdw_dev(dev);
>> +	unsigned long t;
>> +	int ret;
> 
>> +
>> +	/* Detect and set jack type for UAJ path before playback.
>> +	 * This is required as jack detection does not trigger interrupt
>> +	 * when device is in runtime_pm suspend with bus in clock stop mode.
>> +	 */
>> +	if (tac_has_uaj_support(tac_dev))
>> +		tac5xx2_sdca_headset_detect(tac_dev);
>> +
>> +regmap_sync:
>> +	regcache_cache_only(tac_dev->regmap, false);
>> +	regcache_mark_dirty(tac_dev->regmap);
>> +	ret = regcache_sync(tac_dev->regmap);
>> +	if (ret < 0)
>> +		dev_warn(dev, "Failed to sync regcache: %d\n", ret);
> 
> We do the jack detect before we reinitialise the registers, meaning the
> device is still in cache only mode and volatile reads will all return
> -EBUSY.

Indeed, and there's also another set of initializations that won't happen in the io_init.

It's a bit complicated because we have to deal with device attachment and suspend-resume, and the two parts aren't necessarily equivalent.
- when resuming the bus the codec will also be resumed
- but the device can go to runtime_pm suspend while still attached on the bus (e.g. if another device is active on the same bus).

Other drivers have regcache_cache_only(tac_dev->regmap, false); in the two paths (io_init and resume) to make sure both cases are handled.

  reply	other threads:[~2026-05-04 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 12:57 [PATCH v15 0/4] ASoC: Add TI TAC5XX2 SoundWire codec driver support Niranjan H Y
2026-05-04 12:57 ` [PATCH v15 1/4] ASoC: SDCA: Add PDE verification reusable helper Niranjan H Y
2026-05-04 17:07   ` Pierre-Louis Bossart
2026-05-04 12:57 ` [PATCH v15 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver Niranjan H Y
2026-05-04 13:52   ` Mark Brown
2026-05-04 17:41     ` Pierre-Louis Bossart [this message]
2026-05-04 17:07   ` Pierre-Louis Bossart
2026-05-04 12:57 ` [PATCH v15 3/4] ASoC: sdw_utils: TI amp utility for tac5xx2 family Niranjan H Y
2026-05-04 13:49   ` Mark Brown
2026-05-04 12:57 ` [PATCH v15 4/4] ASoC: tac5xx2-sdw: ACPI match for intel mtl platform Niranjan H Y

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=71f22f63-c772-42c5-86e2-2703be7fb056@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=niranjan.hy@ti.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sandeepk@ti.com \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.com \
    --cc=v-hampiholi@ti.com \
    --cc=yung-chuan.liao@linux.intel.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