lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140319141924.GB20872@samfundet.no>
Date:	Wed, 19 Mar 2014 15:19:24 +0100
From:	Hans-Christian Egtvedt <egtvedt@...fundet.no>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Cc:	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Haavard Skinnemoen <hskinnemoen@...il.com>,
	Bryan Wu <cooloney@...il.com>,
	Richard Purdie <rpurdie@...ys.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Thierry Reding <thierry.reding@...il.com>,
	Jingoo Han <jg1.han@...sung.com>, linux-leds@...r.kernel.org,
	linux-pwm@...r.kernel.org, linux-fbdev@...r.kernel.org
Subject: Re: [PATCH 10/16] avr32: MRMT: use generic leds_pwm driver

Around Wed 19 Mar 2014 14:03:23 +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@...e-electrons.com>

Acked-by: Hans-Christian Egtvedt <egtvedt@...fundet.no>

I do not have this add-on board either, so I can only provide compile tests
myself.

> ---
>  arch/avr32/boards/atngw100/mrmt.c | 35 +++++++++++++++++++++++------------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c
> index 1ba09e4c02b1..134e94c3d504 100644
> --- a/arch/avr32/boards/atngw100/mrmt.c
> +++ b/arch/avr32/boards/atngw100/mrmt.c
> @@ -17,6 +17,8 @@
>  #include <linux/types.h>
>  #include <linux/fb.h>
>  #include <linux/leds.h>
> +#include <linux/pwm.h>
> +#include <linux/leds_pwm.h>
>  #include <linux/input.h>
>  #include <linux/gpio_keys.h>
>  #include <linux/atmel_serial.h>
> @@ -155,21 +157,29 @@ static struct platform_device rmt_ts_device = {
>  
>  #ifdef CONFIG_BOARD_MRMT_BL_PWM
>  /* PWM LEDs: LCD Backlight, etc */
> -static struct gpio_led rmt_pwm_led[] = {
> -	/* here the "gpio" is actually a PWM channel */
> -	{ .name = "backlight",	.gpio = PWM_CH_BL, },
> +static struct pwm_lookup pwm_lookup[] = {
> +	PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1"),
>  };
>  
> -static struct gpio_led_platform_data rmt_pwm_led_data = {
> -	.num_leds	= ARRAY_SIZE(rmt_pwm_led),
> -	.leds		= rmt_pwm_led,
> +static struct led_pwm pwm_leds[] = {
> +	{
> +		.name = "backlight",
> +		.max_brightness = 255,
> +		.pwm_period_ns  = 5000,
> +		.active_low = 1,
> +	},
> +};
> +
> +static struct led_pwm_platform_data pwm_data = {
> +	.num_leds       = ARRAY_SIZE(pwm_leds),
> +	.leds           = pwm_leds,
>  };
>  
> -static struct platform_device rmt_pwm_led_dev = {
> -	.name		= "leds-atmel-pwm",
> -	.id		= -1,
> -	.dev		= {
> -		.platform_data	= &rmt_pwm_led_data,
> +static struct platform_device leds_pwm = {
> +	.name   = "leds_pwm",
> +	.id     = -1,
> +	.dev    = {
> +		.platform_data = &pwm_data,
>  	},
>  };
>  #endif
> @@ -325,7 +335,8 @@ static int __init mrmt1_init(void)
>  #ifdef CONFIG_BOARD_MRMT_BL_PWM
>  	/* Use PWM for Backlight controls */
>  	at32_add_device_pwm(1 << PWM_CH_BL);
> -	platform_device_register(&rmt_pwm_led_dev);
> +	pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
> +	platform_device_register(&leds_pwm);
>  #else
>  	/* Backlight always on */
>  	udelay( 1 );
-- 
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ