linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm/hdmi: enable lpm-mux if it is present
@ 2014-07-31 14:46 Stephane Viau
  2014-07-31 15:06 ` Andreas Färber
  2014-07-31 15:19 ` Rob Clark
  0 siblings, 2 replies; 7+ messages in thread
From: Stephane Viau @ 2014-07-31 14:46 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-arm-msm, robdclark, Beeresh Gopal

From: Beeresh Gopal <gbeeresh@codeaurora.org>

lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.

Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
---
 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(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index bb1f696..f2c92e6 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -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
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index 0a077b0..323ceb7 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -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;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index 93d1551..1301d03 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/hdmi: enable lpm-mux if it is present
  2014-07-31 14:46 [PATCH] drm/msm/hdmi: enable lpm-mux if it is present Stephane Viau
@ 2014-07-31 15:06 ` Andreas Färber
  2014-07-31 15:19 ` Rob Clark
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2014-07-31 15:06 UTC (permalink / raw)
  To: Stephane Viau, dri-devel; +Cc: linux-arm-msm, robdclark, Beeresh Gopal

Hi,

Am 31.07.2014 16:46, schrieb Stephane Viau:
> From: Beeresh Gopal <gbeeresh@codeaurora.org>
> 
> lpm-mux is programmed to enable HDMI connector
> on the docking station for S805 chipset based
> devices.
> 
> Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>

You forgot to sign off yourself.

[...]
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> index 93d1551..1301d03 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> @@ -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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/msm/hdmi: enable lpm-mux if it is present
  2014-07-31 14:46 [PATCH] drm/msm/hdmi: enable lpm-mux if it is present Stephane Viau
  2014-07-31 15:06 ` Andreas Färber
@ 2014-07-31 15:19 ` Rob Clark
  2014-07-31 15:48   ` [PATCH V2 0/2] " Stephane Viau
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Clark @ 2014-07-31 15:19 UTC (permalink / raw)
  To: Stephane Viau
  Cc: dri-devel@lists.freedesktop.org, linux-arm-msm, Beeresh Gopal

On Thu, Jul 31, 2014 at 10:46 AM, Stephane Viau <sviau@codeaurora.org> wrote:
> From: Beeresh Gopal <gbeeresh@codeaurora.org>
>
> lpm-mux is programmed to enable HDMI connector
> on the docking station for S805 chipset based
> devices.
>
> Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>

other than the issues Andreas mentioned, it looks good, so with those addressed:

Reviewed-by: Rob Clark <robdclark@gmail.com>


> ---
>  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(-)
>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index bb1f696..f2c92e6 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -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
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
> index 0a077b0..323ceb7 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.h
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
> @@ -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;
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> index 93d1551..1301d03 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2 0/2] drm/msm/hdmi: enable lpm-mux if it is present
  2014-07-31 15:19 ` Rob Clark
@ 2014-07-31 15:48   ` Stephane Viau
  2014-07-31 15:48     ` [PATCH 1/2] " Stephane Viau
  2014-07-31 15:48     ` [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo Stephane Viau
  0 siblings, 2 replies; 7+ messages in thread
From: Stephane Viau @ 2014-07-31 15:48 UTC (permalink / raw)
  To: freedreno, robdclark; +Cc: linux-arm-msm, gbeeresh, Stephane Viau

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(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] drm/msm/hdmi: enable lpm-mux if it is present
  2014-07-31 15:48   ` [PATCH V2 0/2] " Stephane Viau
@ 2014-07-31 15:48     ` Stephane Viau
  2014-07-31 15:48     ` [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo Stephane Viau
  1 sibling, 0 replies; 7+ messages in thread
From: Stephane Viau @ 2014-07-31 15:48 UTC (permalink / raw)
  To: freedreno, robdclark; +Cc: linux-arm-msm, gbeeresh, Stephane Viau

From: Beeresh Gopal <gbeeresh@codeaurora.org>

lpm-mux is programmed to enable HDMI connector
on the docking station for S805 chipset based
devices.

Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
Signed-off-by: Stephane Viau <sviau@codeaurora.org>
---
 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(+)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index ae750f6..6229daf 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -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
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index 9fafee6..0fb0036 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -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;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index 7dedfdd..113c0f8 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
  2014-07-31 15:48   ` [PATCH V2 0/2] " Stephane Viau
  2014-07-31 15:48     ` [PATCH 1/2] " Stephane Viau
@ 2014-07-31 15:48     ` Stephane Viau
  2014-07-31 16:16       ` [Freedreno] " Andreas Färber
  1 sibling, 1 reply; 7+ messages in thread
From: Stephane Viau @ 2014-07-31 15:48 UTC (permalink / raw)
  To: freedreno, robdclark; +Cc: linux-arm-msm, gbeeresh, Stephane Viau

From: Beeresh Gopal <gbeeresh@codeaurora.org>

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).

Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
Signed-off-by: Stephane Viau <sviau@codeaurora.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index 113c0f8..8004082 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Freedreno] [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo
  2014-07-31 15:48     ` [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo Stephane Viau
@ 2014-07-31 16:16       ` Andreas Färber
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2014-07-31 16:16 UTC (permalink / raw)
  To: Stephane Viau, freedreno, robdclark; +Cc: linux-arm-msm, gbeeresh

Am 31.07.2014 17:48, schrieb Stephane Viau:
> From: Beeresh Gopal <gbeeresh@codeaurora.org>
> 
> 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).
> 
> Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
> Signed-off-by: Stephane Viau <sviau@codeaurora.org>

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-31 16:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 14:46 [PATCH] drm/msm/hdmi: enable lpm-mux if it is present Stephane Viau
2014-07-31 15:06 ` Andreas Färber
2014-07-31 15:19 ` Rob Clark
2014-07-31 15:48   ` [PATCH V2 0/2] " Stephane Viau
2014-07-31 15:48     ` [PATCH 1/2] " Stephane Viau
2014-07-31 15:48     ` [PATCH 2/2] drm/msm/hdmi: fix HDMI_MUX_EN gpio request typo Stephane Viau
2014-07-31 16:16       ` [Freedreno] " Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).