drm/msm/hdmi: enable lpm-mux if it is present
PATCH 1/1 drm/msm/hdmi: enable lpm-mux if it is present
From: Beeresh Gopal <[email protected]>
lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.
--- drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 24 +++++++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/hdmi/hdmi.c +1 -0
@@ -453,6 +453,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) config.hpd_gpio =get_gpio ("qcom,hdmi-tx-hpd" ); config.mux_en_gpio =get_gpio ("qcom,hdmi-tx-mux-en" ); config.mux_sel_gpio =get_gpio ("qcom,hdmi-tx-mux-sel" ); + config.mux_lpm_gpio =get_gpio ("qcom,hdmi-tx-mux-lpm" ); config.shared_irq = true;#else
drivers/gpu/drm/msm/hdmi/hdmi.h +1 -0
@@ -103,6 +103,7 @@ struct hdmi_platform_config {/* gpio's: */ int ddc_clk_gpio, ddc_data_gpio, hpd_gpio, mux_en_gpio, mux_sel_gpio; +int mux_lpm_gpio;/* older devices had their own irq, mdp5+ it is shared w/ mdp: */ bool shared_irq;
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +23 -1
@@ -63,7 +63,8 @@ static int gpio_config(struct hdmi *hdmi, bool on) ret =gpio_request (config->mux_en_gpio,"HDMI_MUX_EN" );if (ret) {dev_err (dev->dev,"'%s'(%d) gpio_request failed: %d\n" , -"HDMI_MUX_SEL" , config->mux_en_gpio, ret); +"HDMI_MUX_EN" , + config->mux_en_gpio, ret); goto error4; }gpio_set_value_cansleep (config->mux_en_gpio,1 );
@@ -78,6 +79,19 @@ static int gpio_config(struct hdmi *hdmi, bool on) }gpio_set_value_cansleep (config->mux_sel_gpio,0 ); } + +if (config->mux_lpm_gpio !=-1 ) { + ret =gpio_request (config->mux_lpm_gpio, +"HDMI_MUX_LPM" ); +if (ret) { +dev_err (dev->dev, +"'%s'(%d) gpio_request failed: %d\n" , +"HDMI_MUX_LPM" , + config->mux_lpm_gpio, ret); + goto error6; + } +gpio_set_value_cansleep (config->mux_lpm_gpio,1 ); + }DBG ("gpio on" ); }else {gpio_free (config->ddc_clk_gpio);
@@ -93,11 +107,19 @@ static int gpio_config(struct hdmi *hdmi, bool on)gpio_set_value_cansleep (config->mux_sel_gpio,1 );gpio_free (config->mux_sel_gpio); } + +if (config->mux_lpm_gpio !=-1 ) { +gpio_set_value_cansleep (config->mux_lpm_gpio,0 ); +gpio_free (config->mux_lpm_gpio); + }DBG ("gpio off" ); }return 0 ; +error6: +if (config->mux_sel_gpio !=-1 ) +gpio_free (config->mux_sel_gpio); error5:if (config->mux_en_gpio !=-1 )gpio_free (config->mux_en_gpio);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Hi,
Am 31.07.2014 16:46, schrieb Stephane Viau:
Quoted 7 lines
From: Beeresh Gopal <[email protected]>
lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.Signed-off-by Beeresh Gopal <[email protected]>
You forgot to sign off yourself.
[...]
Quoted 5 lines
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +0
-0
drivers/gpu/drm/msm/hdmi/hdmi_connector.c static int gpio_config(struct hdmi *hdmi, bool on) · line 70
Quoted 9 lines
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +2
-1@@ -63,7 +63,8 @@ static int gpio_config(struct hdmi *hdmi, bool on) ret =gpio_request (config->mux_en_gpio,"HDMI_MUX_EN" );if (ret) {dev_err (dev->dev,"'%s'(%d) gpio_request failed: %d\n" , -"HDMI_MUX_SEL" , config->mux_en_gpio, ret); +"HDMI_MUX_EN" , + config->mux_en_gpio, ret); goto error4; }gpio_set_value_cansleep (config->mux_en_gpio,1 );
This hunk looks like an unrelated typo fix, which should then probably go into its own patch.
Cheers,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 7 lines · Stephane Viau
From: Beeresh Gopal <[email protected]>
lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.Signed-off-by Beeresh Gopal <[email protected]>
other than the issues Andreas mentioned, it looks good, so with those addressed:
Quoted 88 lines
--- drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 24 +++++++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/hdmi/hdmi.c +1
-0@@ -453,6 +453,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) config.hpd_gpio =get_gpio ("qcom,hdmi-tx-hpd" ); config.mux_en_gpio =get_gpio ("qcom,hdmi-tx-mux-en" ); config.mux_sel_gpio =get_gpio ("qcom,hdmi-tx-mux-sel" ); + config.mux_lpm_gpio =get_gpio ("qcom,hdmi-tx-mux-lpm" ); config.shared_irq = true;#else drivers/gpu/drm/msm/hdmi/hdmi.h +1
-0@@ -103,6 +103,7 @@ struct hdmi_platform_config {/* gpio's: */ int ddc_clk_gpio, ddc_data_gpio, hpd_gpio, mux_en_gpio, mux_sel_gpio; +int mux_lpm_gpio;/* older devices had their own irq, mdp5+ it is shared w/ mdp: */ bool shared_irq;drivers/gpu/drm/msm/hdmi/hdmi_connector.c +23
-2@@ -63,7 +63,8 @@ static int gpio_config(struct hdmi *hdmi, bool on) ret =gpio_request (config->mux_en_gpio,"HDMI_MUX_EN" );if (ret) {dev_err (dev->dev,"'%s'(%d) gpio_request failed: %d\n" , -"HDMI_MUX_SEL" , config->mux_en_gpio, ret); +"HDMI_MUX_EN" , + config->mux_en_gpio, ret); goto error4; }gpio_set_value_cansleep (config->mux_en_gpio,1 );@@ -78,6 +79,19 @@ static int gpio_config(struct hdmi *hdmi, bool on) }gpio_set_value_cansleep (config->mux_sel_gpio,0 ); } + +if (config->mux_lpm_gpio !=-1 ) { + ret =gpio_request (config->mux_lpm_gpio, +"HDMI_MUX_LPM" ); +if (ret) { +dev_err (dev->dev, +"'%s'(%d) gpio_request failed: %d\n" , +"HDMI_MUX_LPM" , + config->mux_lpm_gpio, ret); + goto error6; + } +gpio_set_value_cansleep (config->mux_lpm_gpio,1 ); + }DBG ("gpio on" ); }else {gpio_free (config->ddc_clk_gpio);@@ -93,11 +107,19 @@ static int gpio_config(struct hdmi *hdmi, bool on)gpio_set_value_cansleep (config->mux_sel_gpio,1 );gpio_free (config->mux_sel_gpio); } + +if (config->mux_lpm_gpio !=-1 ) { +gpio_set_value_cansleep (config->mux_lpm_gpio,0 ); +gpio_free (config->mux_lpm_gpio); + }DBG ("gpio off" ); }return 0 ; +error6: +if (config->mux_sel_gpio !=-1 ) +gpio_free (config->mux_sel_gpio); error5:if (config->mux_en_gpio !=-1 )gpio_free (config->mux_en_gpio); --The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
v2 cover drm/msm/hdmi: enable lpm-mux if it is present
version 2 (response to Andreas' review):
- patch split into two (fix typo + new lpm-mux config)
- added my Signed-off-by in patches
Beeresh Gopal (2):
drm/msm/hdmi: enable lpm-mux if it is present
drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 23 ++++++++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v2 1/2 drm/msm/hdmi: enable lpm-mux if it is present
From: Beeresh Gopal <[email protected]>
lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.
--- drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+)
drivers/gpu/drm/msm/hdmi/hdmi.c +1 -0
@@ -294,6 +294,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) config.hpd_gpio =get_gpio ("qcom,hdmi-tx-hpd" ); config.mux_en_gpio =get_gpio ("qcom,hdmi-tx-mux-en" ); config.mux_sel_gpio =get_gpio ("qcom,hdmi-tx-mux-sel" ); + config.mux_lpm_gpio =get_gpio ("qcom,hdmi-tx-mux-lpm" ); config.shared_irq = true;#else
drivers/gpu/drm/msm/hdmi/hdmi.h +1 -0
@@ -95,6 +95,7 @@ struct hdmi_platform_config {/* gpio's: */ int ddc_clk_gpio, ddc_data_gpio, hpd_gpio, mux_en_gpio, mux_sel_gpio; +int mux_lpm_gpio;/* older devices had their own irq, mdp5+ it is shared w/ mdp: */ bool shared_irq;
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +21 -0
@@ -78,6 +78,19 @@ static int gpio_config(struct hdmi *hdmi, bool on) }gpio_set_value_cansleep (config->mux_sel_gpio,0 ); } + +if (config->mux_lpm_gpio !=-1 ) { + ret =gpio_request (config->mux_lpm_gpio, +"HDMI_MUX_LPM" ); +if (ret) { +dev_err (dev->dev, +"'%s'(%d) gpio_request failed: %d\n" , +"HDMI_MUX_LPM" , + config->mux_lpm_gpio, ret); + goto error6; + } +gpio_set_value_cansleep (config->mux_lpm_gpio,1 ); + }DBG ("gpio on" ); }else {gpio_free (config->ddc_clk_gpio);
@@ -93,11 +106,19 @@ static int gpio_config(struct hdmi *hdmi, bool on)gpio_set_value_cansleep (config->mux_sel_gpio,1 );gpio_free (config->mux_sel_gpio); } + +if (config->mux_lpm_gpio !=-1 ) { +gpio_set_value_cansleep (config->mux_lpm_gpio,0 ); +gpio_free (config->mux_lpm_gpio); + }DBG ("gpio off" ); }return 0 ; +error6: +if (config->mux_sel_gpio !=-1 ) +gpio_free (config->mux_sel_gpio); error5:if (config->mux_en_gpio !=-1 )gpio_free (config->mux_en_gpio);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v2 2/2 drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
In reply to Stephane ViauFrom: Beeresh Gopal <[email protected]>
HDMI_MUX_EN gpio is requested. If an error occurs, the same name should be printed (HDMI_MUX_EN) instead of HDMI_MUX_SEL (typo).
--- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +1 -1
@@ -63,7 +63,7 @@ static int gpio_config(struct hdmi *hdmi, bool on) ret =gpio_request (config->mux_en_gpio,"HDMI_MUX_EN" );if (ret) {dev_err (dev->dev,"'%s'(%d) gpio_request failed: %d\n" , -"HDMI_MUX_SEL" , config->mux_en_gpio, ret); +"HDMI_MUX_EN" , config->mux_en_gpio, ret); goto error4; }gpio_set_value_cansleep (config->mux_en_gpio,1 );
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [Freedreno] [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
Am 31.07.2014 17:48, schrieb Stephane Viau:
Quoted 7 lines
From: Beeresh Gopal <[email protected]>
HDMI_MUX_ENgpio is requested. If an error occurs, the same name should be printed (HDMI_MUX_EN) instead ofHDMI_MUX_SEL(typo).Signed-off-by Beeresh Gopal <[email protected]>Signed-off-by Stephane Viau <[email protected]>
Thanks,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg