Commit bf0ff1cd authored by Thierry Reding's avatar Thierry Reding Committed by Kukjin Kim

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: default avatarThierry Reding <thierry.reding@gmail.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene@kernel.org>
parent c107fe90
...@@ -69,7 +69,6 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = { ...@@ -69,7 +69,6 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
.plat_data = { .plat_data = {
.max_brightness = 255, .max_brightness = 255,
.dft_brightness = 255, .dft_brightness = 255,
.pwm_period_ns = 78770,
.enable_gpio = -1, .enable_gpio = -1,
.init = samsung_bl_init, .init = samsung_bl_init,
.exit = samsung_bl_exit, .exit = samsung_bl_exit,
...@@ -111,7 +110,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, ...@@ -111,7 +110,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
samsung_bl_data = &samsung_bl_drvdata->plat_data; samsung_bl_data = &samsung_bl_drvdata->plat_data;
/* Copy board specific data provided by user */ /* Copy board specific data provided by user */
samsung_bl_data->pwm_id = bl_data->pwm_id;
samsung_bl_device->dev.parent = &samsung_device_pwm.dev; samsung_bl_device->dev.parent = &samsung_device_pwm.dev;
if (bl_data->max_brightness) if (bl_data->max_brightness)
...@@ -120,8 +118,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, ...@@ -120,8 +118,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
samsung_bl_data->dft_brightness = bl_data->dft_brightness; samsung_bl_data->dft_brightness = bl_data->dft_brightness;
if (bl_data->lth_brightness) if (bl_data->lth_brightness)
samsung_bl_data->lth_brightness = bl_data->lth_brightness; samsung_bl_data->lth_brightness = bl_data->lth_brightness;
if (bl_data->pwm_period_ns)
samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;
if (bl_data->enable_gpio >= 0) if (bl_data->enable_gpio >= 0)
samsung_bl_data->enable_gpio = bl_data->enable_gpio; samsung_bl_data->enable_gpio = bl_data->enable_gpio;
if (bl_data->init) if (bl_data->init)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/regulator/fixed.h> #include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/platform_data/s3c-hsotg.h> #include <linux/platform_data/s3c-hsotg.h>
...@@ -623,8 +624,12 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = { ...@@ -623,8 +624,12 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
.func = S3C_GPIO_SFN(2), .func = S3C_GPIO_SFN(2),
}; };
static struct pwm_lookup smdk6410_pwm_lookup[] = {
PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770,
PWM_POLARITY_NORMAL),
};
static struct platform_pwm_backlight_data smdk6410_bl_data = { static struct platform_pwm_backlight_data smdk6410_bl_data = {
.pwm_id = 1,
.enable_gpio = -1, .enable_gpio = -1,
}; };
...@@ -695,6 +700,7 @@ static void __init smdk6410_machine_init(void) ...@@ -695,6 +700,7 @@ static void __init smdk6410_machine_init(void)
platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup));
samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment