linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/9] backlight: gpio: simplify the driver
@ 2019-10-22  8:36 Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 1/9] backlight: gpio: remove unneeded include Bartosz Golaszewski
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

While working on my other series related to gpio-backlight[1] I noticed
that we could simplify the driver if we made the only user of platform
data use GPIO lookups and device properties. This series tries to do
that.

First two patches contain minor fixes. Third patch makes the driver
explicitly drive the GPIO line. Fourth patch adds all necessary data
structures to ecovec24. Patch 5/9 unifies much of the code for both
pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
fields. Last two patches contain additional improvements for the GPIO
backlight driver while we're already modifying it.

I don't have access to this HW but hopefully this works. Only compile
tested.

[1] https://lkml.org/lkml/2019/6/25/900

v1 -> v2:
- rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
- added additional two patches with minor improvements

v2 -> v3:
- in patch 7/7: used initializers to set values for pdata and dev local vars

v3 -> v4:
- rebased on top of v5.4-rc1
- removed changes that are no longer relevant after commit ec665b756e6f
  ("backlight: gpio-backlight: Correct initial power state handling")
- added patch 7/7

v4 -> v5:
- in patch 7/7: added a comment replacing the name of the function being
  pulled into probe()

v5 -> v6:
- added a patch making the driver explicitly set the direction of the GPIO
  to output
- added a patch removing a redundant newline

v6 -> v7:
- renamed the function calculating the new GPIO value for status update
- collected more tags

Bartosz Golaszewski (9):
  backlight: gpio: remove unneeded include
  backlight: gpio: remove stray newline
  backlight: gpio: explicitly set the direction of the GPIO
  sh: ecovec24: add additional properties to the backlight device
  backlight: gpio: simplify the platform data handling
  sh: ecovec24: don't set unused fields in platform data
  backlight: gpio: remove unused fields from platform data
  backlight: gpio: use a helper variable for &pdev->dev
  backlight: gpio: pull gpio_backlight_initial_power_state() into probe

 arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
 drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
 include/linux/platform_data/gpio_backlight.h |   3 -
 3 files changed, 69 insertions(+), 95 deletions(-)

-- 
2.23.0


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

* [PATCH v7 1/9] backlight: gpio: remove unneeded include
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 2/9] backlight: gpio: remove stray newline Bartosz Golaszewski
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We no longer use any symbols from of_gpio.h. Remove this include.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/video/backlight/gpio_backlight.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 18e053e4716c..7e1990199fae 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/platform_data/gpio_backlight.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
-- 
2.23.0


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

* [PATCH v7 2/9] backlight: gpio: remove stray newline
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 1/9] backlight: gpio: remove unneeded include Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO Bartosz Golaszewski
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev,
	Bartosz Golaszewski, Andy Shevchenko

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Remove a double newline from the driver.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 drivers/video/backlight/gpio_backlight.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 7e1990199fae..3955b513f2f8 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -91,7 +91,6 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
 	return FB_BLANK_UNBLANK;
 }
 
-
 static int gpio_backlight_probe(struct platform_device *pdev)
 {
 	struct gpio_backlight_platform_data *pdata =
-- 
2.23.0


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

* [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 1/9] backlight: gpio: remove unneeded include Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 2/9] backlight: gpio: remove stray newline Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22 10:14   ` Daniel Thompson
  2019-10-22  8:36 ` [PATCH v7 4/9] sh: ecovec24: add additional properties to the backlight device Bartosz Golaszewski
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The GPIO backlight driver currently requests the line 'as is', without
acively setting its direction. This can lead to problems: if the line
is in input mode by default, we won't be able to drive it later when
updating the status and also reading its initial value doesn't make
sense for backlight setting.

Request the line 'as is' initially, so that we can read its value
without affecting it but then change the direction to output explicitly
when setting the initial brightness.

Also: check the current direction and only read the value if it's output.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/video/backlight/gpio_backlight.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 3955b513f2f8..52f17c9ca1c3 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -25,9 +25,8 @@ struct gpio_backlight {
 	int def_value;
 };
 
-static int gpio_backlight_update_status(struct backlight_device *bl)
+static int gpio_backlight_get_next_brightness(struct backlight_device *bl)
 {
-	struct gpio_backlight *gbl = bl_get_data(bl);
 	int brightness = bl->props.brightness;
 
 	if (bl->props.power != FB_BLANK_UNBLANK ||
@@ -35,6 +34,14 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
 	    bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
 		brightness = 0;
 
+	return brightness;
+}
+
+static int gpio_backlight_update_status(struct backlight_device *bl)
+{
+	struct gpio_backlight *gbl = bl_get_data(bl);
+	int brightness = gpio_backlight_get_next_brightness(bl);
+
 	gpiod_set_value_cansleep(gbl->gpiod, brightness);
 
 	return 0;
@@ -85,7 +92,8 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
 		return gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
 
 	/* if the enable GPIO is disabled, do not enable the backlight */
-	if (gpiod_get_value_cansleep(gbl->gpiod) == 0)
+	if (gpiod_get_direction(gbl->gpiod) == 0 &&
+	    gpiod_get_value_cansleep(gbl->gpiod) == 0)
 		return FB_BLANK_POWERDOWN;
 
 	return FB_BLANK_UNBLANK;
@@ -98,7 +106,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 	struct backlight_properties props;
 	struct backlight_device *bl;
 	struct gpio_backlight *gbl;
-	int ret;
+	int ret, init_brightness;
 
 	gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
 	if (gbl == NULL)
@@ -151,7 +159,12 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 	bl->props.power = gpio_backlight_initial_power_state(gbl);
 	bl->props.brightness = 1;
 
-	backlight_update_status(bl);
+	init_brightness = gpio_backlight_get_next_brightness(bl);
+	ret = gpiod_direction_output(gbl->gpiod, init_brightness);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to set initial brightness\n");
+		return ret;
+	}
 
 	platform_set_drvdata(pdev, bl);
 	return 0;
-- 
2.23.0


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

* [PATCH v7 4/9] sh: ecovec24: add additional properties to the backlight device
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 5/9] backlight: gpio: simplify the platform data handling Bartosz Golaszewski
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Add a GPIO lookup entry and a device property for GPIO backlight to the
board file. Tie them to the platform device which is now registered using
platform_device_register_full() because of the properties. These changes
are inactive now but will be used once the gpio backlight driver is
modified.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/sh/boards/mach-ecovec24/setup.c | 30 +++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index acaa97459531..aaa8ea62636f 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -371,6 +371,19 @@ static struct platform_device lcdc_device = {
 	},
 };
 
+static struct gpiod_lookup_table gpio_backlight_lookup = {
+	.dev_id		= "gpio-backlight.0",
+	.table = {
+		GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH),
+		{ }
+	},
+};
+
+static struct property_entry gpio_backlight_props[] = {
+	PROPERTY_ENTRY_BOOL("default-on"),
+	{ }
+};
+
 static struct gpio_backlight_platform_data gpio_backlight_data = {
 	.fbdev = &lcdc_device.dev,
 	.gpio = GPIO_PTR1,
@@ -378,13 +391,15 @@ static struct gpio_backlight_platform_data gpio_backlight_data = {
 	.name = "backlight",
 };
 
-static struct platform_device gpio_backlight_device = {
+static const struct platform_device_info gpio_backlight_device_info = {
 	.name = "gpio-backlight",
-	.dev = {
-		.platform_data = &gpio_backlight_data,
-	},
+	.data = &gpio_backlight_data,
+	.size_data = sizeof(gpio_backlight_data),
+	.properties = gpio_backlight_props,
 };
 
+static struct platform_device *gpio_backlight_device;
+
 /* CEU0 */
 static struct ceu_platform_data ceu0_pdata = {
 	.num_subdevs			= 2,
@@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
 	&usb1_common_device,
 	&usbhs_device,
 	&lcdc_device,
-	&gpio_backlight_device,
 	&keysc_device,
 	&cn12_power,
 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
@@ -1462,6 +1476,12 @@ static int __init arch_setup(void)
 #endif
 #endif
 
+	gpiod_add_lookup_table(&gpio_backlight_lookup);
+	gpio_backlight_device = platform_device_register_full(
+					&gpio_backlight_device_info);
+	if (IS_ERR(gpio_backlight_device))
+		return PTR_ERR(gpio_backlight_device);
+
 	return platform_add_devices(ecovec_devices,
 				    ARRAY_SIZE(ecovec_devices));
 }
-- 
2.23.0


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

* [PATCH v7 5/9] backlight: gpio: simplify the platform data handling
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 4/9] sh: ecovec24: add additional properties to the backlight device Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 6/9] sh: ecovec24: don't set unused fields in platform data Bartosz Golaszewski
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Now that the last user of platform data (sh ecovec24) defines a proper
GPIO lookup and sets the 'default-on' device property, we can drop the
platform_data-specific GPIO handling and unify a big chunk of code.

The only field used from the platform data is now the fbdev pointer.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/video/backlight/gpio_backlight.c | 62 +++++-------------------
 1 file changed, 11 insertions(+), 51 deletions(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 52f17c9ca1c3..ddc7d3b288b7 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -6,7 +6,6 @@
 #include <linux/backlight.h>
 #include <linux/err.h>
 #include <linux/fb.h>
-#include <linux/gpio.h> /* Only for legacy support */
 #include <linux/gpio/consumer.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -61,28 +60,6 @@ static const struct backlight_ops gpio_backlight_ops = {
 	.check_fb	= gpio_backlight_check_fb,
 };
 
-static int gpio_backlight_probe_dt(struct platform_device *pdev,
-				   struct gpio_backlight *gbl)
-{
-	struct device *dev = &pdev->dev;
-	int ret;
-
-	gbl->def_value = device_property_read_bool(dev, "default-on");
-
-	gbl->gpiod = devm_gpiod_get(dev, NULL, GPIOD_ASIS);
-	if (IS_ERR(gbl->gpiod)) {
-		ret = PTR_ERR(gbl->gpiod);
-
-		if (ret != -EPROBE_DEFER) {
-			dev_err(dev,
-				"Error: The gpios parameter is missing or invalid.\n");
-		}
-		return ret;
-	}
-
-	return 0;
-}
-
 static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
 {
 	struct device_node *node = gbl->dev->of_node;
@@ -114,35 +91,18 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 
 	gbl->dev = &pdev->dev;
 
-	if (pdev->dev.fwnode) {
-		ret = gpio_backlight_probe_dt(pdev, gbl);
-		if (ret)
-			return ret;
-	} else if (pdata) {
-		/*
-		 * Legacy platform data GPIO retrieveal. Do not expand
-		 * the use of this code path, currently only used by one
-		 * SH board.
-		 */
-		unsigned long flags = GPIOF_DIR_OUT;
-
+	if (pdata)
 		gbl->fbdev = pdata->fbdev;
-		gbl->def_value = pdata->def_value;
-		flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW;
-
-		ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags,
-					    pdata ? pdata->name : "backlight");
-		if (ret < 0) {
-			dev_err(&pdev->dev, "unable to request GPIO\n");
-			return ret;
-		}
-		gbl->gpiod = gpio_to_desc(pdata->gpio);
-		if (!gbl->gpiod)
-			return -EINVAL;
-	} else {
-		dev_err(&pdev->dev,
-			"failed to find platform data or device tree node.\n");
-		return -ENODEV;
+
+	gbl->def_value = device_property_read_bool(&pdev->dev, "default-on");
+
+	gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
+	if (IS_ERR(gbl->gpiod)) {
+		ret = PTR_ERR(gbl->gpiod);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev,
+				"Error: The gpios parameter is missing or invalid.\n");
+		return ret;
 	}
 
 	memset(&props, 0, sizeof(props));
-- 
2.23.0


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

* [PATCH v7 6/9] sh: ecovec24: don't set unused fields in platform data
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (4 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 5/9] backlight: gpio: simplify the platform data handling Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 7/9] backlight: gpio: remove unused fields from " Bartosz Golaszewski
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Platform data fields other than fbdev are no longer used by the
backlight driver. Remove them.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/sh/boards/mach-ecovec24/setup.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index aaa8ea62636f..dd427bac5cde 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -386,9 +386,6 @@ static struct property_entry gpio_backlight_props[] = {
 
 static struct gpio_backlight_platform_data gpio_backlight_data = {
 	.fbdev = &lcdc_device.dev,
-	.gpio = GPIO_PTR1,
-	.def_value = 1,
-	.name = "backlight",
 };
 
 static const struct platform_device_info gpio_backlight_device_info = {
-- 
2.23.0


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

* [PATCH v7 7/9] backlight: gpio: remove unused fields from platform data
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (5 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 6/9] sh: ecovec24: don't set unused fields in platform data Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 8/9] backlight: gpio: use a helper variable for &pdev->dev Bartosz Golaszewski
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Remove the platform data fields that nobody uses.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 include/linux/platform_data/gpio_backlight.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
index 34179d600360..1a8b5b1946fe 100644
--- a/include/linux/platform_data/gpio_backlight.h
+++ b/include/linux/platform_data/gpio_backlight.h
@@ -9,9 +9,6 @@ struct device;
 
 struct gpio_backlight_platform_data {
 	struct device *fbdev;
-	int gpio;
-	int def_value;
-	const char *name;
 };
 
 #endif
-- 
2.23.0


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

* [PATCH v7 8/9] backlight: gpio: use a helper variable for &pdev->dev
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (6 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 7/9] backlight: gpio: remove unused fields from " Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  8:36 ` [PATCH v7 9/9] backlight: gpio: pull gpio_backlight_initial_power_state() into probe Bartosz Golaszewski
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Instead of dereferencing pdev each time, use a helper variable for
the associated device pointer.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/video/backlight/gpio_backlight.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index ddc7d3b288b7..d6969fae25cd 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -78,29 +78,29 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
 
 static int gpio_backlight_probe(struct platform_device *pdev)
 {
-	struct gpio_backlight_platform_data *pdata =
-		dev_get_platdata(&pdev->dev);
+	struct device *dev = &pdev->dev;
+	struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev);
 	struct backlight_properties props;
 	struct backlight_device *bl;
 	struct gpio_backlight *gbl;
 	int ret, init_brightness;
 
-	gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
+	gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL);
 	if (gbl == NULL)
 		return -ENOMEM;
 
-	gbl->dev = &pdev->dev;
+	gbl->dev = dev;
 
 	if (pdata)
 		gbl->fbdev = pdata->fbdev;
 
-	gbl->def_value = device_property_read_bool(&pdev->dev, "default-on");
+	gbl->def_value = device_property_read_bool(dev, "default-on");
 
-	gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
+	gbl->gpiod = devm_gpiod_get(dev, NULL, GPIOD_ASIS);
 	if (IS_ERR(gbl->gpiod)) {
 		ret = PTR_ERR(gbl->gpiod);
 		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev,
+			dev_err(dev,
 				"Error: The gpios parameter is missing or invalid.\n");
 		return ret;
 	}
@@ -108,11 +108,10 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 	memset(&props, 0, sizeof(props));
 	props.type = BACKLIGHT_RAW;
 	props.max_brightness = 1;
-	bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
-					&pdev->dev, gbl, &gpio_backlight_ops,
-					&props);
+	bl = devm_backlight_device_register(dev, dev_name(dev), dev, gbl,
+					    &gpio_backlight_ops, &props);
 	if (IS_ERR(bl)) {
-		dev_err(&pdev->dev, "failed to register backlight\n");
+		dev_err(dev, "failed to register backlight\n");
 		return PTR_ERR(bl);
 	}
 
@@ -122,7 +121,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 	init_brightness = gpio_backlight_get_next_brightness(bl);
 	ret = gpiod_direction_output(gbl->gpiod, init_brightness);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to set initial brightness\n");
+		dev_err(dev, "failed to set initial brightness\n");
 		return ret;
 	}
 
-- 
2.23.0


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

* [PATCH v7 9/9] backlight: gpio: pull gpio_backlight_initial_power_state() into probe
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (7 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 8/9] backlight: gpio: use a helper variable for &pdev->dev Bartosz Golaszewski
@ 2019-10-22  8:36 ` Bartosz Golaszewski
  2019-10-22  9:29 ` [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
  2019-11-11 11:41 ` Lee Jones
  10 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  8:36 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: linux-sh, linux-kernel, dri-devel, linux-fbdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The probe function in the gpio-backlight driver is quite short. If we
pull gpio_backlight_initial_power_state() into probe we can drop two
more fields from struct gpio_backlight and shrink the driver code.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 drivers/video/backlight/gpio_backlight.c | 38 +++++++++---------------
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index d6969fae25cd..75409ddfba3e 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -17,11 +17,8 @@
 #include <linux/slab.h>
 
 struct gpio_backlight {
-	struct device *dev;
 	struct device *fbdev;
-
 	struct gpio_desc *gpiod;
-	int def_value;
 };
 
 static int gpio_backlight_get_next_brightness(struct backlight_device *bl)
@@ -60,41 +57,24 @@ static const struct backlight_ops gpio_backlight_ops = {
 	.check_fb	= gpio_backlight_check_fb,
 };
 
-static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
-{
-	struct device_node *node = gbl->dev->of_node;
-
-	/* Not booted with device tree or no phandle link to the node */
-	if (!node || !node->phandle)
-		return gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
-
-	/* if the enable GPIO is disabled, do not enable the backlight */
-	if (gpiod_get_direction(gbl->gpiod) == 0 &&
-	    gpiod_get_value_cansleep(gbl->gpiod) == 0)
-		return FB_BLANK_POWERDOWN;
-
-	return FB_BLANK_UNBLANK;
-}
-
 static int gpio_backlight_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev);
+	struct device_node *of_node = dev->of_node;
 	struct backlight_properties props;
 	struct backlight_device *bl;
 	struct gpio_backlight *gbl;
-	int ret, init_brightness;
+	int ret, init_brightness, def_value;
 
 	gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL);
 	if (gbl == NULL)
 		return -ENOMEM;
 
-	gbl->dev = dev;
-
 	if (pdata)
 		gbl->fbdev = pdata->fbdev;
 
-	gbl->def_value = device_property_read_bool(dev, "default-on");
+	def_value = device_property_read_bool(dev, "default-on");
 
 	gbl->gpiod = devm_gpiod_get(dev, NULL, GPIOD_ASIS);
 	if (IS_ERR(gbl->gpiod)) {
@@ -115,7 +95,17 @@ static int gpio_backlight_probe(struct platform_device *pdev)
 		return PTR_ERR(bl);
 	}
 
-	bl->props.power = gpio_backlight_initial_power_state(gbl);
+	/* Set the initial power state */
+	if (!of_node || !of_node->phandle)
+		/* Not booted with device tree or no phandle link to the node */
+		bl->props.power = def_value ? FB_BLANK_UNBLANK
+					    : FB_BLANK_POWERDOWN;
+	else if (gpiod_get_direction(gbl->gpiod) == 0 &&
+		 gpiod_get_value_cansleep(gbl->gpiod) == 0)
+		bl->props.power = FB_BLANK_POWERDOWN;
+	else
+		bl->props.power = FB_BLANK_UNBLANK;
+
 	bl->props.brightness = 1;
 
 	init_brightness = gpio_backlight_get_next_brightness(bl);
-- 
2.23.0


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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (8 preceding siblings ...)
  2019-10-22  8:36 ` [PATCH v7 9/9] backlight: gpio: pull gpio_backlight_initial_power_state() into probe Bartosz Golaszewski
@ 2019-10-22  9:29 ` Bartosz Golaszewski
  2019-10-23 15:59   ` Daniel Thompson
  2019-11-11 11:41 ` Lee Jones
  10 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-10-22  9:29 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Lee Jones, Daniel Thompson,
	Jingoo Han, Bartlomiej Zolnierkiewicz, Linus Walleij,
	Andy Shevchenko, Jacopo Mondi
  Cc: Linux-sh list, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Linux Fbdev development list,
	Bartosz Golaszewski

wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
>
> First two patches contain minor fixes. Third patch makes the driver
> explicitly drive the GPIO line. Fourth patch adds all necessary data
> structures to ecovec24. Patch 5/9 unifies much of the code for both
> pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> fields. Last two patches contain additional improvements for the GPIO
> backlight driver while we're already modifying it.
>
> I don't have access to this HW but hopefully this works. Only compile
> tested.
>
> [1] https://lkml.org/lkml/2019/6/25/900
>
> v1 -> v2:
> - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> - added additional two patches with minor improvements
>
> v2 -> v3:
> - in patch 7/7: used initializers to set values for pdata and dev local vars
>
> v3 -> v4:
> - rebased on top of v5.4-rc1
> - removed changes that are no longer relevant after commit ec665b756e6f
>   ("backlight: gpio-backlight: Correct initial power state handling")
> - added patch 7/7
>
> v4 -> v5:
> - in patch 7/7: added a comment replacing the name of the function being
>   pulled into probe()
>
> v5 -> v6:
> - added a patch making the driver explicitly set the direction of the GPIO
>   to output
> - added a patch removing a redundant newline
>
> v6 -> v7:
> - renamed the function calculating the new GPIO value for status update
> - collected more tags
>
> Bartosz Golaszewski (9):
>   backlight: gpio: remove unneeded include
>   backlight: gpio: remove stray newline
>   backlight: gpio: explicitly set the direction of the GPIO
>   sh: ecovec24: add additional properties to the backlight device
>   backlight: gpio: simplify the platform data handling
>   sh: ecovec24: don't set unused fields in platform data
>   backlight: gpio: remove unused fields from platform data
>   backlight: gpio: use a helper variable for &pdev->dev
>   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
>
>  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
>  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
>  include/linux/platform_data/gpio_backlight.h |   3 -
>  3 files changed, 69 insertions(+), 95 deletions(-)
>
> --
> 2.23.0
>

Lee, Daniel, Jingoo,

Jacopo is travelling until November 1st and won't be able to test this
again before this date. Do you think you can pick it up and in case
anything's broken on SH, we can fix it after v5.5-rc1, so that it
doesn't miss another merge window?

Bart

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

* Re: [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO
  2019-10-22  8:36 ` [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO Bartosz Golaszewski
@ 2019-10-22 10:14   ` Daniel Thompson
  0 siblings, 0 replies; 22+ messages in thread
From: Daniel Thompson @ 2019-10-22 10:14 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Yoshinori Sato, Rich Felker, Lee Jones, Jingoo Han,
	Bartlomiej Zolnierkiewicz, Linus Walleij, Andy Shevchenko,
	Jacopo Mondi, linux-sh, linux-kernel, dri-devel, linux-fbdev,
	Bartosz Golaszewski

On Tue, Oct 22, 2019 at 10:36:24AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> The GPIO backlight driver currently requests the line 'as is', without
> acively setting its direction. This can lead to problems: if the line
> is in input mode by default, we won't be able to drive it later when
> updating the status and also reading its initial value doesn't make
> sense for backlight setting.
> 
> Request the line 'as is' initially, so that we can read its value
> without affecting it but then change the direction to output explicitly
> when setting the initial brightness.
> 
> Also: check the current direction and only read the value if it's output.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>

> ---
>  drivers/video/backlight/gpio_backlight.c | 23 ++++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
> index 3955b513f2f8..52f17c9ca1c3 100644
> --- a/drivers/video/backlight/gpio_backlight.c
> +++ b/drivers/video/backlight/gpio_backlight.c
> @@ -25,9 +25,8 @@ struct gpio_backlight {
>  	int def_value;
>  };
>  
> -static int gpio_backlight_update_status(struct backlight_device *bl)
> +static int gpio_backlight_get_next_brightness(struct backlight_device *bl)
>  {
> -	struct gpio_backlight *gbl = bl_get_data(bl);
>  	int brightness = bl->props.brightness;
>  
>  	if (bl->props.power != FB_BLANK_UNBLANK ||
> @@ -35,6 +34,14 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
>  	    bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
>  		brightness = 0;
>  
> +	return brightness;
> +}
> +
> +static int gpio_backlight_update_status(struct backlight_device *bl)
> +{
> +	struct gpio_backlight *gbl = bl_get_data(bl);
> +	int brightness = gpio_backlight_get_next_brightness(bl);
> +
>  	gpiod_set_value_cansleep(gbl->gpiod, brightness);
>  
>  	return 0;
> @@ -85,7 +92,8 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
>  		return gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
>  
>  	/* if the enable GPIO is disabled, do not enable the backlight */
> -	if (gpiod_get_value_cansleep(gbl->gpiod) == 0)
> +	if (gpiod_get_direction(gbl->gpiod) == 0 &&
> +	    gpiod_get_value_cansleep(gbl->gpiod) == 0)
>  		return FB_BLANK_POWERDOWN;
>  
>  	return FB_BLANK_UNBLANK;
> @@ -98,7 +106,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
>  	struct backlight_properties props;
>  	struct backlight_device *bl;
>  	struct gpio_backlight *gbl;
> -	int ret;
> +	int ret, init_brightness;
>  
>  	gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
>  	if (gbl == NULL)
> @@ -151,7 +159,12 @@ static int gpio_backlight_probe(struct platform_device *pdev)
>  	bl->props.power = gpio_backlight_initial_power_state(gbl);
>  	bl->props.brightness = 1;
>  
> -	backlight_update_status(bl);
> +	init_brightness = gpio_backlight_get_next_brightness(bl);
> +	ret = gpiod_direction_output(gbl->gpiod, init_brightness);
> +	if (ret) {
> +		dev_err(&pdev->dev, "failed to set initial brightness\n");
> +		return ret;
> +	}
>  
>  	platform_set_drvdata(pdev, bl);
>  	return 0;
> -- 
> 2.23.0
> 

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-22  9:29 ` [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
@ 2019-10-23 15:59   ` Daniel Thompson
  2019-10-24  6:47     ` Lee Jones
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Thompson @ 2019-10-23 15:59 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Yoshinori Sato, Rich Felker, Lee Jones, Jingoo Han,
	Bartlomiej Zolnierkiewicz, Linus Walleij, Andy Shevchenko,
	Jacopo Mondi, Linux-sh list, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Linux Fbdev development list,
	Bartosz Golaszewski

On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> >
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > While working on my other series related to gpio-backlight[1] I noticed
> > that we could simplify the driver if we made the only user of platform
> > data use GPIO lookups and device properties. This series tries to do
> > that.
> >
> > First two patches contain minor fixes. Third patch makes the driver
> > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > fields. Last two patches contain additional improvements for the GPIO
> > backlight driver while we're already modifying it.
> >
> > I don't have access to this HW but hopefully this works. Only compile
> > tested.
> >
> > [1] https://lkml.org/lkml/2019/6/25/900
> >
> > v1 -> v2:
> > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > - added additional two patches with minor improvements
> >
> > v2 -> v3:
> > - in patch 7/7: used initializers to set values for pdata and dev local vars
> >
> > v3 -> v4:
> > - rebased on top of v5.4-rc1
> > - removed changes that are no longer relevant after commit ec665b756e6f
> >   ("backlight: gpio-backlight: Correct initial power state handling")
> > - added patch 7/7
> >
> > v4 -> v5:
> > - in patch 7/7: added a comment replacing the name of the function being
> >   pulled into probe()
> >
> > v5 -> v6:
> > - added a patch making the driver explicitly set the direction of the GPIO
> >   to output
> > - added a patch removing a redundant newline
> >
> > v6 -> v7:
> > - renamed the function calculating the new GPIO value for status update
> > - collected more tags
> >
> > Bartosz Golaszewski (9):
> >   backlight: gpio: remove unneeded include
> >   backlight: gpio: remove stray newline
> >   backlight: gpio: explicitly set the direction of the GPIO
> >   sh: ecovec24: add additional properties to the backlight device
> >   backlight: gpio: simplify the platform data handling
> >   sh: ecovec24: don't set unused fields in platform data
> >   backlight: gpio: remove unused fields from platform data
> >   backlight: gpio: use a helper variable for &pdev->dev
> >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> >
> >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> >  include/linux/platform_data/gpio_backlight.h |   3 -
> >  3 files changed, 69 insertions(+), 95 deletions(-)
> >
> > --
> > 2.23.0
> >
> 
> Lee, Daniel, Jingoo,
> 
> Jacopo is travelling until November 1st and won't be able to test this
> again before this date. Do you think you can pick it up and in case
> anything's broken on SH, we can fix it after v5.5-rc1, so that it
> doesn't miss another merge window?

Outside of holidays and other emergencies Lee usually collects up the
patches for backlight. I'm not sure when he plans to close things for
v5.5 .


Daniel.

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-23 15:59   ` Daniel Thompson
@ 2019-10-24  6:47     ` Lee Jones
  2019-10-24  7:17       ` Jacopo Mondi
  0 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2019-10-24  6:47 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Bartosz Golaszewski, Yoshinori Sato, Rich Felker, Jingoo Han,
	Bartlomiej Zolnierkiewicz, Linus Walleij, Andy Shevchenko,
	Jacopo Mondi, Linux-sh list, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Linux Fbdev development list,
	Bartosz Golaszewski

On Wed, 23 Oct 2019, Daniel Thompson wrote:

> On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > >
> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > >
> > > While working on my other series related to gpio-backlight[1] I noticed
> > > that we could simplify the driver if we made the only user of platform
> > > data use GPIO lookups and device properties. This series tries to do
> > > that.
> > >
> > > First two patches contain minor fixes. Third patch makes the driver
> > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > fields. Last two patches contain additional improvements for the GPIO
> > > backlight driver while we're already modifying it.
> > >
> > > I don't have access to this HW but hopefully this works. Only compile
> > > tested.
> > >
> > > [1] https://lkml.org/lkml/2019/6/25/900
> > >
> > > v1 -> v2:
> > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > - added additional two patches with minor improvements
> > >
> > > v2 -> v3:
> > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > >
> > > v3 -> v4:
> > > - rebased on top of v5.4-rc1
> > > - removed changes that are no longer relevant after commit ec665b756e6f
> > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > - added patch 7/7
> > >
> > > v4 -> v5:
> > > - in patch 7/7: added a comment replacing the name of the function being
> > >   pulled into probe()
> > >
> > > v5 -> v6:
> > > - added a patch making the driver explicitly set the direction of the GPIO
> > >   to output
> > > - added a patch removing a redundant newline
> > >
> > > v6 -> v7:
> > > - renamed the function calculating the new GPIO value for status update
> > > - collected more tags
> > >
> > > Bartosz Golaszewski (9):
> > >   backlight: gpio: remove unneeded include
> > >   backlight: gpio: remove stray newline
> > >   backlight: gpio: explicitly set the direction of the GPIO
> > >   sh: ecovec24: add additional properties to the backlight device
> > >   backlight: gpio: simplify the platform data handling
> > >   sh: ecovec24: don't set unused fields in platform data
> > >   backlight: gpio: remove unused fields from platform data
> > >   backlight: gpio: use a helper variable for &pdev->dev
> > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > >
> > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > >
> > >
> > 
> > Lee, Daniel, Jingoo,
> > 
> > Jacopo is travelling until November 1st and won't be able to test this
> > again before this date. Do you think you can pick it up and in case
> > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > doesn't miss another merge window?

November 1st (-rc6) will be fine.

I'd rather apply it late-tested than early-non-tested.

Hopefully Jacopo can prioritise testing this on Thursday or Friday,
since Monday will be -rc7 which is really cutting it fine.

> Outside of holidays and other emergencies Lee usually collects up the
> patches for backlight. I'm not sure when he plans to close things for
> v5.5.

In special cases such as these I can remain flexible.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-24  6:47     ` Lee Jones
@ 2019-10-24  7:17       ` Jacopo Mondi
  2019-10-24 12:10         ` Lee Jones
  2019-11-01  8:58         ` Lee Jones
  0 siblings, 2 replies; 22+ messages in thread
From: Jacopo Mondi @ 2019-10-24  7:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Daniel Thompson, Bartosz Golaszewski, Yoshinori Sato,
	Rich Felker, Jingoo Han, Bartlomiej Zolnierkiewicz,
	Linus Walleij, Andy Shevchenko, Linux-sh list,
	Linux Kernel Mailing List, open list:DRM PANEL DRIVERS,
	Linux Fbdev development list, Bartosz Golaszewski

[-- Attachment #1: Type: text/plain, Size: 4171 bytes --]

Hello,

On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> On Wed, 23 Oct 2019, Daniel Thompson wrote:
>
> > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > >
> > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > >
> > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > that we could simplify the driver if we made the only user of platform
> > > > data use GPIO lookups and device properties. This series tries to do
> > > > that.
> > > >
> > > > First two patches contain minor fixes. Third patch makes the driver
> > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > fields. Last two patches contain additional improvements for the GPIO
> > > > backlight driver while we're already modifying it.
> > > >
> > > > I don't have access to this HW but hopefully this works. Only compile
> > > > tested.
> > > >
> > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > >
> > > > v1 -> v2:
> > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > - added additional two patches with minor improvements
> > > >
> > > > v2 -> v3:
> > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > >
> > > > v3 -> v4:
> > > > - rebased on top of v5.4-rc1
> > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > - added patch 7/7
> > > >
> > > > v4 -> v5:
> > > > - in patch 7/7: added a comment replacing the name of the function being
> > > >   pulled into probe()
> > > >
> > > > v5 -> v6:
> > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > >   to output
> > > > - added a patch removing a redundant newline
> > > >
> > > > v6 -> v7:
> > > > - renamed the function calculating the new GPIO value for status update
> > > > - collected more tags
> > > >
> > > > Bartosz Golaszewski (9):
> > > >   backlight: gpio: remove unneeded include
> > > >   backlight: gpio: remove stray newline
> > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > >   sh: ecovec24: add additional properties to the backlight device
> > > >   backlight: gpio: simplify the platform data handling
> > > >   sh: ecovec24: don't set unused fields in platform data
> > > >   backlight: gpio: remove unused fields from platform data
> > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > >
> > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > >
> > > >
> > >
> > > Lee, Daniel, Jingoo,
> > >
> > > Jacopo is travelling until November 1st and won't be able to test this
> > > again before this date. Do you think you can pick it up and in case
> > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > doesn't miss another merge window?
>
> November 1st (-rc6) will be fine.
>
> I'd rather apply it late-tested than early-non-tested.
>
> Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> since Monday will be -rc7 which is really cutting it fine.

I'll do my best, I'll get home Friday late afternoon :)


>
> > Outside of holidays and other emergencies Lee usually collects up the
> > patches for backlight. I'm not sure when he plans to close things for
> > v5.5.
>
> In special cases such as these I can remain flexible.
>
> --
> Lee Jones [李琼斯]
> Linaro Services Technical Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-24  7:17       ` Jacopo Mondi
@ 2019-10-24 12:10         ` Lee Jones
  2019-11-01  8:58         ` Lee Jones
  1 sibling, 0 replies; 22+ messages in thread
From: Lee Jones @ 2019-10-24 12:10 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Daniel Thompson, Bartosz Golaszewski, Yoshinori Sato,
	Rich Felker, Jingoo Han, Bartlomiej Zolnierkiewicz,
	Linus Walleij, Andy Shevchenko, Linux-sh list,
	Linux Kernel Mailing List, open list:DRM PANEL DRIVERS,
	Linux Fbdev development list, Bartosz Golaszewski

On Thu, 24 Oct 2019, Jacopo Mondi wrote:
> On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > On Wed, 23 Oct 2019, Daniel Thompson wrote:

[...]

> > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > again before this date. Do you think you can pick it up and in case
> > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > doesn't miss another merge window?
> >
> > November 1st (-rc6) will be fine.
> >
> > I'd rather apply it late-tested than early-non-tested.
> >
> > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > since Monday will be -rc7 which is really cutting it fine.
> 
> I'll do my best, I'll get home Friday late afternoon :)

Thanks. We'd all really appreciate it.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-24  7:17       ` Jacopo Mondi
  2019-10-24 12:10         ` Lee Jones
@ 2019-11-01  8:58         ` Lee Jones
  2019-11-01 15:41           ` Jacopo Mondi
  1 sibling, 1 reply; 22+ messages in thread
From: Lee Jones @ 2019-11-01  8:58 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Daniel Thompson, Bartosz Golaszewski, Yoshinori Sato,
	Rich Felker, Jingoo Han, Bartlomiej Zolnierkiewicz,
	Linus Walleij, Andy Shevchenko, Linux-sh list,
	Linux Kernel Mailing List, open list:DRM PANEL DRIVERS,
	Linux Fbdev development list, Bartosz Golaszewski

On Thu, 24 Oct 2019, Jacopo Mondi wrote:

> Hello,
> 
> On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > On Wed, 23 Oct 2019, Daniel Thompson wrote:
> >
> > > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > > >
> > > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > >
> > > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > > that we could simplify the driver if we made the only user of platform
> > > > > data use GPIO lookups and device properties. This series tries to do
> > > > > that.
> > > > >
> > > > > First two patches contain minor fixes. Third patch makes the driver
> > > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > > fields. Last two patches contain additional improvements for the GPIO
> > > > > backlight driver while we're already modifying it.
> > > > >
> > > > > I don't have access to this HW but hopefully this works. Only compile
> > > > > tested.
> > > > >
> > > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > > >
> > > > > v1 -> v2:
> > > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > > - added additional two patches with minor improvements
> > > > >
> > > > > v2 -> v3:
> > > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > > >
> > > > > v3 -> v4:
> > > > > - rebased on top of v5.4-rc1
> > > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > > - added patch 7/7
> > > > >
> > > > > v4 -> v5:
> > > > > - in patch 7/7: added a comment replacing the name of the function being
> > > > >   pulled into probe()
> > > > >
> > > > > v5 -> v6:
> > > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > > >   to output
> > > > > - added a patch removing a redundant newline
> > > > >
> > > > > v6 -> v7:
> > > > > - renamed the function calculating the new GPIO value for status update
> > > > > - collected more tags
> > > > >
> > > > > Bartosz Golaszewski (9):
> > > > >   backlight: gpio: remove unneeded include
> > > > >   backlight: gpio: remove stray newline
> > > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > > >   sh: ecovec24: add additional properties to the backlight device
> > > > >   backlight: gpio: simplify the platform data handling
> > > > >   sh: ecovec24: don't set unused fields in platform data
> > > > >   backlight: gpio: remove unused fields from platform data
> > > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > > >
> > > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > > >
> > > > >
> > > >
> > > > Lee, Daniel, Jingoo,
> > > >
> > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > again before this date. Do you think you can pick it up and in case
> > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > doesn't miss another merge window?
> >
> > November 1st (-rc6) will be fine.
> >
> > I'd rather apply it late-tested than early-non-tested.
> >
> > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > since Monday will be -rc7 which is really cutting it fine.
> 
> I'll do my best, I'll get home Friday late afternoon :)

Welcome home!

Just a little reminder in your inbox. TIA. :)

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-11-01  8:58         ` Lee Jones
@ 2019-11-01 15:41           ` Jacopo Mondi
  2019-11-04  9:22             ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Jacopo Mondi @ 2019-11-01 15:41 UTC (permalink / raw)
  To: Lee Jones
  Cc: Daniel Thompson, Rich Felker, Yoshinori Sato,
	Bartlomiej Zolnierkiewicz, Jingoo Han, Bartosz Golaszewski,
	Linux-sh list, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Bartosz Golaszewski,
	Linux Fbdev development list, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 4761 bytes --]

Hello,
  as promised...

On Fri, Nov 01, 2019 at 08:58:03AM +0000, Lee Jones wrote:
> On Thu, 24 Oct 2019, Jacopo Mondi wrote:
>
> > Hello,
> >
> > On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > > On Wed, 23 Oct 2019, Daniel Thompson wrote:
> > >
> > > > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > > > >
> > > > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > > >
> > > > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > > > that we could simplify the driver if we made the only user of platform
> > > > > > data use GPIO lookups and device properties. This series tries to do
> > > > > > that.
> > > > > >
> > > > > > First two patches contain minor fixes. Third patch makes the driver
> > > > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > > > fields. Last two patches contain additional improvements for the GPIO
> > > > > > backlight driver while we're already modifying it.
> > > > > >
> > > > > > I don't have access to this HW but hopefully this works. Only compile
> > > > > > tested.
> > > > > >
> > > > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > > > >
> > > > > > v1 -> v2:
> > > > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > > > - added additional two patches with minor improvements
> > > > > >
> > > > > > v2 -> v3:
> > > > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > > > >
> > > > > > v3 -> v4:
> > > > > > - rebased on top of v5.4-rc1
> > > > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > > > - added patch 7/7
> > > > > >
> > > > > > v4 -> v5:
> > > > > > - in patch 7/7: added a comment replacing the name of the function being
> > > > > >   pulled into probe()
> > > > > >
> > > > > > v5 -> v6:
> > > > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > > > >   to output
> > > > > > - added a patch removing a redundant newline
> > > > > >
> > > > > > v6 -> v7:
> > > > > > - renamed the function calculating the new GPIO value for status update
> > > > > > - collected more tags
> > > > > >
> > > > > > Bartosz Golaszewski (9):
> > > > > >   backlight: gpio: remove unneeded include
> > > > > >   backlight: gpio: remove stray newline
> > > > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > > > >   sh: ecovec24: add additional properties to the backlight device
> > > > > >   backlight: gpio: simplify the platform data handling
> > > > > >   sh: ecovec24: don't set unused fields in platform data
> > > > > >   backlight: gpio: remove unused fields from platform data
> > > > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > > > >
> > > > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > > > >
> > > > > >
> > > > >
> > > > > Lee, Daniel, Jingoo,
> > > > >
> > > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > > again before this date. Do you think you can pick it up and in case
> > > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > > doesn't miss another merge window?
> > >
> > > November 1st (-rc6) will be fine.
> > >
> > > I'd rather apply it late-tested than early-non-tested.
> > >
> > > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > > since Monday will be -rc7 which is really cutting it fine.
> >
> > I'll do my best, I'll get home Friday late afternoon :)
>
> Welcome home!
>
> Just a little reminder in your inbox. TIA. :)

For the ecovec part:
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Thanks
   j


>
> --
> Lee Jones [李琼斯]
> Linaro Services Technical Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-11-01 15:41           ` Jacopo Mondi
@ 2019-11-04  9:22             ` Bartosz Golaszewski
  2019-11-08  9:24               ` Bartosz Golaszewski
  0 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-11-04  9:22 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Lee Jones, Daniel Thompson, Rich Felker, Yoshinori Sato,
	Bartlomiej Zolnierkiewicz, Jingoo Han, Linux-sh list,
	Linux Kernel Mailing List, open list:DRM PANEL DRIVERS,
	Bartosz Golaszewski, Linux Fbdev development list,
	Andy Shevchenko

pt., 1 lis 2019 o 16:39 Jacopo Mondi <jacopo@jmondi.org> napisał(a):
>
> Hello,
>   as promised...
>
> On Fri, Nov 01, 2019 at 08:58:03AM +0000, Lee Jones wrote:
> > On Thu, 24 Oct 2019, Jacopo Mondi wrote:
> >
> > > Hello,
> > >
> > > On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > > > On Wed, 23 Oct 2019, Daniel Thompson wrote:
> > > >
> > > > > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > > > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > > > > >
> > > > > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > > > >
> > > > > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > > > > that we could simplify the driver if we made the only user of platform
> > > > > > > data use GPIO lookups and device properties. This series tries to do
> > > > > > > that.
> > > > > > >
> > > > > > > First two patches contain minor fixes. Third patch makes the driver
> > > > > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > > > > fields. Last two patches contain additional improvements for the GPIO
> > > > > > > backlight driver while we're already modifying it.
> > > > > > >
> > > > > > > I don't have access to this HW but hopefully this works. Only compile
> > > > > > > tested.
> > > > > > >
> > > > > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > > > > >
> > > > > > > v1 -> v2:
> > > > > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > > > > - added additional two patches with minor improvements
> > > > > > >
> > > > > > > v2 -> v3:
> > > > > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > > > > >
> > > > > > > v3 -> v4:
> > > > > > > - rebased on top of v5.4-rc1
> > > > > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > > > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > > > > - added patch 7/7
> > > > > > >
> > > > > > > v4 -> v5:
> > > > > > > - in patch 7/7: added a comment replacing the name of the function being
> > > > > > >   pulled into probe()
> > > > > > >
> > > > > > > v5 -> v6:
> > > > > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > > > > >   to output
> > > > > > > - added a patch removing a redundant newline
> > > > > > >
> > > > > > > v6 -> v7:
> > > > > > > - renamed the function calculating the new GPIO value for status update
> > > > > > > - collected more tags
> > > > > > >
> > > > > > > Bartosz Golaszewski (9):
> > > > > > >   backlight: gpio: remove unneeded include
> > > > > > >   backlight: gpio: remove stray newline
> > > > > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > > > > >   sh: ecovec24: add additional properties to the backlight device
> > > > > > >   backlight: gpio: simplify the platform data handling
> > > > > > >   sh: ecovec24: don't set unused fields in platform data
> > > > > > >   backlight: gpio: remove unused fields from platform data
> > > > > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > > > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > > > > >
> > > > > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > > > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > > > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > > > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > Lee, Daniel, Jingoo,
> > > > > >
> > > > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > > > again before this date. Do you think you can pick it up and in case
> > > > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > > > doesn't miss another merge window?
> > > >
> > > > November 1st (-rc6) will be fine.
> > > >
> > > > I'd rather apply it late-tested than early-non-tested.
> > > >
> > > > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > > > since Monday will be -rc7 which is really cutting it fine.
> > >
> > > I'll do my best, I'll get home Friday late afternoon :)
> >
> > Welcome home!
> >
> > Just a little reminder in your inbox. TIA. :)
>
> For the ecovec part:
> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>

Thanks Jacopo!

Lee: I hope it's not too late to get it picked up for v5.5?

Best regards,
Bartosz Golaszewski

> Thanks
>    j
>
>
> >
> > --
> > Lee Jones [李琼斯]
> > Linaro Services Technical Lead
> > Linaro.org │ Open source software for ARM SoCs
> > Follow Linaro: Facebook | Twitter | Blog
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-11-04  9:22             ` Bartosz Golaszewski
@ 2019-11-08  9:24               ` Bartosz Golaszewski
  2019-11-11  7:44                 ` Lee Jones
  0 siblings, 1 reply; 22+ messages in thread
From: Bartosz Golaszewski @ 2019-11-08  9:24 UTC (permalink / raw)
  To: Lee Jones
  Cc: Daniel Thompson, Rich Felker, Yoshinori Sato,
	Bartlomiej Zolnierkiewicz, Jingoo Han, Linux-sh list,
	Jacopo Mondi, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Bartosz Golaszewski,
	Linux Fbdev development list, Andy Shevchenko

pon., 4 lis 2019 o 10:22 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
>
> pt., 1 lis 2019 o 16:39 Jacopo Mondi <jacopo@jmondi.org> napisał(a):
> >
> > Hello,
> >   as promised...
> >
> > On Fri, Nov 01, 2019 at 08:58:03AM +0000, Lee Jones wrote:
> > > On Thu, 24 Oct 2019, Jacopo Mondi wrote:
> > >
> > > > Hello,
> > > >
> > > > On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > > > > On Wed, 23 Oct 2019, Daniel Thompson wrote:
> > > > >
> > > > > > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > > > > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > > > > > >
> > > > > > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > > > > >
> > > > > > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > > > > > that we could simplify the driver if we made the only user of platform
> > > > > > > > data use GPIO lookups and device properties. This series tries to do
> > > > > > > > that.
> > > > > > > >
> > > > > > > > First two patches contain minor fixes. Third patch makes the driver
> > > > > > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > > > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > > > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > > > > > fields. Last two patches contain additional improvements for the GPIO
> > > > > > > > backlight driver while we're already modifying it.
> > > > > > > >
> > > > > > > > I don't have access to this HW but hopefully this works. Only compile
> > > > > > > > tested.
> > > > > > > >
> > > > > > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > > > > > >
> > > > > > > > v1 -> v2:
> > > > > > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > > > > > - added additional two patches with minor improvements
> > > > > > > >
> > > > > > > > v2 -> v3:
> > > > > > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > > > > > >
> > > > > > > > v3 -> v4:
> > > > > > > > - rebased on top of v5.4-rc1
> > > > > > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > > > > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > > > > > - added patch 7/7
> > > > > > > >
> > > > > > > > v4 -> v5:
> > > > > > > > - in patch 7/7: added a comment replacing the name of the function being
> > > > > > > >   pulled into probe()
> > > > > > > >
> > > > > > > > v5 -> v6:
> > > > > > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > > > > > >   to output
> > > > > > > > - added a patch removing a redundant newline
> > > > > > > >
> > > > > > > > v6 -> v7:
> > > > > > > > - renamed the function calculating the new GPIO value for status update
> > > > > > > > - collected more tags
> > > > > > > >
> > > > > > > > Bartosz Golaszewski (9):
> > > > > > > >   backlight: gpio: remove unneeded include
> > > > > > > >   backlight: gpio: remove stray newline
> > > > > > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > > > > > >   sh: ecovec24: add additional properties to the backlight device
> > > > > > > >   backlight: gpio: simplify the platform data handling
> > > > > > > >   sh: ecovec24: don't set unused fields in platform data
> > > > > > > >   backlight: gpio: remove unused fields from platform data
> > > > > > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > > > > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > > > > > >
> > > > > > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > > > > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > > > > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > > > > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > Lee, Daniel, Jingoo,
> > > > > > >
> > > > > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > > > > again before this date. Do you think you can pick it up and in case
> > > > > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > > > > doesn't miss another merge window?
> > > > >
> > > > > November 1st (-rc6) will be fine.
> > > > >
> > > > > I'd rather apply it late-tested than early-non-tested.
> > > > >
> > > > > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > > > > since Monday will be -rc7 which is really cutting it fine.
> > > >
> > > > I'll do my best, I'll get home Friday late afternoon :)
> > >
> > > Welcome home!
> > >
> > > Just a little reminder in your inbox. TIA. :)
> >
> > For the ecovec part:
> > Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> >
>
> Thanks Jacopo!
>
> Lee: I hope it's not too late to get it picked up for v5.5?
>

Hi, just a gentle ping for this series, because I'm afraid it will
miss yet another merge window.

Thanks in advance!
Bartosz Golaszewski

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-11-08  9:24               ` Bartosz Golaszewski
@ 2019-11-11  7:44                 ` Lee Jones
  0 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2019-11-11  7:44 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Daniel Thompson, Rich Felker, Yoshinori Sato,
	Bartlomiej Zolnierkiewicz, Jingoo Han, Linux-sh list,
	Jacopo Mondi, Linux Kernel Mailing List,
	open list:DRM PANEL DRIVERS, Bartosz Golaszewski,
	Linux Fbdev development list, Andy Shevchenko

On Fri, 08 Nov 2019, Bartosz Golaszewski wrote:

> pon., 4 lis 2019 o 10:22 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> >
> > pt., 1 lis 2019 o 16:39 Jacopo Mondi <jacopo@jmondi.org> napisał(a):
> > >
> > > Hello,
> > >   as promised...
> > >
> > > On Fri, Nov 01, 2019 at 08:58:03AM +0000, Lee Jones wrote:
> > > > On Thu, 24 Oct 2019, Jacopo Mondi wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > On Thu, Oct 24, 2019 at 07:47:26AM +0100, Lee Jones wrote:
> > > > > > On Wed, 23 Oct 2019, Daniel Thompson wrote:
> > > > > >
> > > > > > > On Tue, Oct 22, 2019 at 11:29:54AM +0200, Bartosz Golaszewski wrote:
> > > > > > > > wt., 22 paź 2019 o 10:36 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > > > > > > >
> > > > > > > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > > > > > > >
> > > > > > > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > > > > > > that we could simplify the driver if we made the only user of platform
> > > > > > > > > data use GPIO lookups and device properties. This series tries to do
> > > > > > > > > that.
> > > > > > > > >
> > > > > > > > > First two patches contain minor fixes. Third patch makes the driver
> > > > > > > > > explicitly drive the GPIO line. Fourth patch adds all necessary data
> > > > > > > > > structures to ecovec24. Patch 5/9 unifies much of the code for both
> > > > > > > > > pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> > > > > > > > > fields. Last two patches contain additional improvements for the GPIO
> > > > > > > > > backlight driver while we're already modifying it.
> > > > > > > > >
> > > > > > > > > I don't have access to this HW but hopefully this works. Only compile
> > > > > > > > > tested.
> > > > > > > > >
> > > > > > > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > > > > > > >
> > > > > > > > > v1 -> v2:
> > > > > > > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > > > > > > - added additional two patches with minor improvements
> > > > > > > > >
> > > > > > > > > v2 -> v3:
> > > > > > > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > > > > > > >
> > > > > > > > > v3 -> v4:
> > > > > > > > > - rebased on top of v5.4-rc1
> > > > > > > > > - removed changes that are no longer relevant after commit ec665b756e6f
> > > > > > > > >   ("backlight: gpio-backlight: Correct initial power state handling")
> > > > > > > > > - added patch 7/7
> > > > > > > > >
> > > > > > > > > v4 -> v5:
> > > > > > > > > - in patch 7/7: added a comment replacing the name of the function being
> > > > > > > > >   pulled into probe()
> > > > > > > > >
> > > > > > > > > v5 -> v6:
> > > > > > > > > - added a patch making the driver explicitly set the direction of the GPIO
> > > > > > > > >   to output
> > > > > > > > > - added a patch removing a redundant newline
> > > > > > > > >
> > > > > > > > > v6 -> v7:
> > > > > > > > > - renamed the function calculating the new GPIO value for status update
> > > > > > > > > - collected more tags
> > > > > > > > >
> > > > > > > > > Bartosz Golaszewski (9):
> > > > > > > > >   backlight: gpio: remove unneeded include
> > > > > > > > >   backlight: gpio: remove stray newline
> > > > > > > > >   backlight: gpio: explicitly set the direction of the GPIO
> > > > > > > > >   sh: ecovec24: add additional properties to the backlight device
> > > > > > > > >   backlight: gpio: simplify the platform data handling
> > > > > > > > >   sh: ecovec24: don't set unused fields in platform data
> > > > > > > > >   backlight: gpio: remove unused fields from platform data
> > > > > > > > >   backlight: gpio: use a helper variable for &pdev->dev
> > > > > > > > >   backlight: gpio: pull gpio_backlight_initial_power_state() into probe
> > > > > > > > >
> > > > > > > > >  arch/sh/boards/mach-ecovec24/setup.c         |  33 +++--
> > > > > > > > >  drivers/video/backlight/gpio_backlight.c     | 128 +++++++------------
> > > > > > > > >  include/linux/platform_data/gpio_backlight.h |   3 -
> > > > > > > > >  3 files changed, 69 insertions(+), 95 deletions(-)
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > > Lee, Daniel, Jingoo,
> > > > > > > >
> > > > > > > > Jacopo is travelling until November 1st and won't be able to test this
> > > > > > > > again before this date. Do you think you can pick it up and in case
> > > > > > > > anything's broken on SH, we can fix it after v5.5-rc1, so that it
> > > > > > > > doesn't miss another merge window?
> > > > > >
> > > > > > November 1st (-rc6) will be fine.
> > > > > >
> > > > > > I'd rather apply it late-tested than early-non-tested.
> > > > > >
> > > > > > Hopefully Jacopo can prioritise testing this on Thursday or Friday,
> > > > > > since Monday will be -rc7 which is really cutting it fine.
> > > > >
> > > > > I'll do my best, I'll get home Friday late afternoon :)
> > > >
> > > > Welcome home!
> > > >
> > > > Just a little reminder in your inbox. TIA. :)
> > >
> > > For the ecovec part:
> > > Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > >
> >
> > Thanks Jacopo!
> >
> > Lee: I hope it's not too late to get it picked up for v5.5?
> >
> 
> Hi, just a gentle ping for this series, because I'm afraid it will
> miss yet another merge window.

I have it marked to handle it, along with 10's of others.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v7 0/9] backlight: gpio: simplify the driver
  2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
                   ` (9 preceding siblings ...)
  2019-10-22  9:29 ` [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
@ 2019-11-11 11:41 ` Lee Jones
  10 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2019-11-11 11:41 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Yoshinori Sato, Rich Felker, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, Linus Walleij, Andy Shevchenko,
	Jacopo Mondi, linux-sh, linux-kernel, dri-devel, linux-fbdev,
	Bartosz Golaszewski

On Tue, 22 Oct 2019, Bartosz Golaszewski wrote:

> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
> 
> First two patches contain minor fixes. Third patch makes the driver
> explicitly drive the GPIO line. Fourth patch adds all necessary data
> structures to ecovec24. Patch 5/9 unifies much of the code for both
> pdata and non-pdata cases. Patches 6-7/9 remove unused platform data
> fields. Last two patches contain additional improvements for the GPIO
> backlight driver while we're already modifying it.

All applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2019-11-11 11:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22  8:36 [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 1/9] backlight: gpio: remove unneeded include Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 2/9] backlight: gpio: remove stray newline Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 3/9] backlight: gpio: explicitly set the direction of the GPIO Bartosz Golaszewski
2019-10-22 10:14   ` Daniel Thompson
2019-10-22  8:36 ` [PATCH v7 4/9] sh: ecovec24: add additional properties to the backlight device Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 5/9] backlight: gpio: simplify the platform data handling Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 6/9] sh: ecovec24: don't set unused fields in platform data Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 7/9] backlight: gpio: remove unused fields from " Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 8/9] backlight: gpio: use a helper variable for &pdev->dev Bartosz Golaszewski
2019-10-22  8:36 ` [PATCH v7 9/9] backlight: gpio: pull gpio_backlight_initial_power_state() into probe Bartosz Golaszewski
2019-10-22  9:29 ` [PATCH v7 0/9] backlight: gpio: simplify the driver Bartosz Golaszewski
2019-10-23 15:59   ` Daniel Thompson
2019-10-24  6:47     ` Lee Jones
2019-10-24  7:17       ` Jacopo Mondi
2019-10-24 12:10         ` Lee Jones
2019-11-01  8:58         ` Lee Jones
2019-11-01 15:41           ` Jacopo Mondi
2019-11-04  9:22             ` Bartosz Golaszewski
2019-11-08  9:24               ` Bartosz Golaszewski
2019-11-11  7:44                 ` Lee Jones
2019-11-11 11:41 ` Lee Jones

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