aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2015-10-12 16:04:22 -0400
committerKukjin Kim <kgene@kernel.org>2015-10-12 16:04:22 -0400
commit799fbf8ceef4621dd3dd01499ef13cab1d082896 (patch)
tree9e44a31f46a155f803ff62019f4da55bafebc5a7
parentbf0ff1cd21a34ced1b34a42f12de8ec1ae7cfd3b (diff)
ARM: S3C64XX: Use PWM lookup table for mach-crag6410
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. Signed-off-by: Thierry Reding <thierry.reding@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Kukjin Kim <kgene@kernel.org>
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 65c426bc45f7..d13aa3f9bac4 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -25,6 +25,7 @@
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/regulator/machine.h> 26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h> 27#include <linux/regulator/fixed.h>
28#include <linux/pwm.h>
28#include <linux/pwm_backlight.h> 29#include <linux/pwm_backlight.h>
29#include <linux/dm9000.h> 30#include <linux/dm9000.h>
30#include <linux/gpio_keys.h> 31#include <linux/gpio_keys.h>
@@ -108,11 +109,14 @@ static struct s3c2410_uartcfg crag6410_uartcfgs[] __initdata = {
108 }, 109 },
109}; 110};
110 111
112static struct pwm_lookup crag6410_pwm_lookup[] = {
113 PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 100000,
114 PWM_POLARITY_NORMAL),
115};
116
111static struct platform_pwm_backlight_data crag6410_backlight_data = { 117static struct platform_pwm_backlight_data crag6410_backlight_data = {
112 .pwm_id = 0,
113 .max_brightness = 1000, 118 .max_brightness = 1000,
114 .dft_brightness = 600, 119 .dft_brightness = 600,
115 .pwm_period_ns = 100000, /* about 1kHz */
116 .enable_gpio = -1, 120 .enable_gpio = -1,
117}; 121};
118 122
@@ -843,6 +847,7 @@ static void __init crag6410_machine_init(void)
843 samsung_keypad_set_platdata(&crag6410_keypad_data); 847 samsung_keypad_set_platdata(&crag6410_keypad_data);
844 s3c64xx_spi0_set_platdata(NULL, 0, 2); 848 s3c64xx_spi0_set_platdata(NULL, 0, 2);
845 849
850 pwm_add_table(crag6410_pwm_lookup, ARRAY_SIZE(crag6410_pwm_lookup));
846 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices)); 851 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices));
847 852
848 gpio_led_register_device(-1, &gpio_leds_pdata); 853 gpio_led_register_device(-1, &gpio_leds_pdata);