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
commitbf0ff1cd21a34ced1b34a42f12de8ec1ae7cfd3b (patch)
tree10eadd8ed63392f30f9f518708fc848ea13efd9c
parentc107fe904a1075be8defff9b3942cde5a930a2bb (diff)
ARM: S3C64XX: Use PWM lookup table for smdk6410
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/dev-backlight.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c
index 38c323e68e3f..e62e789f9aee 100644
--- a/arch/arm/mach-s3c64xx/dev-backlight.c
+++ b/arch/arm/mach-s3c64xx/dev-backlight.c
@@ -69,7 +69,6 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
69 .plat_data = { 69 .plat_data = {
70 .max_brightness = 255, 70 .max_brightness = 255,
71 .dft_brightness = 255, 71 .dft_brightness = 255,
72 .pwm_period_ns = 78770,
73 .enable_gpio = -1, 72 .enable_gpio = -1,
74 .init = samsung_bl_init, 73 .init = samsung_bl_init,
75 .exit = samsung_bl_exit, 74 .exit = samsung_bl_exit,
@@ -111,7 +110,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
111 samsung_bl_data = &samsung_bl_drvdata->plat_data; 110 samsung_bl_data = &samsung_bl_drvdata->plat_data;
112 111
113 /* Copy board specific data provided by user */ 112 /* Copy board specific data provided by user */
114 samsung_bl_data->pwm_id = bl_data->pwm_id;
115 samsung_bl_device->dev.parent = &samsung_device_pwm.dev; 113 samsung_bl_device->dev.parent = &samsung_device_pwm.dev;
116 114
117 if (bl_data->max_brightness) 115 if (bl_data->max_brightness)
@@ -120,8 +118,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
120 samsung_bl_data->dft_brightness = bl_data->dft_brightness; 118 samsung_bl_data->dft_brightness = bl_data->dft_brightness;
121 if (bl_data->lth_brightness) 119 if (bl_data->lth_brightness)
122 samsung_bl_data->lth_brightness = bl_data->lth_brightness; 120 samsung_bl_data->lth_brightness = bl_data->lth_brightness;
123 if (bl_data->pwm_period_ns)
124 samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;
125 if (bl_data->enable_gpio >= 0) 121 if (bl_data->enable_gpio >= 0)
126 samsung_bl_data->enable_gpio = bl_data->enable_gpio; 122 samsung_bl_data->enable_gpio = bl_data->enable_gpio;
127 if (bl_data->init) 123 if (bl_data->init)
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index d590b88bd8a8..2722800d5c11 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -30,6 +30,7 @@
30#include <linux/smsc911x.h> 30#include <linux/smsc911x.h>
31#include <linux/regulator/fixed.h> 31#include <linux/regulator/fixed.h>
32#include <linux/regulator/machine.h> 32#include <linux/regulator/machine.h>
33#include <linux/pwm.h>
33#include <linux/pwm_backlight.h> 34#include <linux/pwm_backlight.h>
34#include <linux/platform_data/s3c-hsotg.h> 35#include <linux/platform_data/s3c-hsotg.h>
35 36
@@ -623,8 +624,12 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
623 .func = S3C_GPIO_SFN(2), 624 .func = S3C_GPIO_SFN(2),
624}; 625};
625 626
627static struct pwm_lookup smdk6410_pwm_lookup[] = {
628 PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770,
629 PWM_POLARITY_NORMAL),
630};
631
626static struct platform_pwm_backlight_data smdk6410_bl_data = { 632static struct platform_pwm_backlight_data smdk6410_bl_data = {
627 .pwm_id = 1,
628 .enable_gpio = -1, 633 .enable_gpio = -1,
629}; 634};
630 635
@@ -695,6 +700,7 @@ static void __init smdk6410_machine_init(void)
695 700
696 platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); 701 platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
697 702
703 pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup));
698 samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); 704 samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
699} 705}
700 706