Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mohammad Rafi Shaik <quic_mohs@quicinc.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: Sanyog Kale <sanyog.r.kale@intel.com>,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, quic_rohkumar@quicinc.com,
	kernel@quicinc.com, quic_pkumpatl@quicinc.com
Subject: Re: [PATCH v1 0/4] Add static channel mapping between soundwire master and slave
Date: Mon, 9 Sep 2024 18:03:08 +0200	[thread overview]
Message-ID: <d6625b2e-c926-478b-b3bf-5e241270da62@linux.intel.com> (raw)
In-Reply-To: <20240909105547.2691015-1-quic_mohs@quicinc.com>



On 9/9/24 12:55, Mohammad Rafi Shaik wrote:
> Add static channel map support between soundwire master and slave.
> This patch series will resolve channel mask mismatch between master and slave.
> 
> Scenario: wcd937x AMIC2 usecase
> 
>                           Master                 Slave (wcd937x)
>                      +--------------+           +--------------+
>                      |  +--------+  |           |  +--------+  |
>          AMIC1 ----->|  | PORT1  |  |           |  |   TX1  |  |<-----------AMIC1
>          AMIC2 ----->|  |        |  |           |  |        |  |
>                      |  +--------+  |           |  +--------+  |
>                      |              |           |              |
>          AMIC3 ----->|  +--------+  |           |  +--------+  |
>                      |  |  PORT2 |  |           |  |   TX2  |  |<-----------AMIC2
>                      |  |        |  |           |  |        |  |<-----------AMIC3
>                      |  +--------+  |           |  +--------+  |
>                      |              |           |              |
>                      |  +--------+  |           |  +--------+  |
>  DMIC0...DMIC3------>|  |  PORT3 |  |           |  |   TX3  |  |<-----------DMIC0...DMIC3
>                      |  |        |  |           |  |        |  |<-----------MBHC
>                      |  +--------+  |           |  +--------+  |
>                      |              |           |              |
>                      |  +--------+  |           |  +--------+  |
>  DMIC4...DMIC37----->|  |  PORT4 |  |           |  |   TX4  |  |<-----------DMIC4...DMIC7
>                      |  |        |  |           |  |        |  |
>                      |  +--------+  |           |  +--------+  |
>                      |              |           |              |
>                      +------------- +           +--------------+
> 
> For AMIC2 usecase, The Slave need to configure TX2 Port with channel mask 1 and
> for Master required PORT1 with channel mask 2,
> 
> In existing design master and slave configured with same channel mask, it will fail
> AMIC2 usecase.
> 
> The New design will help to configure channel mapping between master and slave from
> device tree.

That's rather controversial...

In theory you already have the means to deal with a different channel
mapping in the hw_params callback for your manager and peripheral
devices. That's how we e.g. send a 2ch stream on the manager to two
separate amplifiers and program which channel is used by what amplifier.

The common part between manager and peripheral is the notion of
'stream', and you can add a different port/stream configuration for
manager and peripheral with sdw_stream_add_master() and
sdw_stream_add_slave() respectively.

Port1 and TX2 can be used by just setting the relevant port_config.num
value.

Likewise the port_config.ch_mask can be programmed at will to select the
relevant mappings. See e.g. rt1308_sdw_hw_params() in rt1308-sdw.c, the
mapping were handled with a set_tdm_slot() callback before.

In short, please re-visit your hw_params() implementation first and use
the existing 'stream' APIs.

      parent reply	other threads:[~2024-09-09 16:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 10:55 [PATCH v1 0/4] Add static channel mapping between soundwire master and slave Mohammad Rafi Shaik
2024-09-09 10:55 ` [PATCH v1 1/4] ASoC: dt-bindings: wcd938x-sdw: Add static channel mapping support Mohammad Rafi Shaik
2024-09-10  7:45   ` Krzysztof Kozlowski
2024-09-11 11:33   ` Dmitry Baryshkov
2024-09-09 10:55 ` [PATCH v1 2/4] soundwire: stream: Add set_master_channel_map() to set static channel mapping Mohammad Rafi Shaik
2024-09-09 14:50   ` Charles Keepax
2024-09-09 10:55 ` [PATCH v1 3/4] soundwire: qcom: Add static channel mapping support in soundwire master Mohammad Rafi Shaik
2024-09-09 10:55 ` [PATCH v1 4/4] ASoC: codecs: wcd937x: Add static channel mapping support in wcd937x-sdw Mohammad Rafi Shaik
2024-09-09 14:49 ` [PATCH v1 0/4] Add static channel mapping between soundwire master and slave Charles Keepax
2024-09-09 15:10   ` Mark Brown
2024-09-09 16:03 ` Pierre-Louis Bossart [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=d6625b2e-c926-478b-b3bf-5e241270da62@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@quicinc.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_mohs@quicinc.com \
    --cc=quic_pkumpatl@quicinc.com \
    --cc=quic_rohkumar@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sanyog.r.kale@intel.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.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