Skip to content

Commit 42397d7

Browse files
author
yupei_lin
committed
Audio : add hdmi_i2s_audio_disable to disable hdmi-audio function
Change-Id: I75aa03b139fbdc77fc553c15d566671608f98ecf
1 parent ccebc21 commit 42397d7

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define DW_HDMI_AUDIO_H
44

55
struct dw_hdmi;
6+
extern bool hdmi_i2s_audio_disable;
67

78
struct dw_hdmi_audio_data {
89
phys_addr_t phys;

drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
223223
static int snd_dw_hdmi_probe(struct platform_device *pdev)
224224
{
225225
struct dw_hdmi_i2s_audio_data *audio = pdev->dev.platform_data;
226+
struct dw_hdmi *hdmi = audio->hdmi;
226227
struct platform_device_info pdevinfo;
227228
struct hdmi_codec_pdata pdata;
228229

@@ -240,6 +241,13 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
240241
pdevinfo.dma_mask = DMA_BIT_MASK(32);
241242

242243
audio->pdev = platform_device_register_full(&pdevinfo);
244+
245+
if (hdmi_i2s_audio_disable) {
246+
dw_hdmi_audio_disable(hdmi);
247+
hdmi_write(audio, HDMI_AUD_CONF0_SW_RESET, HDMI_AUD_CONF0);
248+
dev_info(&pdev->dev, "disable hdmi i2s audio\n");
249+
}
250+
243251
return IS_ERR_OR_NULL(audio->pdev);
244252
}
245253

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
#define RK_HDMI_COLORIMETRY_BT2020 (HDMI_COLORIMETRY_EXTENDED + \
5959
HDMI_EXTENDED_COLORIMETRY_BT2020)
6060

61+
bool hdmi_i2s_audio_disable = false;
62+
EXPORT_SYMBOL(hdmi_i2s_audio_disable);
63+
6164
/* HDMI output pixel format */
6265
enum drm_hdmi_output_type {
6366
DRM_HDMI_OUTPUT_DEFAULT_RGB, /* default RGB */
@@ -386,6 +389,9 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
386389
int ret, val, phy_table_size;
387390
u32 *phy_config;
388391

392+
hdmi_i2s_audio_disable = of_property_read_bool(np, "hdmi-i2s-audio-disable");
393+
dev_info(hdmi->dev, "hdmi_i2s_audio_disable=%s\n", (hdmi_i2s_audio_disable ? "true" : "false"));
394+
389395
hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
390396
if (IS_ERR(hdmi->regmap)) {
391397
dev_err(hdmi->dev, "Unable to get rockchip,grf\n");

0 commit comments

Comments
 (0)