From a186e0108b8388502c039c1f5ba84bece48ec655 Mon Sep 17 00:00:00 2001 From: wenbiao zhang Date: Wed, 13 Mar 2019 14:55:02 +0800 Subject: [PATCH] hdmirx: send uevent when hdmirx port open/close [1/2] PD#SWPL-4308 Problem: gpu limit cause cts performance test fail Solution: limit gpu only when video playing or hdmiin Verify: P321 Change-Id: I682a908957491c8445fdb384dedd404169757e2b Signed-off-by: wenbiao zhang --- drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c | 19 +++++++++++++++++++ drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h | 3 ++- .../amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c index 8477643..43d4ad1 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c @@ -457,6 +457,7 @@ void hdmirx_extcon_register(struct platform_device *pdev, struct device *dev) ret = extcon_dev_register(edev); if (ret < 0) { rx_pr("failed to register rx_excton_rx22\n"); + extcon_dev_free(edev); return; } rx.rx_excton_rx22 = edev; @@ -473,10 +474,28 @@ void hdmirx_extcon_register(struct platform_device *pdev, struct device *dev) ret = extcon_dev_register(edev); if (ret < 0) { rx_pr("failed to register rx_excton_auth\n"); + extcon_dev_free(edev); return; } rx.hdcp.rx_excton_auth = edev; /* rx_pr("hdmirx_extcon_register done\n"); */ + + /*hdmirx extcon open port*/ + edev = extcon_dev_allocate(rx22_ext); + if (IS_ERR(edev)) { + rx_pr("failed to allocate rx_excton_open\n"); + return; + } + edev->dev.parent = dev; + edev->name = "rx_excton_open"; + dev_set_name(&edev->dev, "hdmiin"); + ret = extcon_dev_register(edev); + if (ret < 0) { + rx_pr("failed to register rx_excton_open\n"); + extcon_dev_free(edev); + return; + } + rx.rx_excton_open = edev; } static struct tvin_decoder_ops_s hdmirx_dec_ops = { .support = hdmirx_dec_support, diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h index abcf9fe..1a4c2b0 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h @@ -46,7 +46,7 @@ * * */ -#define RX_VER2 "ver.2019/02/21" +#define RX_VER2 "ver.2019/03/19" /*print type*/ #define LOG_EN 0x01 @@ -419,6 +419,7 @@ struct rx_s { struct hdmi_rx_hdcp hdcp; /*report hpd status to app*/ struct extcon_dev *rx_excton_rx22; + struct extcon_dev *rx_excton_open; /* wrapper */ unsigned int state; diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c index ba3a108..62521a8 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c @@ -1889,6 +1889,7 @@ void hdmirx_open_port(enum tvin_port_e port) edid_update_flag = 0; rx_pkt_initial(); sm_pause = fsmst; + extcon_set_state_sync(rx.rx_excton_open, EXTCON_DISP_HDMI, 1); rx_pr("%s:%d\n", __func__, rx.port); } @@ -1900,6 +1901,7 @@ void hdmirx_close_port(void) /* when exit hdmi, disable termination & hpd of specific port */ if (disable_port_en) rx_set_port_hpd(disable_port_num, 0); + extcon_set_state_sync(rx.rx_excton_open, EXTCON_DISP_HDMI, 0); } void rx_nosig_monitor(void) -- 2.7.4