lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.14 615/849] ASoC: cs42l42: Always configure both ASP TX channels
    Date
    From: Richard Fitzgerald <rf@opensource.cirrus.com>

    [ Upstream commit 6e6825801ab926360f7f4f2dbcfd107d5ab8f025 ]

    An I2S frame always has two slots (left and right) even when sending
    mono. The right channel (channel 2) of ASP TX will always have the
    same bit width as the left channel and will always be on the high
    phase of LRCLK.

    The previous implementation always passed the field masks for both
    channels to snd_soc_component_update_bits() but for mono the written value
    only contained the settings for channel 1. The result was that for mono
    channel 2 was set to 8-bit (which is an invalid configuration) with both
    channels on the low phase of LRCLK.

    Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
    Fixes: 585e7079de0e ("ASoC: cs42l42: Add Capture Support")
    Link: https://lore.kernel.org/r/20211015133619.4698-3-rf@opensource.cirrus.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    sound/soc/codecs/cs42l42.c | 9 ++++-----
    1 file changed, 4 insertions(+), 5 deletions(-)

    diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
    index 8838b9a0de8e4..4f8d8a65643df 100644
    --- a/sound/soc/codecs/cs42l42.c
    +++ b/sound/soc/codecs/cs42l42.c
    @@ -845,11 +845,10 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream,

    switch(substream->stream) {
    case SNDRV_PCM_STREAM_CAPTURE:
    - if (channels == 2) {
    - val |= CS42L42_ASP_TX_CH2_AP_MASK;
    - val |= width << CS42L42_ASP_TX_CH2_RES_SHIFT;
    - }
    - val |= width << CS42L42_ASP_TX_CH1_RES_SHIFT;
    + /* channel 2 on high LRCLK */
    + val = CS42L42_ASP_TX_CH2_AP_MASK |
    + (width << CS42L42_ASP_TX_CH2_RES_SHIFT) |
    + (width << CS42L42_ASP_TX_CH1_RES_SHIFT);

    snd_soc_component_update_bits(component, CS42L42_ASP_TX_CH_AP_RES,
    CS42L42_ASP_TX_CH1_AP_MASK | CS42L42_ASP_TX_CH2_AP_MASK |
    --
    2.33.0


    \
     
     \ /
      Last update: 2021-11-16 00:12    [W:4.144 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site