From: Thierry Reding <thierry.reding@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data
Date: Mon, 07 Apr 2014 11:16:40 +0000 [thread overview]
Message-ID: <20140407111639.GB26985@ulmo> (raw)
In-Reply-To: <1395234209-15546-9-git-send-email-alexandre.belloni@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
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@free-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
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Haavard Skinnemoen <hskinnemoen@gmail.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jingoo Han <jg1.han@samsung.com>,
linux-leds@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data
Date: Mon, 7 Apr 2014 13:16:40 +0200 [thread overview]
Message-ID: <20140407111639.GB26985@ulmo> (raw)
In-Reply-To: <1395234209-15546-9-git-send-email-alexandre.belloni@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
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@free-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
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data
Date: Mon, 7 Apr 2014 13:16:40 +0200 [thread overview]
Message-ID: <20140407111639.GB26985@ulmo> (raw)
In-Reply-To: <1395234209-15546-9-git-send-email-alexandre.belloni@free-electrons.com>
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@free-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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140407/6b3bd058/attachment.sig>
next prev parent reply other threads:[~2014-04-07 11:16 UTC|newest]
Thread overview: 102+ 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 ` Alexandre Belloni
2014-03-19 13:03 ` 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 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` 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 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` 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 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` 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 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` 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 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` [PATCH 06/16] ARM: at91: remove useless at91_pwm_leds() Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` [PATCH 07/16] PWM: atmel: allow building for AVR32 Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-04-07 11:16 ` Thierry Reding [this message]
2014-04-07 11:16 ` Thierry Reding
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 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:18 ` Hans-Christian Egtvedt
2014-03-19 14:18 ` Hans-Christian Egtvedt
2014-03-19 14:18 ` Hans-Christian Egtvedt
2014-03-19 14:18 ` Hans-Christian Egtvedt
2014-04-07 11:28 ` Thierry Reding
2014-04-07 11:28 ` Thierry Reding
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 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:19 ` Hans-Christian Egtvedt
2014-03-19 14:19 ` Hans-Christian Egtvedt
2014-03-19 14:19 ` Hans-Christian Egtvedt
2014-03-19 14:19 ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 11/16] avr32: merisc: " Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 12/16] avr32: favr-32: use generic pwm_bl driver Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:20 ` Hans-Christian Egtvedt
2014-03-19 14:20 ` Hans-Christian Egtvedt
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 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:21 ` Hans-Christian Egtvedt
2014-03-19 14:21 ` Hans-Christian Egtvedt
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 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 14:22 ` Hans-Christian Egtvedt
2014-03-19 14:22 ` Hans-Christian Egtvedt
2014-03-19 14:22 ` Hans-Christian Egtvedt
2014-03-21 0:51 ` Jingoo Han
2014-03-21 0:51 ` Jingoo Han
2014-03-21 0:51 ` Jingoo Han
2014-03-24 15:54 ` Alexandre Belloni
2014-03-24 15:54 ` Alexandre Belloni
2014-03-24 15:54 ` Alexandre Belloni
2014-03-25 0:15 ` Jingoo Han
2014-03-25 0:15 ` Jingoo Han
2014-03-25 0:15 ` Jingoo Han
2014-03-19 13:03 ` [PATCH 15/16] leds: atmel-pwm: " Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-27 17:27 ` Bryan Wu
2014-03-27 17:27 ` Bryan Wu
2014-03-27 17:27 ` Bryan Wu
2014-03-19 13:03 ` [PATCH 16/16] misc: atmel_pwm: " Alexandre Belloni
2014-03-19 13:03 ` Alexandre Belloni
2014-03-19 13:03 ` 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 17:43 ` Nicolas Ferre
2014-03-27 17:43 ` Nicolas Ferre
2014-03-27 17:43 ` Nicolas Ferre
2014-03-27 18:21 ` Alexandre Belloni
2014-03-27 18:21 ` Alexandre Belloni
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=20140407111639.GB26985@ulmo \
--to=thierry.reding@gmail.com \
--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 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.