All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianhua Lu <lujianhua000@gmail.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] drm/panel: nt36523: Get orientation from OF
Date: Thu, 13 Apr 2023 10:07:15 +0800	[thread overview]
Message-ID: <ZDdj04+RiBcOP9z0@Gentoo> (raw)
In-Reply-To: <20230412-topic-lenovopanel-v1-4-00b25df46824@linaro.org>

On Wed, Apr 12, 2023 at 09:46:01PM +0200, Konrad Dybcio wrote:
> Some bright vendors mount their display panels upside down. Add the
> required pieces to allow for accounting for that.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: Jianhua Lu <lujianhua000@gmail.com>
> ---
>  drivers/gpu/drm/panel/panel-novatek-nt36523.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> index 3c81ec014eef..db4b4af13ec1 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> @@ -31,6 +31,7 @@ struct panel_info {
>  	struct drm_panel panel;
>  	struct mipi_dsi_device *dsi[2];
>  	const struct panel_desc *desc;
> +	enum drm_panel_orientation orientation;
>  
>  	struct gpio_desc *reset_gpio;
>  	struct backlight_device *backlight;
> @@ -674,11 +675,19 @@ static int nt36523_get_modes(struct drm_panel *panel,
>  	return pinfo->desc->num_modes;
>  }
>  
> +static enum drm_panel_orientation nt36523_get_orientation(struct drm_panel *panel)
> +{
> +	struct panel_info *pinfo = to_panel_info(panel);
> +
> +	return pinfo->orientation;
> +}
> +
>  static const struct drm_panel_funcs nt36523_panel_funcs = {
>  	.disable = nt36523_disable,
>  	.prepare = nt36523_prepare,
>  	.unprepare = nt36523_unprepare,
>  	.get_modes = nt36523_get_modes,
> +	.get_orientation = nt36523_get_orientation,
>  };
>  
>  static int nt36523_bl_update_status(struct backlight_device *bl)
> @@ -784,6 +793,12 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
>  	mipi_dsi_set_drvdata(dsi, pinfo);
>  	drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI);
>  
> +	ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation);
> +	if (ret < 0) {
> +		dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
> +		return ret;
> +	}
> +
>  	if (pinfo->desc->has_dcs_backlight) {
>  		pinfo->panel.backlight = nt36523_create_backlight(dsi);
>  		if (IS_ERR(pinfo->panel.backlight))
> 
> -- 
> 2.40.0
> 

WARNING: multiple messages have this Message-ID (diff)
From: Jianhua Lu <lujianhua000@gmail.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	devicetree@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>
Subject: Re: [PATCH 4/5] drm/panel: nt36523: Get orientation from OF
Date: Thu, 13 Apr 2023 10:07:15 +0800	[thread overview]
Message-ID: <ZDdj04+RiBcOP9z0@Gentoo> (raw)
In-Reply-To: <20230412-topic-lenovopanel-v1-4-00b25df46824@linaro.org>

On Wed, Apr 12, 2023 at 09:46:01PM +0200, Konrad Dybcio wrote:
> Some bright vendors mount their display panels upside down. Add the
> required pieces to allow for accounting for that.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: Jianhua Lu <lujianhua000@gmail.com>
> ---
>  drivers/gpu/drm/panel/panel-novatek-nt36523.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> index 3c81ec014eef..db4b4af13ec1 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> @@ -31,6 +31,7 @@ struct panel_info {
>  	struct drm_panel panel;
>  	struct mipi_dsi_device *dsi[2];
>  	const struct panel_desc *desc;
> +	enum drm_panel_orientation orientation;
>  
>  	struct gpio_desc *reset_gpio;
>  	struct backlight_device *backlight;
> @@ -674,11 +675,19 @@ static int nt36523_get_modes(struct drm_panel *panel,
>  	return pinfo->desc->num_modes;
>  }
>  
> +static enum drm_panel_orientation nt36523_get_orientation(struct drm_panel *panel)
> +{
> +	struct panel_info *pinfo = to_panel_info(panel);
> +
> +	return pinfo->orientation;
> +}
> +
>  static const struct drm_panel_funcs nt36523_panel_funcs = {
>  	.disable = nt36523_disable,
>  	.prepare = nt36523_prepare,
>  	.unprepare = nt36523_unprepare,
>  	.get_modes = nt36523_get_modes,
> +	.get_orientation = nt36523_get_orientation,
>  };
>  
>  static int nt36523_bl_update_status(struct backlight_device *bl)
> @@ -784,6 +793,12 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
>  	mipi_dsi_set_drvdata(dsi, pinfo);
>  	drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI);
>  
> +	ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation);
> +	if (ret < 0) {
> +		dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret);
> +		return ret;
> +	}
> +
>  	if (pinfo->desc->has_dcs_backlight) {
>  		pinfo->panel.backlight = nt36523_create_backlight(dsi);
>  		if (IS_ERR(pinfo->panel.backlight))
> 
> -- 
> 2.40.0
> 

  reply	other threads:[~2023-04-13  2:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 19:45 [PATCH 0/5] Lenovo Tab P11 panel Konrad Dybcio
2023-04-12 19:45 ` Konrad Dybcio
2023-04-12 19:45 ` [PATCH 1/5] dt-bindings: display: panel: nt36523: Allow 'port' instead of 'ports' Konrad Dybcio
2023-04-12 19:45   ` Konrad Dybcio
2023-04-12 19:45 ` [PATCH 2/5] dt-bindings: display: panel: nt36523: Add Lenovo J606F panel Konrad Dybcio
2023-04-12 19:45   ` Konrad Dybcio
2023-04-13  7:27   ` Linus Walleij
2023-04-13  7:27     ` Linus Walleij
2023-04-12 19:46 ` [PATCH 3/5] drm/panel: nt36523: Add DCS backlight support Konrad Dybcio
2023-04-12 19:46   ` Konrad Dybcio
2023-04-13  1:58   ` Jianhua Lu
2023-04-13  1:58     ` Jianhua Lu
2023-04-13  7:29   ` Linus Walleij
2023-04-13  7:29     ` Linus Walleij
2023-04-12 19:46 ` [PATCH 4/5] drm/panel: nt36523: Get orientation from OF Konrad Dybcio
2023-04-12 19:46   ` Konrad Dybcio
2023-04-13  2:07   ` Jianhua Lu [this message]
2023-04-13  2:07     ` Jianhua Lu
2023-04-13  7:30   ` Linus Walleij
2023-04-13  7:30     ` Linus Walleij
2023-04-12 19:46 ` [PATCH 5/5] drm/panel: nt36523: Add Lenovo J606F panel Konrad Dybcio
2023-04-12 19:46   ` Konrad Dybcio
2023-04-13  2:17   ` Jianhua Lu
2023-04-13  2:17     ` Jianhua Lu
2023-04-13  7:36   ` Linus Walleij
2023-04-13  7:36     ` Linus Walleij

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=ZDdj04+RiBcOP9z0@Gentoo \
    --to=lujianhua000@gmail.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    /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.