aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2015-10-12 16:04:21 -0400
committerKukjin Kim <kgene@kernel.org>2015-10-12 16:04:21 -0400
commit8c78aaa6ee587bce9d913114ba2aec5d345e39ed (patch)
tree769dbb6613cb292747eb82ac0635a0a03801f534
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
ARM: S3C24XX: Use PWM lookup table for mach-h1940
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-s3c24xx/mach-h1940.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index d40d4f5244c6..9f54300df4b3 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/pwm.h>
28#include <linux/pwm_backlight.h> 29#include <linux/pwm_backlight.h>
29#include <linux/i2c.h> 30#include <linux/i2c.h>
30#include <linux/leds.h> 31#include <linux/leds.h>
@@ -469,6 +470,11 @@ static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
469 .ocr_avail = MMC_VDD_32_33, 470 .ocr_avail = MMC_VDD_32_33,
470}; 471};
471 472
473static struct pwm_lookup h1940_pwm_lookup[] = {
474 PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 36296,
475 PWM_POLARITY_NORMAL),
476};
477
472static int h1940_backlight_init(struct device *dev) 478static int h1940_backlight_init(struct device *dev)
473{ 479{
474 gpio_request(S3C2410_GPB(0), "Backlight"); 480 gpio_request(S3C2410_GPB(0), "Backlight");
@@ -503,11 +509,8 @@ static void h1940_backlight_exit(struct device *dev)
503 509
504 510
505static struct platform_pwm_backlight_data backlight_data = { 511static struct platform_pwm_backlight_data backlight_data = {
506 .pwm_id = 0,
507 .max_brightness = 100, 512 .max_brightness = 100,
508 .dft_brightness = 50, 513 .dft_brightness = 50,
509 /* tcnt = 0x31 */
510 .pwm_period_ns = 36296,
511 .enable_gpio = -1, 514 .enable_gpio = -1,
512 .init = h1940_backlight_init, 515 .init = h1940_backlight_init,
513 .notify = h1940_backlight_notify, 516 .notify = h1940_backlight_notify,
@@ -725,6 +728,7 @@ static void __init h1940_init(void)
725 gpio_request(H1940_LATCH_SD_POWER, "SD power"); 728 gpio_request(H1940_LATCH_SD_POWER, "SD power");
726 gpio_direction_output(H1940_LATCH_SD_POWER, 0); 729 gpio_direction_output(H1940_LATCH_SD_POWER, 0);
727 730
731 pwm_add_table(h1940_pwm_lookup, ARRAY_SIZE(h1940_pwm_lookup));
728 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); 732 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
729 733
730 gpio_request(S3C2410_GPA(1), "Red LED blink"); 734 gpio_request(S3C2410_GPA(1), "Red LED blink");