diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2015-10-05 13:31:17 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-10-26 09:49:43 +0100 |
commit | 0503b69729f6ba83eacaf4dc97e54d55b7f1feba (patch) | |
tree | a1e9491a95ab75a8609c9deee5224f3996bf5832 /arch/mips/jz4740 | |
parent | 1ee3630a3e57f38f688a6f0a5f9edbd8a0d7201f (diff) | |
download | linux-0503b69729f6ba83eacaf4dc97e54d55b7f1feba.tar.gz linux-0503b69729f6ba83eacaf4dc97e54d55b7f1feba.tar.bz2 linux-0503b69729f6ba83eacaf4dc97e54d55b7f1feba.zip |
MIPS: JZ4740: Use PWM lookup table
Associate the PWM with the pwm-beeper device using a PWM lookup table.
This will eventually allow the legacy function calls to pwm_request() to
be removed from all consumer drivers.
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11261/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/jz4740')
-rw-r--r-- | arch/mips/jz4740/board-qi_lb60.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c index 459cb017306c..d6f7e39ea687 100644 --- a/arch/mips/jz4740/board-qi_lb60.c +++ b/arch/mips/jz4740/board-qi_lb60.c @@ -25,6 +25,7 @@ #include <linux/power_supply.h> #include <linux/power/jz4740-battery.h> #include <linux/power/gpio-charger.h> +#include <linux/pwm.h> #include <asm/mach-jz4740/gpio.h> #include <asm/mach-jz4740/jz4740_fb.h> @@ -399,13 +400,15 @@ static struct platform_device avt2_usb_regulator_device = { } }; +static struct pwm_lookup qi_lb60_pwm_lookup[] = { + PWM_LOOKUP("jz4740-pwm", 4, "pwm-beeper", NULL, 0, + PWM_POLARITY_NORMAL), +}; + /* beeper */ static struct platform_device qi_lb60_pwm_beeper = { .name = "pwm-beeper", .id = -1, - .dev = { - .platform_data = (void *)4, - }, }; /* charger */ @@ -491,6 +494,8 @@ static int __init qi_lb60_init_platform_devices(void) platform_device_register(&jz4740_usb_ohci_device); } + pwm_add_table(qi_lb60_pwm_lookup, ARRAY_SIZE(qi_lb60_pwm_lookup)); + return platform_add_devices(jz_platform_devices, ARRAY_SIZE(jz_platform_devices)); |