mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Ekenberg <stefan.ekenberg@axis.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel@axis.com
Subject: Re: [PATCH] drm/bridge: adv7511_audio: Update Audio InfoFrame properly
Date: Mon, 18 Nov 2024 08:59:37 +0100	[thread overview]
Message-ID: <c1ebe220-1bc4-76ad-8313-88058ef95c9f@axis.com> (raw)
In-Reply-To: <CAA8EJpqbMvevmWZ3AbQOwBbVUOkUPHB_mrv+BtLndAcpLmcVpA@mail.gmail.com>

On 11/15/24 20:49, Dmitry Baryshkov wrote:
> On Fri, 15 Nov 2024 at 14:25, Stefan Ekenberg <stefan.ekenberg@axis.com> wrote:
>>
>> On 11/15/24 09:16, Dmitry Baryshkov wrote:
>>> On Wed, Nov 13, 2024 at 08:38:11AM +0100, Stefan Ekenberg wrote:
>>>> AUDIO_UPDATE bit (Bit 5 of MAIN register 0x4A) needs to be set to 1
>>>> while updating Audio InfoFrame information and then set to 0 when done.
>>>> Otherwise partially updated Audio InfoFrames could be sent out. Two
>>>> cases where this rule were not followed are fixed:
>>>>    - In adv7511_hdmi_hw_params() make sure AUDIO_UPDATE bit is updated
>>>>      before/after setting ADV7511_REG_AUDIO_INFOFRAME.
>>>>    - In audio_startup() use the correct register for clearing
>>>>      AUDIO_UPDATE bit.
>>>>
>>>> The problem with corrupted audio infoframes were discovered by letting
>>>> a HDMI logic analyser check the output of ADV7535.
>>>>
>>>> Signed-off-by: Stefan Ekenberg <stefan.ekenberg@axis.com>
>>>
>>> Missing Fixes tag,
>>
>> Ok, I will add Fixes tag.
>>
>>>
>>>> ---
>>>>    drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 14 ++++++++++++--
>>>>    1 file changed, 12 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
>>>> index 61f4a38e7d2bf6905683cbc9e762b28ecc999d05..8f786592143b6c81e5a434768b51508d5e5f3c73 100644
>>>> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
>>>> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
>>>> @@ -153,7 +153,16 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
>>>>                          ADV7511_AUDIO_CFG3_LEN_MASK, len);
>>>>       regmap_update_bits(adv7511->regmap, ADV7511_REG_I2C_FREQ_ID_CFG,
>>>>                          ADV7511_I2C_FREQ_ID_CFG_RATE_MASK, rate << 4);
>>>> -    regmap_write(adv7511->regmap, 0x73, 0x1);
>>>> +
>>>> +    /* send current Audio infoframe values while updating */
>>>> +    regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
>>>> +                       BIT(5), BIT(5));
>>>> +
>>>> +    regmap_write(adv7511->regmap, ADV7511_REG_AUDIO_INFOFRAME(0), 0x1);
>>>> +
>>>> +    /* use Audio infoframe updated info */
>>>> +    regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
>>>> +                       BIT(5), 0);
>>>>
>>>>       return 0;
>>>>    }
>>>> @@ -184,8 +193,9 @@ static int audio_startup(struct device *dev, void *data)
>>>>       regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(0),
>>>>                               BIT(7) | BIT(6), BIT(7));
>>>>       /* use Audio infoframe updated info */
>>>> -    regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(1),
>>>> +    regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
>>>>                               BIT(5), 0);
>>>
>>> Should the REG_GC(1) still be written?
>>
>> The comment before this line states "use Audio infoframe updated info"
>> and, before my change, bit 5 of REG_GC(1) was cleared by the line I
>> removed. Bit 5 is positioned within field GC_PP[3:0] and that field
>> doesn't control audio infoframe and is read-only. My conclusion
>> therefore was that the author if this code actually meant to clear bit 5
>> of REG_INFOFRAME_UPDATE from the very beginning. In short, clearing bit
>> 5 of REG_GC(1) is invalid since it is a read-only field.
> 
> Ack, thanks for the explanation. It might be nice if you can include
> this into the commit message.

No problem, I will extend the commit message with this information.

> 
>>
>>>
>>>> +
>>>>       /* enable SPDIF receiver */
>>>>       if (adv7511->audio_source == ADV7511_AUDIO_SOURCE_SPDIF)
>>>>               regmap_update_bits(adv7511->regmap, ADV7511_REG_AUDIO_CONFIG,
>>>>
>>>> ---
>>>> base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
>>>> change-id: 20241108-adv7511-audio-info-frame-54614dd4bf57
>>>>
>>>> Best regards,
>>>> --
>>>> Stefan Ekenberg <stefan.ekenberg@axis.com>
>>>>
>>>
>>
> 
> 


      reply	other threads:[~2024-11-18  7:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13  7:38 Stefan Ekenberg
2024-11-15  8:16 ` Dmitry Baryshkov
2024-11-15 12:25   ` Stefan Ekenberg
2024-11-15 19:49     ` Dmitry Baryshkov
2024-11-18  7:59       ` Stefan Ekenberg [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=c1ebe220-1bc4-76ad-8313-88058ef95c9f@axis.com \
    --to=stefan.ekenberg@axis.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®