All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shuming [范書銘]" <shumingf@realtek.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>
Cc: "Oder Chiou" <oder_chiou@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"kent_chen@realtek.com [陳建宏]" <kent_chen@realtek.com>,
	"Keith.Tzeng@quantatw.com" <Keith.Tzeng@quantatw.com>,
	"Derek [方德義]" <derek.fang@realtek.com>,
	"brent.lu@intel.com" <brent.lu@intel.com>,
	"Flove(HsinFu)" <flove@realtek.com>
Subject: RE: [PATCH v2] ASoC: rt1015: support TDM slot configuration
Date: Wed, 4 Nov 2020 01:42:00 +0000	[thread overview]
Message-ID: <8640bbac481c42508aecebeb8ef658cf@realtek.com> (raw)
In-Reply-To: <659af5ba-9854-b6d2-95f7-36fd1a5b2bfe@linux.intel.com>

> > +	/* This is an assumption that the system sends stereo audio to the
> amplifier typically.
> > +	 * And the stereo audio is placed in slot 0/2/4/6 as the starting slot.
> > +	 * According to the slot number, we also set the mono LR to select the
> right slot.
> > +	 */
> > +	first_bit = __ffs(rx_mask);
> > +	switch (first_bit) {
> > +	case 0:
> > +	case 2:
> > +	case 4:
> > +	case 6:
> > +		snd_soc_component_update_bits(component,
> > +			RT1015_PAD_DRV2, RT1015_MONO_LR_SEL_MASK,
> > +			RT1015_MONO_L_CHANNEL);
> > +		snd_soc_component_update_bits(component,
> > +			RT1015_TDM1_4,
> > +			RT1015_TDM_I2S_TX_L_DAC1_1_MASK |
> > +			RT1015_TDM_I2S_TX_R_DAC1_1_MASK,
> > +			(first_bit << RT1015_TDM_I2S_TX_L_DAC1_1_SFT) |
> > +			((first_bit+1) << RT1015_TDM_I2S_TX_R_DAC1_1_SFT));
> > +		break;
> > +	case 1:
> > +	case 3:
> > +	case 5:
> > +	case 7:
> > +		snd_soc_component_update_bits(component,
> > +			RT1015_PAD_DRV2, RT1015_MONO_LR_SEL_MASK,
> > +			RT1015_MONO_R_CHANNEL);
> > +		snd_soc_component_update_bits(component,
> > +			RT1015_TDM1_4,
> > +			RT1015_TDM_I2S_TX_L_DAC1_1_MASK |
> > +			RT1015_TDM_I2S_TX_R_DAC1_1_MASK,
> > +			((first_bit-1) << RT1015_TDM_I2S_TX_L_DAC1_1_SFT) |
> > +			(first_bit << RT1015_TDM_I2S_TX_R_DAC1_1_SFT));
> > +		break;
> 
> One more question from me: if you have 2 amplifiers on the same link and use
> slot 0 and 1, what would be the rx_mask for each amplifier? If the mask is
> BIT(0) for left and BIT(1) for right, it looks like both would render L+R?

Oh, I didn't expect that the customers want to render L+R when using TDM configuration.

> Also should the settings and channel selection be modifiable using the codec
> configuration as we've done for RT1308, e.g. rt1015-1 would use LL and
> rt1015-2 would use RR?

OK, I will remove the mono LR channel selection in rt1015_set_tdm_slot function.
The channel selection setting would be controlled by the application level only.
RT1015 is a mono amplifier, it could select 'Left', 'Right' and 'Left + Right average'.

> 
> Thanks
> -Pierre
> 
> ------Please consider the environment before printing this e-mail.

      reply	other threads:[~2020-11-04  1:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  9:14 [PATCH v2] ASoC: rt1015: support TDM slot configuration shumingf
2020-11-03 15:47 ` Pierre-Louis Bossart
2020-11-04  1:42   ` Shuming [范書銘] [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=8640bbac481c42508aecebeb8ef658cf@realtek.com \
    --to=shumingf@realtek.com \
    --cc=Keith.Tzeng@quantatw.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=kent_chen@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.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 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.