From: Hans de Goede <hdegoede@redhat.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC SOF 1/2] topology: Add sof-byt-codec-tdm4.m4 file
Date: Mon, 7 Dec 2020 16:17:37 +0100 [thread overview]
Message-ID: <fe6ae1ab-8064-8afb-8c8d-36f4624a61fa@redhat.com> (raw)
In-Reply-To: <1272e367-6600-198d-e93f-ba2bfa2c6c0f@linux.intel.com>
Hi,
On 12/7/20 4:11 PM, Pierre-Louis Bossart wrote:
> Hi Hans,
>
>> Some BYT/CHT boards (mostly Cherry Trail) use TDM 4 slots 24 bit as
>> wire format to the codec, rather then standard I2S 2 channel 24 bit.
>>
>> Add a new m4 file for this. This is a copy of sof-byt-codec.m4 with
>> the following changes:
>>
>> @@ -1,4 +1,4 @@
>> -`# Topology for generic' PLATFORM `board with' CODEC `on SSP' SSP_NUM
>> +`# Topology for generic' PLATFORM `board with' CODEC `on SSP' SSP_NUM `using TDM 4 slots 24 bit'
>>
>> # Include topology builder
>> include(`utils.m4')
>> @@ -97,8 +97,8 @@
>> # BE configurations - overrides config in ACPI if present
>> #
>> DAI_CONFIG(SSP, SSP_NUM, 0, SSP2-Codec,
>> - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in),
>> - SSP_CLOCK(bclk, 2400000, codec_slave),
>> + SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, 19200000, codec_mclk_in),
>> + SSP_CLOCK(bclk, 4800000, codec_slave),
>> SSP_CLOCK(fsync, 48000, codec_slave),
>> - SSP_TDM(2, 25, 3, 3),
>> + SSP_TDM(4, 25, 3, 3),
>> SSP_CONFIG_DATA(SSP, SSP_NUM, 24)))
>
> I don't think this change is necessary, the problem is probably that we still rely on the hard-coded 4 slots in the machine driver which was the default for the Atom/SST driver.
>
> If I look at the cht_bsw_nau8824.c driver, the only place where there is a reference to 4 slots is in the cht_codec_init() function.
>
> https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/cht_bsw_nau8824.c#L104
>
> In other drivers, this was moved to the codec_fixup routine which is overridden/ignored when SOF is used.
>
> see e.g.
>
> https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/cht_bsw_max98090_ti.c
>
> https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/cht_bsw_rt5645.c
>
> If you follow the same pattern that should make this problem go away. When SOF is used we typically don't have any hard-coded format and whatever is defined in the topology is propagated to the codec driver.
As I explained in the cover, this effectively switches to I2S 2 channel 24 bit format,
which requires mixer-setting / UCM changes in case of the nau8824 codec. The codec
driver has this comment:
* Configures a DAI for TDM operation. Only support 4 slots TDM.
*/
static int nau8824_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
Which is not entirely true I did get playback to work with I2S 2 channel 24 bit
(I did not test recording yet) but playback only works after mixer setting
changes, which in turn break things under SST.
Please read the cover letter, which should explain the issue.
As mentioned there we could use I2S 2 channel 24 bit as we do everywhere
(I like standardizing on that) but then the UCM profile would need to
differentiate between the SST and SOF setups and adjust the mixer
accordingly to not regress SST setups.
Regards,
Hans
next prev parent reply other threads:[~2020-12-07 15:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 12:46 [RFC SOF 0/2] topology: Try to add sof-cht-nau8824 topology file Hans de Goede
2020-12-06 12:46 ` [RFC SOF 1/2] topology: Add sof-byt-codec-tdm4.m4 file Hans de Goede
2020-12-07 15:11 ` Pierre-Louis Bossart
2020-12-07 15:17 ` Hans de Goede [this message]
2020-12-06 12:46 ` [RFC SOF 2/2] topology: Add sof-cht-nau8824 topology file Hans de Goede
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=fe6ae1ab-8064-8afb-8c8d-36f4624a61fa@redhat.com \
--to=hdegoede@redhat.com \
--cc=alsa-devel@alsa-project.org \
--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 NNTP newsgroup(s).