From f8043428e59a4d0279ea9cf3a5643a98bc74f524 Mon Sep 17 00:00:00 2001 From: Kaifu Hu Date: Wed, 24 Jan 2018 16:14:14 +0800 Subject: [PATCH] hdmitx: add delay for plugout PD#157869: hdmitx: add delay for plugout 1. add delay for plugout and ignore plugout work when boot. 2. delete set display when plugin. Change-Id: I21fee9d3f68dc5fe84bcd76efc0a8572e3976ef6 Signed-off-by: Kaifu Hu --- .../amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 16 ++++------------ .../amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c | 2 +- .../amlogic/media/vout/hdmitx/hdmi_tx_20/hw/reg_ops.c | 2 +- .../linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index f2ebc8b..f8d1bce 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -68,7 +68,6 @@ static struct class *hdmitx_class; static int set_disp_mode_auto(void); -struct vinfo_s *hdmi_get_current_vinfo(void); static void hdmitx_get_edid(struct hdmitx_dev *hdev); static void hdmitx_set_drm_pkt(struct master_display_info_s *data); static void hdmitx_set_vsif_pkt(enum eotf_type type, uint8_t tunnel_mode); @@ -111,7 +110,7 @@ static inline void hdmitx_notify_hpd(int hpd) #include static void hdmitx_early_suspend(struct early_suspend *h) { - const struct vinfo_s *info = hdmi_get_current_vinfo(); + const struct vinfo_s *info = hdmitx_get_current_vinfo(); struct hdmitx_dev *phdmi = (struct hdmitx_dev *)h->param; if (info && (strncmp(info->name, "panel", 5) == 0 @@ -146,7 +145,7 @@ static int hdmitx_is_hdmi_vmode(char *mode_name) static void hdmitx_late_resume(struct early_suspend *h) { - const struct vinfo_s *info = hdmi_get_current_vinfo(); + const struct vinfo_s *info = hdmitx_get_current_vinfo(); struct hdmitx_dev *phdmi = (struct hdmitx_dev *)h->param; if (info && (strncmp(info->name, "panel", 5) == 0 || @@ -223,14 +222,6 @@ int get_cur_vout_index(void) return vout_index; } -struct vinfo_s *hdmi_get_current_vinfo(void) -{ - struct vinfo_s *info; - - info = get_current_vinfo(); - return info; -} - static int set_disp_mode(const char *mode) { int ret = -1; @@ -2417,6 +2408,7 @@ static int hdmitx_module_disable(enum vmode_e cur_vmod) hdev->HWOp.CntlConfig(hdev, CONF_CLR_VSDB_PACKET, 0); hdev->HWOp.CntlMisc(hdev, MISC_TMDS_PHY_OP, TMDS_PHY_DISABLE); hdev->para = hdmi_get_fmt_name("invalid", hdev->fmt_attr); + hdmitx_validate_vmode("null"); return 0; } @@ -2664,7 +2656,7 @@ static void hdmitx_hpd_plugin_handler(struct work_struct *work) (unsigned long int)bksv_buf); rx_set_receive_hdcp(bksv_buf, 1, 1, 0, 0); } - set_disp_mode_auto(); + hdmitx_set_audio(hdev, &(hdev->cur_audio_param)); hdev->hpd_state = 1; hdmitx_notify_hpd(hdev->hpd_state); diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c index 9ffbcdc..8c7f667 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c @@ -652,7 +652,7 @@ static irqreturn_t intr_handler(int irq, void *dev) hdev->hdmitx_event |= HDMI_TX_HPD_PLUGOUT; hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN; queue_delayed_work(hdev->hdmi_wq, - &hdev->work_hpd_plugout, HZ / 50); + &hdev->work_hpd_plugout, HZ / 20); } next: /* internal interrupt */ diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/reg_ops.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/reg_ops.c index e3efb42..6eaddd2 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/reg_ops.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/reg_ops.c @@ -38,7 +38,7 @@ /* For gxb/gxl/gxm */ static struct reg_map reg_maps_def[] = { [CBUS_REG_IDX] = { /* CBUS */ - .phy_addr = 0xc1100000, + .phy_addr = 0xc1109800, .size = 0xa00000, }, [PERIPHS_REG_IDX] = { /* PERIPHS */ diff --git a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h index 1380998..47ed58e 100644 --- a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h +++ b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h @@ -597,7 +597,6 @@ static inline int hdmitx_event_notifier_unregist(struct notifier_block *nb) extern void hdmi_set_audio_para(int para); extern int get_cur_vout_index(void); -extern struct vinfo_s *hdmi_get_current_vinfo(void); extern void phy_pll_off(void); extern int get_hpd_state(void); extern void hdmitx_hdcp_do_work(struct hdmitx_dev *hdev); -- 2.7.4