Message ID | 20240909105547.2691015-1-quic_mohs@quicinc.com (mailing list archive) |
---|---|
Headers | show |
Series | Add static channel mapping between soundwire master and slave | expand |
On Mon, Sep 09, 2024 at 04:25:43PM +0530, 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. Apologies but I am not really following what exactly the issue is here? How do these ports map to DAI links? It looks like you are attempting to have AMIC2 produced by one DAI link, but consumed by another? Thanks, Charles
On Mon, Sep 09, 2024 at 03:49:47PM +0100, Charles Keepax wrote: > On Mon, Sep 09, 2024 at 04:25:43PM +0530, 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. ... > > 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. > Apologies but I am not really following what exactly the issue is > here? How do these ports map to DAI links? It looks like you are > attempting to have AMIC2 produced by one DAI link, but consumed > by another? Yes, and it's also not clear to me why this is device specific.
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.