From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/17] ARM: pxa: magician: Use PWM lookup table
Date: Mon, 5 Oct 2015 10:49:46 +0200 [thread overview]
Message-ID: <1444034997-9805-7-git-send-email-thierry.reding@gmail.com> (raw)
In-Reply-To: <1444034997-9805-1-git-send-email-thierry.reding@gmail.com>
Use a PWM lookup table to provide the PWM to the pwm-backlight device.
The driver has a legacy code path that is required only because boards
still use the legacy method of requesting PWMs by global ID. Replacing
these usages allows that legacy fallback to be removed.
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
---
arch/arm/mach-pxa/magician.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index a9761c293028..240e4c34b226 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -24,6 +24,7 @@
#include <linux/mfd/htc-pasic3.h>
#include <linux/mtd/physmap.h>
#include <linux/pda_power.h>
+#include <linux/pwm.h>
#include <linux/pwm_backlight.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/gpio-regulator.h>
@@ -346,6 +347,11 @@ static struct pxafb_mach_info samsung_info = {
* Backlight
*/
+static struct pwm_lookup magician_pwm_lookup[] = {
+ PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 30923,
+ PWM_POLARITY_NORMAL),
+};
+
static struct gpio magician_bl_gpios[] = {
{ EGPIO_MAGICIAN_BL_POWER, GPIOF_DIR_OUT, "Backlight power" },
{ EGPIO_MAGICIAN_BL_POWER2, GPIOF_DIR_OUT, "Backlight power 2" },
@@ -374,10 +380,8 @@ static void magician_backlight_exit(struct device *dev)
}
static struct platform_pwm_backlight_data backlight_data = {
- .pwm_id = 0,
.max_brightness = 272,
.dft_brightness = 100,
- .pwm_period_ns = 30923,
.enable_gpio = -1,
.init = magician_backlight_init,
.notify = magician_backlight_notify,
@@ -743,6 +747,7 @@ static void __init magician_init(void)
pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL);
+ pwm_add_table(magician_pwm_lookup, ARRAY_SIZE(magician_pwm_lookup));
platform_add_devices(ARRAY_AND_SIZE(devices));
pxa_set_ficp_info(&magician_ficp_info);
--
2.5.0
next prev parent reply other threads:[~2015-10-05 8:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 8:49 [PATCH 00/17] ARM: pxa: Use PWM lookup tables Thierry Reding
2015-10-05 8:49 ` [PATCH 01/17] ARM: pxa: cm-x300: Use PWM lookup table Thierry Reding
2015-10-05 20:23 ` Robert Jarzmik
2015-10-06 7:53 ` Thierry Reding
2015-10-06 18:49 ` Robert Jarzmik
2015-10-05 8:49 ` [PATCH 02/17] ARM: pxa: colibri-pxa270-income: " Thierry Reding
2015-10-05 8:49 ` [PATCH 03/17] ARM: pxa: ezx: " Thierry Reding
2015-10-05 8:49 ` [PATCH 04/17] ARM: pxa: hx4700: Remove unused field initializers Thierry Reding
2015-10-06 6:53 ` Philipp Zabel
2015-10-05 8:49 ` [PATCH 05/17] ARM: pxa: lpd270: Use PWM lookup table Thierry Reding
2015-10-05 8:49 ` Thierry Reding [this message]
2015-10-06 6:52 ` [PATCH 06/17] ARM: pxa: magician: " Philipp Zabel
2015-10-05 8:49 ` [PATCH 07/17] ARM: pxa: mainstone: " Thierry Reding
2015-10-05 8:49 ` [PATCH 08/17] ARM: pxa: mioa701: " Thierry Reding
2015-10-05 8:49 ` [PATCH 09/17] ARM: pxa: palm27x: " Thierry Reding
2015-10-05 8:49 ` [PATCH 10/17] ARM: pxa: palmtc: " Thierry Reding
2015-10-05 8:49 ` [PATCH 11/17] ARM: pxa: palmte2: " Thierry Reding
2015-10-05 8:49 ` [PATCH 12/17] ARM: pxa: pcm990: " Thierry Reding
2015-10-05 8:49 ` [PATCH 13/17] ARM: pxa: raumfeld: " Thierry Reding
2015-10-05 8:49 ` [PATCH 14/17] ARM: pxa: tavorevb: " Thierry Reding
2015-10-05 8:49 ` [PATCH 15/17] ARM: pxa: viper: " Thierry Reding
2015-10-05 8:49 ` [PATCH 16/17] ARM: pxa: z2: " Thierry Reding
2015-10-05 8:49 ` [PATCH 17/17] ARM: pxa: zylonite: " Thierry Reding
2015-10-05 18:48 ` [PATCH 00/17] ARM: pxa: Use PWM lookup tables Robert Jarzmik
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=1444034997-9805-7-git-send-email-thierry.reding@gmail.com \
--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 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).