Alsa-Devel Archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: "\"Amadeusz Sławiński\"" <amadeuszx.slawinski@linux.intel.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Mark Brown" <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH v2.5] ASoC: Replace dpcm_playback/capture to playback/capture_assertion
Date: Wed, 10 Apr 2024 02:54:20 +0000	[thread overview]
Message-ID: <87msq2kjvo.wl-kuninori.morimoto.gx@renesas.com> (raw)


Hi Mark, Amadeusz, Jerome, Pierre-Louis

This is v2.5 patch which is preparation for v3.
Because full-patch-set has over 20 patches, to avoid posting huge
patch-bomb, I try to post main patch only for preparation.

In v2.5, it will use xxx_assertion flag, and exising dpcm_xxx
and xxx_only flags will be converted to it. I think it can keep
compatibility and possible to indicate link error same as before
which was conserned by Pierre-Louis. Please let me know if it still
not good match.

One of my big consern is Amadeusz/Jerome's idea which uses "XXX | YYY"
style. To avoid confusion, let's name each style as below here.

[Flag style]
	unsigned int flags;
	#define SND_SOC_FLAGS_ASSERTION_PLAYBACK	BIT(x)
	#define SND_SOC_FLAGS_ASSERTION_CAPTURE		BIT(x)
	...

[BitField style]
	unsigned int playback_assertion:1;
	unsigned int capture_assertion:1;
	...

This v2.5 patch is using [BitField style] and I think it is not a big
problem from "code point of view", but I think [Flag style] is
better for "human understandable point of view", because we can define like
below, for example.

	#define SND_SOC_FLAGS_AVAILABLE_PLAYBACK			/* no flag is needed */
	#define SND_SOC_FLAGS_AVAILABLE_PLAYBACK_WITH_ASSERTION		SND_SOC_FLAGS_ASSERTION_PLAYBACK
	#define SND_SOC_FLAGS_AVAILABLE_CAPTURE				/* no flag is needed */
	#define SND_SOC_FLAGS_AVAILABLE_CAPTURE_WITH_ASSERTION		SND_SOC_FLAGS_ASSERTION_CAPTURE
	#define SND_SOC_FLAGS_AVAILABLE_BIDIRECTIONAL			/* no flag is needed */
	#define SND_SOC_FLAGS_AVAILABLE_BIDIRECTIONAL_WITH_ASSERTION	(SND_SOC_FLAGS_ASSERTION_PLAYBACK | SND_SOC_FLAGS_ASSERTION_CAPTURE)
	#define SND_SOC_FLAGS_AVAILABLE_PLAYBACK_ONLY			SND_SOC_FLAGS_ASSERTION_PLAYBACK
	#define SND_SOC_FLAGS_AVAILABLE_CAPTURE_ONLY		 	SND_SOC_FLAGS_ASSERTION_CAPTURE

Switch to [Flag style] is OK for me, but one consern is that in such
case, people will wonder "why ASoC is using both [Flag style] and
[BitField style] in the same time ?", because we are using
[BitField style] for other flags.

So, my suggestion is that next v3 patch uses [Flag style].
And after that, post new patch-set to switch
[BitField style] to [Flag style] for other flags.
But I wonder is this good approach ?

v2 -> v2.5
	- use xxx_assertion flag
	- dpcm_xxx -> xxx_assertion
	- xxx_only -> xxx_assertion
	- only [01/xx] patch

v1 -> v2
	- based on latest ASoC branch
	- keep comment on Intel
	- tidyup patch title
	- tidyup DPCM BE warning output condition
	- Add new patch for Document

Link: https://lore.kernel.org/r/87o7b353of.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87zfuesz8y.wl-kuninori.morimoto.gx@renesas.com

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

             reply	other threads:[~2024-04-10  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  2:54 Kuninori Morimoto [this message]
2024-04-10  2:55 ` [PATCH v2.5] ASoC: soc-pcm: cleanup soc_get_playback_capture() Kuninori Morimoto
2024-04-10  8:48 ` [PATCH v2.5] ASoC: Replace dpcm_playback/capture to playback/capture_assertion Amadeusz Sławiński
2024-04-10 23:51   ` Kuninori Morimoto
2024-04-14 23:40 ` Kuninori Morimoto
2024-04-15 23:44   ` Mark Brown

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=87msq2kjvo.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=pierre-louis.bossart@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).