mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Meghana Madhyastha <meghana.madhyastha@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Sean Paul <seanpaul@chromium.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v16 04/10] drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight
Date: Tue, 16 Jan 2018 17:59:41 +0100	[thread overview]
Message-ID: <409d8ee2-4312-c490-90e8-73ef16d2c9f9@tronnes.org> (raw)
In-Reply-To: <5644bff495cc2b06f40b61e70f285979b0512821.1516098341.git.meghana.madhyastha@gmail.com>


Den 16.01.2018 11.34, skrev Meghana Madhyastha:
> Remove tinydrm_of_find_backlight from tinydrm-helpers.c. We now have
> a generic of_find_backlight defined in backlight.c. Let the callers
> of tinydrm_of_find_backlight call of_find_backlight.
>
> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>

This patch needs rebasing, changes to mi0283qt.
You've missed st7735r.

I'd appreciate if you could also remove these from tinydrm/Kconfig:

     select BACKLIGHT_LCD_SUPPORT
     select BACKLIGHT_CLASS_DEVICE

It's an ugly hack that we don't need anymore thanks to your work!

With that fixed:
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

> ---
>   drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 40 --------------------------
>   drivers/gpu/drm/tinydrm/mi0283qt.c             |  3 +-
>   include/drm/tinydrm/tinydrm-helpers.h          |  2 --
>   3 files changed, 2 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
> index 7326e1758..d1c3ce9ab 100644
> --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
> +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
> @@ -236,46 +236,6 @@ void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb,
>   }
>   EXPORT_SYMBOL(tinydrm_xrgb8888_to_gray8);
>   
> -/**
> - * tinydrm_of_find_backlight - Find backlight device in device-tree
> - * @dev: Device
> - *
> - * This function looks for a DT node pointed to by a property named 'backlight'
> - * and uses of_find_backlight_by_node() to get the backlight device.
> - * Additionally if the brightness property is zero, it is set to
> - * max_brightness.
> - *
> - * Returns:
> - * NULL if there's no backlight property.
> - * Error pointer -EPROBE_DEFER if the DT node is found, but no backlight device
> - * is found.
> - * If the backlight device is found, a pointer to the structure is returned.
> - */
> -struct backlight_device *tinydrm_of_find_backlight(struct device *dev)
> -{
> -	struct backlight_device *backlight;
> -	struct device_node *np;
> -
> -	np = of_parse_phandle(dev->of_node, "backlight", 0);
> -	if (!np)
> -		return NULL;
> -
> -	backlight = of_find_backlight_by_node(np);
> -	of_node_put(np);
> -
> -	if (!backlight)
> -		return ERR_PTR(-EPROBE_DEFER);
> -
> -	if (!backlight->props.brightness) {
> -		backlight->props.brightness = backlight->props.max_brightness;
> -		DRM_DEBUG_KMS("Backlight brightness set to %d\n",
> -			      backlight->props.brightness);
> -	}
> -
> -	return backlight;
> -}
> -EXPORT_SYMBOL(tinydrm_of_find_backlight);
> -
>   #if IS_ENABLED(CONFIG_SPI)
>   
>   /**
> diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c
> index 674d40764..3f9065fb5 100644
> --- a/drivers/gpu/drm/tinydrm/mi0283qt.c
> +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
> @@ -14,6 +14,7 @@
>   #include <drm/tinydrm/ili9341.h>
>   #include <drm/tinydrm/mipi-dbi.h>
>   #include <drm/tinydrm/tinydrm-helpers.h>
> +#include <linux/backlight.h>
>   #include <linux/delay.h>
>   #include <linux/gpio/consumer.h>
>   #include <linux/module.h>
> @@ -190,7 +191,7 @@ static int mi0283qt_probe(struct spi_device *spi)
>   	if (IS_ERR(mipi->regulator))
>   		return PTR_ERR(mipi->regulator);
>   
> -	mipi->backlight = tinydrm_of_find_backlight(dev);
> +	mipi->backlight = of_find_backlight(dev);
>   	if (IS_ERR(mipi->backlight))
>   		return PTR_ERR(mipi->backlight);
>   
> diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h
> index f54fae03e..0a4ddbc04 100644
> --- a/include/drm/tinydrm/tinydrm-helpers.h
> +++ b/include/drm/tinydrm/tinydrm-helpers.h
> @@ -46,8 +46,6 @@ void tinydrm_xrgb8888_to_rgb565(u16 *dst, void *vaddr,
>   void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb,
>   			       struct drm_clip_rect *clip);
>   
> -struct backlight_device *tinydrm_of_find_backlight(struct device *dev);
> -
>   size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len);
>   bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw);
>   int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz,

  reply	other threads:[~2018-01-16 16:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 10:31 [PATCH v16 00/10] Add backlight helper functions Meghana Madhyastha
2018-01-16 10:31 ` [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight Meghana Madhyastha
2018-01-16 16:50   ` Noralf Trønnes
2018-01-17 17:00   ` Daniel Thompson
2018-01-17 21:24     ` Daniel Vetter
2018-01-17 22:03     ` Noralf Trønnes
2018-01-18 10:59       ` Meghana Madhyastha
2018-01-18 12:02         ` Daniel Thompson
2018-01-16 10:32 ` [PATCH v16 02/10] drm/tinydrm: Convert tinydrm_enable/disable_backlight to backlight_enable/disable Meghana Madhyastha
2018-01-16 16:51   ` Noralf Trønnes
2018-01-16 10:33 ` [PATCH v16 03/10] video: backlight: Add of_find_backlight helper in backlight.c Meghana Madhyastha
2018-01-16 16:56   ` Noralf Trønnes
2018-01-17 17:01   ` Daniel Thompson
2018-01-16 10:34 ` [PATCH v16 04/10] drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight Meghana Madhyastha
2018-01-16 16:59   ` Noralf Trønnes [this message]
2018-01-16 10:34 ` [PATCH v16 05/10] video: backlight: Add devres versions of of_find_backlight Meghana Madhyastha
2018-01-16 17:02   ` Noralf Trønnes
2018-01-17 17:09   ` Daniel Thompson
2018-01-18 11:02     ` Meghana Madhyastha
2018-01-18 11:50       ` Daniel Thompson
2018-01-16 10:34 ` [PATCH v16 06/10] drm/tinydrm: Call devres version " Meghana Madhyastha
2018-01-16 17:03   ` Noralf Trønnes
2018-01-16 10:35 ` [PATCH v16 07/10] drm/panel: Use backlight_enable/disable helpers Meghana Madhyastha
2018-01-16 17:11   ` Noralf Trønnes
2018-01-16 10:35 ` [PATCH v16 08/10] drm/omapdrm: " Meghana Madhyastha
2018-01-16 10:36 ` [PATCH v16 09/10] drm/panel: Use of_find_backlight helper Meghana Madhyastha
2018-01-16 17:08   ` Noralf Trønnes
2018-01-18 12:07     ` Meghana Madhyastha
2018-01-18 14:51       ` Noralf Trønnes
2018-01-16 10:36 ` [PATCH v16 10/10] drm/omapdrm: " Meghana Madhyastha
2018-01-16 21:46 ` [PATCH v16 00/10] Add backlight helper functions Sean Paul

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=409d8ee2-4312-c490-90e8-73ef16d2c9f9@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=daniel.thompson@linaro.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meghana.madhyastha@gmail.com \
    --cc=seanpaul@chromium.org \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®