All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Change handling of unimplemented set_bclk_ratio
@ 2022-08-18 16:53 ` Martin Povišer
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Povišer @ 2022-08-18 16:53 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, linux-kernel, Martin Povišer

If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
still be okay with the ratio, just does not care to register a handler.

No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
the return value, but -ENOSUPP disables an error print from within the
common soc_dai_ret return filter. With the new behavior a machine
driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
which may care about the ratio, some of which may not.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
 sound/soc/soc-dai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index d530e8c2b77b..49752af0e205 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll);
  */
 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
 {
-	int ret = -EINVAL;
+	int ret = -ENOTSUPP;
 
 	if (dai->driver->ops &&
 	    dai->driver->ops->set_bclk_ratio)
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ASoC: Change handling of unimplemented set_bclk_ratio
@ 2022-08-18 16:53 ` Martin Povišer
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Povišer @ 2022-08-18 16:53 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: Martin Povišer, alsa-devel, linux-kernel

If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
still be okay with the ratio, just does not care to register a handler.

No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
the return value, but -ENOSUPP disables an error print from within the
common soc_dai_ret return filter. With the new behavior a machine
driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
which may care about the ratio, some of which may not.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
 sound/soc/soc-dai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index d530e8c2b77b..49752af0e205 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll);
  */
 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
 {
-	int ret = -EINVAL;
+	int ret = -ENOTSUPP;
 
 	if (dai->driver->ops &&
 	    dai->driver->ops->set_bclk_ratio)
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Change handling of unimplemented set_bclk_ratio
  2022-08-18 16:53 ` Martin Povišer
  (?)
@ 2022-08-19 22:47 ` Mark Brown
  -1 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-08-19 22:47 UTC (permalink / raw)
  To: Liam Girdwood, Martin Povišer; +Cc: alsa-devel, linux-kernel

On Thu, 18 Aug 2022 18:53:36 +0200, Martin Povišer wrote:
> If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
> method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
> still be okay with the ratio, just does not care to register a handler.
> 
> No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
> the return value, but -ENOSUPP disables an error print from within the
> common soc_dai_ret return filter. With the new behavior a machine
> driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
> which may care about the ratio, some of which may not.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Change handling of unimplemented set_bclk_ratio
      commit: ceff365a29aaf275c0cd1bb7edaf57dcf254bc77

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-19 22:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 16:53 [PATCH] ASoC: Change handling of unimplemented set_bclk_ratio Martin Povišer
2022-08-18 16:53 ` Martin Povišer
2022-08-19 22:47 ` Mark Brown

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.