public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: broonie@kernel.org, vkoul@kernel.org,
	yung-chuan.liao@linux.intel.com, peter.ujfalusi@linux.intel.com,
	shumingf@realtek.com, lgirdwood@gmail.com,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH 4/4] ASoC: SDCA: Add basic SDCA function driver
Date: Thu, 30 Oct 2025 15:44:23 +0000	[thread overview]
Message-ID: <aQOH10Sb802aeRsF@opensource.cirrus.com> (raw)
In-Reply-To: <8e547635-1ea4-48b8-8e44-7c0e5d2f6092@linux.dev>

On Mon, Oct 27, 2025 at 04:24:05PM +0100, Pierre-Louis Bossart wrote:
> > +	snd_sdw_params_to_config(substream, params, &sconfig, &pconfig);
> > +
> > +	ret = sdca_asoc_get_port(drv->dev, drv->regmap, drv->function, dai);
> > +	if (ret < 0)
> > +		return ret;
> > +
> > +	pconfig.num = ret;
> 
> You should probably document the assumption that each function
> has access to separate ports.
> 
> IIRC there could be cases where ports are *shared* between
> functions due to hardware restrictions. I remember telling the
> SDCA committee that either functions were independent or they were
> not, and the answer is that they are independent except when they
> aren't. It's probably ok to assume a simple case first to make
> progress, but with a clear documentation of the known limits.
> 
> Oh and for some functions multiple ports are required to make use
> of different lanes, e.g. for the digital links in the NDAI functions.

Yeah I will add a comment to clarify we are currently only
supporting a single port, although it does somewhat duplicate the
FIXME already in sdca_asoc_get_port for that.

But overal I think these are definitely bridges we should cross
when we get there. It is more important to get something that
functions rather than it supporting every single feature in the
first iteration (especially given how close we now our to laptops
shipping with parts we were hoping to support through this class
driver).

> > +	pm_runtime_set_autosuspend_delay(dev, 200);
> 
> why 200?

That is a totally made up figure specially selected to be
slightly shorted that the totally made up figure I picked for the
primary driver. Happy to take feedback on these lengths or add a
comment to say they are arbitary although these tend to be
arbitary on all drivers so I didn't feel the need to add the
comment.

> > +	ret = devm_snd_soc_register_component(dev, cmp_drv, dais, num_dais);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "failed to register component\n");
> > +
> > +	dev_err(dev, "%s: %pfwP: probe completed\n", __func__, auxdev->dev.fwnode);
> 
> why is this an error? the error case is handled earlier.

Yeah that is just debug that hasn't been nuked yet the whole
print should be deleted.

> > +static int class_function_codec_runtime_suspend(struct device *dev)
> > +{
> > +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> > +	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
> > +
> > +	/*
> > +	 * Whilst the driver doesn't power the chip down here, going into
> > +	 * runtime suspend lets the SoundWire bus power down, which means
> > +	 * the driver can't communicate with the device any more.
> > +	 */
> 
> actually this is not completely correct. The function driver can
> communicate IF the parent is active. This is copy-paste from the
> device level but it's not how the hardware works.

I mean it does say "lets the SoundWire bus power down" not forces
the bus to power down. But I will try to reword to make it more
clear this is covering the fact the bus might power down rather
than will power down.

> > +	regcache_cache_only(drv->regmap, true);
> 
> I would also add a comment that all the power management for
> PE/GEs is handled by DAPM when streams become active/suspended. So
> there isn't a need to deal with PE/GEs at this level.

Can do.

> > +static int class_function_codec_runtime_resume(struct device *dev)
> > +{
> > +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> > +	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
> > +	int ret;
> > +
> > +	regcache_cache_only(drv->regmap, false);
> > +
> > +	regcache_mark_dirty(drv->regmap);
> 
> does the order matter?

I don't believe it does, happy to reverse them.

Thanks,
Charles

      reply	other threads:[~2025-10-30 15:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 13:33 [PATCH 0/4] Add SDCA class driver Charles Keepax
2025-09-25 13:33 ` [PATCH 1/4] ASoC: SDCA: Add helper to write initialization writes Charles Keepax
2025-10-13  5:43   ` Vinod Koul
2025-09-25 13:33 ` [PATCH 2/4] ASoC: SDCA: add function devices Charles Keepax
2025-09-25 13:33 ` [PATCH 3/4] ASoC: SDCA: Add basic SDCA class driver Charles Keepax
2025-10-27 15:02   ` Pierre-Louis Bossart
2025-10-30 15:29     ` Charles Keepax
2025-10-30 15:36       ` Richard Fitzgerald
2025-11-04 16:13         ` Pierre-Louis Bossart
2025-11-04 17:14           ` Charles Keepax
2025-12-09 12:47             ` Pierre-Louis Bossart
2025-12-10  9:55               ` Charles Keepax
2025-12-20 11:04                 ` Pierre-Louis Bossart
2026-01-06 12:58                   ` Charles Keepax
2026-01-06 17:10                     ` Pierre-Louis Bossart
2026-01-13 17:27                       ` Charles Keepax
2026-01-13 22:05                         ` Pierre-Louis Bossart
2026-01-14  9:58                           ` Charles Keepax
2025-09-25 13:33 ` [PATCH 4/4] ASoC: SDCA: Add basic SDCA function driver Charles Keepax
2025-10-27 15:24   ` Pierre-Louis Bossart
2025-10-30 15:44     ` Charles Keepax [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=aQOH10Sb802aeRsF@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=shumingf@realtek.com \
    --cc=vkoul@kernel.org \
    --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