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: <20140407111639.GB26985@ulmo>
Date:	Mon, 7 Apr 2014 13:16:40 +0200
From:	Thierry Reding <thierry.reding@...il.com>
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>,
	Hans-Christian Egtvedt <egtvedt@...fundet.no>,
	Bryan Wu <cooloney@...il.com>,
	Richard Purdie <rpurdie@...ys.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jingoo Han <jg1.han@...sung.com>, linux-leds@...r.kernel.org,
	linux-pwm@...r.kernel.org, linux-fbdev@...r.kernel.org
Subject: Re: [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using
 platform data

On Wed, Mar 19, 2014 at 02:03:21PM +0100, Alexandre Belloni wrote:
> Set inversed polarity when .pwm_active_low is set in the platform_data. With
> device tree, this is taken care of by of_pwm_xlate_with_flags(), called from
> of_pwm_get().
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 8 ++++++++
>  include/linux/pwm_backlight.h    | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index b75201ff46f6..ffdd3b2b2742 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -309,6 +309,14 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  	if (data->pwm_period_ns > 0)
>  		pwm_set_period(pb->pwm, data->pwm_period_ns);
>  
> +	/*
> +	 * The DT case is taking care of polarity in of_pwm_get(). For the
> +	 * non-DT case, set the polarity from platform data.
> +	 */
> +	if (data->pwm_active_low)
> +		if (pwm_set_polarity(pb->pwm, PWM_POLARITY_INVERSED))
> +			dev_err(&pdev->dev, "impossible to invert polarity\n");

Could this perhaps be solved by adding a field to the PWM lookup table
that's used for non-DT cases? The idea being that we can use the same
interfaces for DT and non-DT cases, so we should try to move both
towards the same representation.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ