From: Hans-Christian Egtvedt <egtvedt@samfundet.no>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 11/16] avr32: merisc: use generic leds_pwm driver
Date: Wed, 19 Mar 2014 14:20:01 +0000 [thread overview]
Message-ID: <20140319142001.GC20872@samfundet.no> (raw)
In-Reply-To: <1395234209-15546-12-git-send-email-alexandre.belloni@free-electrons.com>
Around Wed 19 Mar 2014 14:03:24 +0100 or thereabout, Alexandre Belloni wrote:
> Switch to the generic leds_pwm driver instead of leds-atmel-pwm.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
I do not have this board either.
> ---
> arch/avr32/boards/merisc/setup.c | 34 +++++++++++++++++++++-------------
> 1 file changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
> index ed137e335796..b0980c1946a7 100644
> --- a/arch/avr32/boards/merisc/setup.c
> +++ b/arch/avr32/boards/merisc/setup.c
> @@ -22,6 +22,8 @@
> #include <linux/irq.h>
> #include <linux/fb.h>
> #include <linux/atmel-mci.h>
> +#include <linux/pwm.h>
> +#include <linux/leds_pwm.h>
>
> #include <asm/io.h>
> #include <asm/setup.h>
> @@ -167,24 +169,29 @@ static struct i2c_board_info __initdata i2c_info[] = {
> },
> };
>
> -#ifdef CONFIG_LEDS_ATMEL_PWM
> -static struct gpio_led stk_pwm_led[] = {
> +#if IS_ENABLED(CONFIG_LEDS_PWM)
> +static struct pwm_lookup pwm_lookup[] = {
> + PWM_LOOKUP("at91sam9rl-pwm", 0, "leds_pwm", "backlight"),
> +};
> +
> +static struct led_pwm pwm_leds[] = {
> {
> .name = "backlight",
> - .gpio = 0, /* PWM channel 0 (LCD backlight) */
> + .max_brightness = 255,
> + .pwm_period_ns = 5000,
> },
> };
>
> -static struct gpio_led_platform_data stk_pwm_led_data = {
> - .num_leds = ARRAY_SIZE(stk_pwm_led),
> - .leds = stk_pwm_led,
> +static struct led_pwm_platform_data pwm_data = {
> + .num_leds = ARRAY_SIZE(pwm_leds),
> + .leds = pwm_leds,
> };
>
> -static struct platform_device stk_pwm_led_dev = {
> - .name = "leds-atmel-pwm",
> - .id = -1,
> - .dev = {
> - .platform_data = &stk_pwm_led_data,
> +static struct platform_device leds_pwm = {
> + .name = "leds_pwm",
> + .id = -1,
> + .dev = {
> + .platform_data = &pwm_data,
> },
> };
> #endif
> @@ -278,9 +285,10 @@ static int __init merisc_init(void)
>
> at32_add_device_mci(0, &mci0_data);
>
> -#ifdef CONFIG_LEDS_ATMEL_PWM
> +#if IS_ENABLED(CONFIG_LEDS_PWM)
> + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
> at32_add_device_pwm((1 << 0) | (1 << 2));
> - platform_device_register(&stk_pwm_led_dev);
> + platform_device_register(&leds_pwm);
> #else
> at32_add_device_pwm((1 << 2));
> #endif
--
mvh
Hans-Christian Egtvedt
next prev parent reply other threads:[~2014-03-19 14:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 13:03 [PATCH 00/16] move at91 and avr32 to the PWM framework, remove obsolete drivers Alexandre Belloni
2014-03-19 13:03 ` [PATCH 01/16] ARM: at91: at91sam9g45: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 02/16] ARM: at91: sam9m10g45ek: use generic leds_pwm driver Alexandre Belloni
2014-03-19 13:03 ` [PATCH 03/16] ARM: at91: at91sam9263: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 04/16] ARM: at91: sam9263ek: use generic leds_pwm driver Alexandre Belloni
2014-03-19 13:03 ` [PATCH 05/16] ARM: at91: at91sam9rl: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 06/16] ARM: at91: remove useless at91_pwm_leds() Alexandre Belloni
2014-03-19 13:03 ` [PATCH 07/16] PWM: atmel: allow building for AVR32 Alexandre Belloni
2014-03-19 13:03 ` [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data Alexandre Belloni
2014-04-07 11:16 ` Thierry Reding
2014-03-19 13:03 ` [PATCH 09/16] avr32/at32ap: switch to the generic PWM framework Alexandre Belloni
2014-03-19 14:18 ` Hans-Christian Egtvedt
2014-04-07 11:28 ` Thierry Reding
2014-03-19 13:03 ` [PATCH 10/16] avr32: MRMT: use generic leds_pwm driver Alexandre Belloni
2014-03-19 14:19 ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 11/16] avr32: merisc: " Alexandre Belloni
2014-03-19 14:20 ` Hans-Christian Egtvedt [this message]
2014-03-19 13:03 ` [PATCH 12/16] avr32: favr-32: use generic pwm_bl driver Alexandre Belloni
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 13/16] avr32: update defconfig to use the generic PWM framework Alexandre Belloni
2014-03-19 14:21 ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 14/16] backlight: atmel-pwm-bl: remove obsolete driver Alexandre Belloni
2014-03-19 14:22 ` Hans-Christian Egtvedt
2014-03-21 0:51 ` Jingoo Han
2014-03-24 15:54 ` Alexandre Belloni
2014-03-25 0:15 ` Jingoo Han
2014-03-19 13:03 ` [PATCH 15/16] leds: atmel-pwm: " Alexandre Belloni
2014-03-27 17:27 ` Bryan Wu
2014-03-19 13:03 ` [PATCH 16/16] misc: atmel_pwm: " Alexandre Belloni
2014-03-27 17:43 ` [PATCH 00/16] move at91 and avr32 to the PWM framework, remove obsolete drivers Nicolas Ferre
2014-03-27 18:21 ` Alexandre Belloni
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=20140319142001.GC20872@samfundet.no \
--to=egtvedt@samfundet.no \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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).