From: jacopo mondi <jacopo@jmondi.org> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Lee Jones <lee.jones@linaro.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com>, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, Linus Walleij <linus.walleij@linaro.org> Subject: Re: [RFC 3/4] sh: ecovec24: convert backlight to use device properties Date: Fri, 16 Mar 2018 10:08:57 +0000 [thread overview] Message-ID: <20180316100857.GI16424@w540> (raw) In-Reply-To: <20180315224202.96668-4-dmitry.torokhov@gmail.com> [-- Attachment #1: Type: text/plain, Size: 2558 bytes --] Hi Dmitry, On Thu, Mar 15, 2018 at 03:42:01PM -0700, Dmitry Torokhov wrote: > Instead of backlight legacy platform data, let's switch to using device > properties and GPIO lookup tables. > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > arch/sh/boards/mach-ecovec24/setup.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c > index 67633d2d42390..ad3d48b3ead19 100644 > --- a/arch/sh/boards/mach-ecovec24/setup.c > +++ b/arch/sh/boards/mach-ecovec24/setup.c > @@ -11,11 +11,13 @@ > #include <linux/init.h> > #include <linux/device.h> > #include <linux/platform_device.h> > +#include <linux/property.h> > #include <linux/mmc/host.h> > #include <linux/mmc/sh_mmcif.h> > #include <linux/mtd/physmap.h> > #include <linux/mfd/tmio.h> > #include <linux/gpio.h> > +#include <linux/gpio/machine.h> > #include <linux/interrupt.h> > #include <linux/io.h> > #include <linux/delay.h> > @@ -30,7 +32,6 @@ > #include <linux/spi/mmc_spi.h> > #include <linux/input.h> > #include <linux/input/sh_keysc.h> > -#include <linux/platform_data/gpio_backlight.h> > #include <linux/sh_eth.h> > #include <linux/sh_intc.h> > #include <linux/videodev2.h> > @@ -367,17 +368,21 @@ static struct platform_device lcdc_device = { > }, > }; > > -static struct gpio_backlight_platform_data gpio_backlight_data = { > - .gpio = GPIO_PTR1, > - .def_value = 1, > - .name = "backlight", > +static struct gpiod_lookup_table gpio_backlight_gpios_table = { > + .dev_id = "gpio-backlight.0", > + .table = { > + GPIO_LOOKUP_IDX("sh7724_pfc", GPIO_PTR1, NULL, 0, GPIO_ACTIVE_HIGH); > + { } I understand this is an RFC, but this bit does not even compile. ../arch/sh/boards/mach-ecovec24/setup.c:374:70: error: expected '}' before ';' token Thanks j > + }, > +}; > + > +static struct property_entry gpio_backlight_properties[] = { > + PROPERTY_ENTRY_BOOL("default-on"), > + { } > }; > > static struct platform_device gpio_backlight_device = { > .name = "gpio-backlight", > - .dev = { > - .platform_data = &gpio_backlight_data, > - }, > }; > > /* CEU0 */ > @@ -1436,6 +1441,8 @@ static int __init arch_setup(void) > return error; > > if (use_backlight) { > + device_add_properties(&gpio_backlight_device.dev, > + gpio_backlight_properties); > error = platform_device_add(&gpio_backlight_device); > if (error) > pr_warn("%s: failed to register backlight: %d\n", > -- > 2.16.2.804.g6dcf76e118-goog > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: jacopo mondi <jacopo@jmondi.org> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Lee Jones <lee.jones@linaro.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com>, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, Linus Walleij <linus.walleij@linaro.org> Subject: Re: [RFC 3/4] sh: ecovec24: convert backlight to use device properties Date: Fri, 16 Mar 2018 11:08:57 +0100 [thread overview] Message-ID: <20180316100857.GI16424@w540> (raw) In-Reply-To: <20180315224202.96668-4-dmitry.torokhov@gmail.com> [-- Attachment #1: Type: text/plain, Size: 2558 bytes --] Hi Dmitry, On Thu, Mar 15, 2018 at 03:42:01PM -0700, Dmitry Torokhov wrote: > Instead of backlight legacy platform data, let's switch to using device > properties and GPIO lookup tables. > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > arch/sh/boards/mach-ecovec24/setup.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c > index 67633d2d42390..ad3d48b3ead19 100644 > --- a/arch/sh/boards/mach-ecovec24/setup.c > +++ b/arch/sh/boards/mach-ecovec24/setup.c > @@ -11,11 +11,13 @@ > #include <linux/init.h> > #include <linux/device.h> > #include <linux/platform_device.h> > +#include <linux/property.h> > #include <linux/mmc/host.h> > #include <linux/mmc/sh_mmcif.h> > #include <linux/mtd/physmap.h> > #include <linux/mfd/tmio.h> > #include <linux/gpio.h> > +#include <linux/gpio/machine.h> > #include <linux/interrupt.h> > #include <linux/io.h> > #include <linux/delay.h> > @@ -30,7 +32,6 @@ > #include <linux/spi/mmc_spi.h> > #include <linux/input.h> > #include <linux/input/sh_keysc.h> > -#include <linux/platform_data/gpio_backlight.h> > #include <linux/sh_eth.h> > #include <linux/sh_intc.h> > #include <linux/videodev2.h> > @@ -367,17 +368,21 @@ static struct platform_device lcdc_device = { > }, > }; > > -static struct gpio_backlight_platform_data gpio_backlight_data = { > - .gpio = GPIO_PTR1, > - .def_value = 1, > - .name = "backlight", > +static struct gpiod_lookup_table gpio_backlight_gpios_table = { > + .dev_id = "gpio-backlight.0", > + .table = { > + GPIO_LOOKUP_IDX("sh7724_pfc", GPIO_PTR1, NULL, 0, GPIO_ACTIVE_HIGH); > + { } I understand this is an RFC, but this bit does not even compile. ../arch/sh/boards/mach-ecovec24/setup.c:374:70: error: expected '}' before ';' token Thanks j > + }, > +}; > + > +static struct property_entry gpio_backlight_properties[] = { > + PROPERTY_ENTRY_BOOL("default-on"), > + { } > }; > > static struct platform_device gpio_backlight_device = { > .name = "gpio-backlight", > - .dev = { > - .platform_data = &gpio_backlight_data, > - }, > }; > > /* CEU0 */ > @@ -1436,6 +1441,8 @@ static int __init arch_setup(void) > return error; > > if (use_backlight) { > + device_add_properties(&gpio_backlight_device.dev, > + gpio_backlight_properties); > error = platform_device_add(&gpio_backlight_device); > if (error) > pr_warn("%s: failed to register backlight: %d\n", > -- > 2.16.2.804.g6dcf76e118-goog > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2018-03-16 10:08 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-03-15 22:41 [RFC 0/4] gpio-backlight: remove platform data support Dmitry Torokhov 2018-03-15 22:41 ` Dmitry Torokhov 2018-03-15 22:41 ` [RFC 1/4] backlight: gpio_backlight: use generic device properties Dmitry Torokhov 2018-03-15 22:41 ` Dmitry Torokhov 2018-03-27 11:53 ` Linus Walleij 2018-03-27 11:53 ` Linus Walleij 2018-03-15 22:42 ` [RFC 2/4] sh: ecovec24: conditionally register backlight device Dmitry Torokhov 2018-03-15 22:42 ` Dmitry Torokhov 2018-03-16 10:07 ` jacopo mondi 2018-03-16 10:07 ` jacopo mondi 2018-03-16 23:38 ` Dmitry Torokhov 2018-03-16 23:38 ` Dmitry Torokhov 2018-03-17 9:25 ` jacopo mondi 2018-03-17 9:25 ` jacopo mondi 2018-03-17 10:21 ` John Paul Adrian Glaubitz 2018-03-17 10:21 ` John Paul Adrian Glaubitz 2018-03-17 17:16 ` Rich Felker 2018-03-17 17:16 ` Rich Felker 2018-03-17 17:33 ` Dmitry Torokhov 2018-03-17 17:33 ` Dmitry Torokhov 2018-03-17 17:55 ` John Paul Adrian Glaubitz 2018-03-17 17:55 ` John Paul Adrian Glaubitz 2018-03-18 10:54 ` jacopo mondi 2018-03-18 10:54 ` jacopo mondi 2018-03-18 11:12 ` John Paul Adrian Glaubitz 2018-03-18 11:12 ` John Paul Adrian Glaubitz 2018-03-17 17:37 ` Dmitry Torokhov 2018-03-17 17:37 ` Dmitry Torokhov 2018-03-15 22:42 ` [RFC 3/4] sh: ecovec24: convert backlight to use device properties Dmitry Torokhov 2018-03-15 22:42 ` Dmitry Torokhov 2018-03-16 8:50 ` Geert Uytterhoeven 2018-03-16 8:50 ` Geert Uytterhoeven 2018-03-16 23:40 ` Dmitry Torokhov 2018-03-16 23:40 ` Dmitry Torokhov 2018-03-16 10:08 ` jacopo mondi [this message] 2018-03-16 10:08 ` jacopo mondi 2018-03-15 22:42 ` [RFC 4/4] backlight: gpio_backlight: remove platform data support Dmitry Torokhov 2018-03-15 22:42 ` Dmitry Torokhov 2018-03-27 11:55 ` Linus Walleij 2018-03-27 11:55 ` Linus Walleij 2018-03-16 11:11 ` [RFC 0/4] gpio-backlight: " Daniel Thompson 2018-03-27 11:59 ` Linus Walleij 2018-03-27 11:59 ` 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=20180316100857.GI16424@w540 \ --to=jacopo@jmondi.org \ --cc=dalias@libc.org \ --cc=daniel.thompson@linaro.org \ --cc=dmitry.torokhov@gmail.com \ --cc=jingoohan1@gmail.com \ --cc=laurent.pinchart@ideasonboard.com \ --cc=lee.jones@linaro.org \ --cc=linus.walleij@linaro.org \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-sh@vger.kernel.org \ --cc=ysato@users.sourceforge.jp \ /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: linkBe 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.