All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Brian Masney <masneyb@onstation.org>
Cc: robdclark@gmail.com, sean@poorly.run, bjorn.andersson@linaro.org,
	a.hajda@samsung.com, airlied@linux.ie, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	jonathan@marek.ca
Subject: Re: [PATCH RFC v2 1/5] drm/bridge: analogix-anx78xx: add support for avdd33 regulator
Date: Mon, 7 Oct 2019 20:54:04 +0300	[thread overview]
Message-ID: <20191007175404.GH11781@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20191007014509.25180-2-masneyb@onstation.org>

Hi Brian,

Thank you for the patch.

On Sun, Oct 06, 2019 at 09:45:05PM -0400, Brian Masney wrote:
> Add support for the avdd33 regulator to the analogix-anx78xx driver.
> Note that the regulator is currently enabled during driver probe and
> disabled when the driver is removed. This is currently how the
> downstream MSM kernel sources do this.
> 
> Let's not merge this upstream for the mean time until I get the external
> display fully working on the Nexus 5 and then I can submit proper
> support then that powers down this regulator in the power off function.

Please then also update the corresponding DT bindings to describe the
avdd33 supply.

> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
> Changes since v1:
> - None
> 
>  drivers/gpu/drm/bridge/analogix-anx78xx.c | 33 +++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> index dec3f7e66aa0..e25fae36dbe1 100644
> --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
> +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> @@ -56,6 +56,7 @@ static const u8 anx781x_i2c_addresses[] = {
>  
>  struct anx78xx_platform_data {
>  	struct regulator *dvdd10;
> +	struct regulator *avdd33;
>  	struct gpio_desc *gpiod_hpd;
>  	struct gpio_desc *gpiod_pd;
>  	struct gpio_desc *gpiod_reset;
> @@ -715,10 +716,42 @@ static int anx78xx_start(struct anx78xx *anx78xx)
>  	return err;
>  }
>  
> +static void anx78xx_disable_regulator_action(void *_data)
> +{
> +	struct anx78xx_platform_data *pdata = _data;
> +
> +	regulator_disable(pdata->avdd33);
> +}
> +
>  static int anx78xx_init_pdata(struct anx78xx *anx78xx)
>  {
>  	struct anx78xx_platform_data *pdata = &anx78xx->pdata;
>  	struct device *dev = &anx78xx->client->dev;
> +	int err;
> +
> +	/* 3.3V digital core power regulator  */
> +	pdata->avdd33 = devm_regulator_get(dev, "avdd33");
> +	if (IS_ERR(pdata->avdd33)) {
> +		err = PTR_ERR(pdata->avdd33);
> +		if (err != -EPROBE_DEFER)
> +			DRM_ERROR("avdd33 regulator not found\n");
> +
> +		return err;
> +	}
> +
> +	err = regulator_enable(pdata->avdd33);
> +	if (err) {
> +		DRM_ERROR("Failed to enable avdd33 regulator: %d\n", err);
> +		return err;
> +	}
> +
> +	err = devm_add_action(dev, anx78xx_disable_regulator_action,
> +			      pdata);
> +	if (err < 0) {
> +		dev_err(dev, "Failed to setup regulator cleanup action %d\n",
> +			err);
> +		return err;
> +	}
>  
>  	/* 1.0V digital core power regulator  */
>  	pdata->dvdd10 = devm_regulator_get(dev, "dvdd10");

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Brian Masney <masneyb@onstation.org>
Cc: freedreno@lists.freedesktop.org, jonathan@marek.ca,
	airlied@linux.ie, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	bjorn.andersson@linaro.org, sean@poorly.run
Subject: Re: [PATCH RFC v2 1/5] drm/bridge: analogix-anx78xx: add support for avdd33 regulator
Date: Mon, 7 Oct 2019 20:54:04 +0300	[thread overview]
Message-ID: <20191007175404.GH11781@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20191007014509.25180-2-masneyb@onstation.org>

Hi Brian,

Thank you for the patch.

On Sun, Oct 06, 2019 at 09:45:05PM -0400, Brian Masney wrote:
> Add support for the avdd33 regulator to the analogix-anx78xx driver.
> Note that the regulator is currently enabled during driver probe and
> disabled when the driver is removed. This is currently how the
> downstream MSM kernel sources do this.
> 
> Let's not merge this upstream for the mean time until I get the external
> display fully working on the Nexus 5 and then I can submit proper
> support then that powers down this regulator in the power off function.

Please then also update the corresponding DT bindings to describe the
avdd33 supply.

> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
> Changes since v1:
> - None
> 
>  drivers/gpu/drm/bridge/analogix-anx78xx.c | 33 +++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> index dec3f7e66aa0..e25fae36dbe1 100644
> --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
> +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> @@ -56,6 +56,7 @@ static const u8 anx781x_i2c_addresses[] = {
>  
>  struct anx78xx_platform_data {
>  	struct regulator *dvdd10;
> +	struct regulator *avdd33;
>  	struct gpio_desc *gpiod_hpd;
>  	struct gpio_desc *gpiod_pd;
>  	struct gpio_desc *gpiod_reset;
> @@ -715,10 +716,42 @@ static int anx78xx_start(struct anx78xx *anx78xx)
>  	return err;
>  }
>  
> +static void anx78xx_disable_regulator_action(void *_data)
> +{
> +	struct anx78xx_platform_data *pdata = _data;
> +
> +	regulator_disable(pdata->avdd33);
> +}
> +
>  static int anx78xx_init_pdata(struct anx78xx *anx78xx)
>  {
>  	struct anx78xx_platform_data *pdata = &anx78xx->pdata;
>  	struct device *dev = &anx78xx->client->dev;
> +	int err;
> +
> +	/* 3.3V digital core power regulator  */
> +	pdata->avdd33 = devm_regulator_get(dev, "avdd33");
> +	if (IS_ERR(pdata->avdd33)) {
> +		err = PTR_ERR(pdata->avdd33);
> +		if (err != -EPROBE_DEFER)
> +			DRM_ERROR("avdd33 regulator not found\n");
> +
> +		return err;
> +	}
> +
> +	err = regulator_enable(pdata->avdd33);
> +	if (err) {
> +		DRM_ERROR("Failed to enable avdd33 regulator: %d\n", err);
> +		return err;
> +	}
> +
> +	err = devm_add_action(dev, anx78xx_disable_regulator_action,
> +			      pdata);
> +	if (err < 0) {
> +		dev_err(dev, "Failed to setup regulator cleanup action %d\n",
> +			err);
> +		return err;
> +	}
>  
>  	/* 1.0V digital core power regulator  */
>  	pdata->dvdd10 = devm_regulator_get(dev, "dvdd10");

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-10-07 17:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07  1:45 [PATCH RFC v2 0/5] drm/msm: external HDMI support for Nexus 5 phone Brian Masney
2019-10-07  1:45 ` Brian Masney
2019-10-07  1:45 ` [PATCH RFC v2 1/5] drm/bridge: analogix-anx78xx: add support for avdd33 regulator Brian Masney
2019-10-07  1:45   ` Brian Masney
2019-10-07 17:54   ` Laurent Pinchart [this message]
2019-10-07 17:54     ` Laurent Pinchart
2019-10-07  1:45 ` [PATCH RFC v2 2/5] drm/msm/hdmi: add msm8974 PLL support Brian Masney
2019-10-07  1:45   ` Brian Masney
2019-10-07  1:45 ` [PATCH RFC v2 3/5] ARM: dts: qcom: pm8941: add 5vs2 regulator node Brian Masney
2019-10-07  1:45   ` Brian Masney
2019-10-07  5:48   ` Bjorn Andersson
2019-10-07  1:45 ` [PATCH RFC v2 4/5] ARM: dts: qcom: msm8974: add HDMI nodes Brian Masney
2019-10-07  1:45   ` Brian Masney
2019-10-09  2:21   ` Stephen Boyd
2019-10-09  6:05     ` Brian Masney
2019-10-09 15:39       ` Stephen Boyd
2019-10-09 15:39       ` Stephen Boyd
2019-10-09 15:39         ` Stephen Boyd
2019-10-09 16:51         ` Brian Masney
     [not found]       ` <20191009060520.GA14506-1iNe0GrtECGEi8DpZVb4nw@public.gmane.org>
2019-10-09 15:39         ` Stephen Boyd
2019-10-07  1:45 ` [PATCH RFC v2 5/5] ARM: dts: qcom: msm8974-hammerhead: add support for external display Brian Masney
2019-10-07  1:45   ` Brian Masney
2019-10-09  2:25   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191007175404.GH11781@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.