From 5328163362f319efc08f0effba74e00a02fca71c Mon Sep 17 00:00:00 2001 From: codewalkerster Date: Tue, 22 Jul 2025 16:12:13 +0900 Subject: [PATCH] ODROID: aml_media: Add disablehpd module_param. Change-Id: I2fa0889eb7a1e05aa5245e2aceaddb9c161c2709 --- drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c | 13 ++++++++++ drivers/media/vout/hdmitx21/hw/interrupts.c | 27 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c b/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c index 068f434bd..417847e3e 100644 --- a/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c +++ b/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c @@ -3233,6 +3233,10 @@ static int hdmitx_tmds_cedst(struct hdmitx_dev *hdev) return scdc21_status_flags(hdev); } +#ifdef CONFIG_ARCH_MESON_ODROID_COMMON +extern char *disablehpd; +#endif + static int hdmitx_cntl_misc(struct hdmitx_hw_common *tx_hw, u32 cmd, u32 argv) { @@ -3263,7 +3267,16 @@ static int hdmitx_cntl_misc(struct hdmitx_hw_common *tx_hw, u32 cmd, argv = HPD_UNMUX_HPD; return hdmitx21_hpd_hw_op(argv); case MISC_HPD_GPI_ST: +#ifdef CONFIG_ARCH_MESON_ODROID_COMMON + if (!strcmp(disablehpd, "true")) { + HDMITX_INFO(HW "disablehpd = %s\n", disablehpd); + return 1; + } else { + return hdmitx21_hpd_hw_op(HPD_READ_HPD_GPIO); + } +#else return hdmitx21_hpd_hw_op(HPD_READ_HPD_GPIO); +#endif case MISC_TRIGGER_HPD: if (argv == 1) hdmitx21_wr_reg(HDMITX_TOP_INTR_STAT, 1 << 1); diff --git a/drivers/media/vout/hdmitx21/hw/interrupts.c b/drivers/media/vout/hdmitx21/hw/interrupts.c index 475f0fff3..96437ae51 100644 --- a/drivers/media/vout/hdmitx21/hw/interrupts.c +++ b/drivers/media/vout/hdmitx21/hw/interrupts.c @@ -27,6 +27,12 @@ #include #include "common.h" +#ifdef CONFIG_ARCH_MESON_ODROID_COMMON +char *disablehpd = "false"; +module_param(disablehpd, charp, 0644); +MODULE_PARM_DESC(disablehpd, "\n disablehpd\n"); +#endif + static void intr2_sw_handler(struct intr_t *); static void intr5_sw_handler(struct intr_t *); static void top_hpd_intr_stub_handler(struct intr_t *); @@ -278,6 +284,17 @@ void hdmitx_top_intr_handler(struct work_struct *work) else dat_top &= ~(1 << 1); } + +#ifdef CONFIG_ARCH_MESON_ODROID_COMMON + if (!strcmp(disablehpd, "true")) { + HDMITX_INFO(HW "disablehpd = %s\n", disablehpd); + hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN; + hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT; + hdmitx21_wr_reg(HDMITX_TOP_INTR_STAT_CLR, dat_top | 0x6); + return; + } +#endif + /* bit[2:1] of dat_top means HPD falling and rising */ if ((dat_top & 0x6) && hdev->tx_hw.base.hdmitx_gpios_hpd >= 0) { struct timespec64 kts; @@ -517,4 +534,14 @@ void hdmitx_setupirqs(struct hdmitx_dev *phdev) if (r != 0) HDMITX_INFO(SYS "can't request emp_vsync irq\n"); #endif + +#ifdef CONFIG_ARCH_MESON_ODROID_COMMON + if (!strcmp(disablehpd, "true")) { + HDMITX_INFO(HW "disablehpd = %s\n", disablehpd); + phdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN; + phdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT; + queue_delayed_work(phdev->hdmi_intr_wq, + &phdev->work_hpd_plugin, HZ / 3); + } +#endif }