[PATCH v1 12/17] drm/mediatek: hdmi: mt8195: add audio support

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Tue Sep 20 04:11:36 PDT 2022


Il 19/09/22 18:56, Guillaume Ranquet ha scritto:
> Add HDMI audio support for mt8195
> 
> Signed-off-by: Guillaume Ranquet <granquet at baylibre.com>
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c b/drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c
> index 39e07a6dd490..bb7593ea4c86 100644
> --- a/drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_mt8195_hdmi.c
> @@ -215,6 +215,26 @@ static void mtk_hdmi_hw_vid_black(struct mtk_hdmi *hdmi, bool black)
>   		mtk_hdmi_mask(hdmi, TOP_VMUTE_CFG1, 0, REG_VMUTE_EN);
>   }
>   
> +static void mtk_hdmi_hw_aud_mute(struct mtk_hdmi *hdmi)
> +{
> +	u32 val;
> +
> +	val = mtk_hdmi_read(hdmi, AIP_CTRL, &val);
> +

val_tx = AUD_MUTE_FIFO_EN;
if (val & DSD_EN)
	val_tx |= DSD_MUTE_DATA;

regmap_set_bits(regmap, AIP_TXCTRL, val_tx);

Easier, shorter.

> +	if (val & DSD_EN)
> +		mtk_hdmi_mask(hdmi, AIP_TXCTRL,
> +			      DSD_MUTE_DATA | AUD_MUTE_FIFO_EN,
> +			      DSD_MUTE_DATA | AUD_MUTE_FIFO_EN);
> +	else
> +		mtk_hdmi_mask(hdmi, AIP_TXCTRL, AUD_MUTE_FIFO_EN,
> +			      AUD_MUTE_FIFO_EN);
> +}

Regards,
Angelo




More information about the linux-arm-kernel mailing list