]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: SAMSUNG: Modify board files to use new PWM platform device
authorTomasz Figa <tomasz.figa@gmail.com>
Sat, 9 Mar 2013 14:37:53 +0000 (15:37 +0100)
committerTomasz Figa <tomasz.figa@gmail.com>
Mon, 12 Aug 2013 19:53:22 +0000 (21:53 +0200)
This patch modifies any board files using the legacy PWM device to use
the new device instead.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Mark Brown <broonie@linaro.org>
Tested-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-s3c24xx/mach-h1940.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-s3c64xx/mach-hmt.c
arch/arm/mach-s3c64xx/mach-smartq.c
arch/arm/mach-s3c64xx/mach-smdk6410.c
arch/arm/mach-s5p64x0/mach-smdk6440.c
arch/arm/mach-s5p64x0/mach-smdk6450.c
arch/arm/mach-s5pc100/mach-smdkc100.c
arch/arm/mach-s5pv210/mach-smdkv210.c
arch/arm/plat-samsung/dev-backlight.c

index af4334d6b4d532c60937154019a7816e4276f36c..74dd47988b415b217dbcd931794e4fd40d5dcdd4 100644 (file)
@@ -512,7 +512,7 @@ static struct platform_pwm_backlight_data backlight_data = {
 static struct platform_device h1940_backlight = {
        .name = "pwm-backlight",
        .dev  = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &backlight_data,
        },
        .id   = -1,
@@ -632,7 +632,7 @@ static struct platform_device *h1940_devices[] __initdata = {
        &h1940_device_bluetooth,
        &s3c_device_sdi,
        &s3c_device_rtc,
-       &s3c_device_timer[0],
+       &samsung_device_pwm,
        &h1940_backlight,
        &h1940_lcd_powerdev,
        &s3c_device_adc,
index 44ca018e1f9654ff07e90973ad572d8a3601ecbb..206b1f7546d16e973aaa60030ce777684cdbfe57 100644 (file)
@@ -530,7 +530,7 @@ static struct platform_pwm_backlight_data rx1950_backlight_data = {
 static struct platform_device rx1950_backlight = {
        .name = "pwm-backlight",
        .dev = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &rx1950_backlight_data,
        },
 };
@@ -717,8 +717,7 @@ static struct platform_device *rx1950_devices[] __initdata = {
        &s3c_device_sdi,
        &s3c_device_adc,
        &s3c_device_ts,
-       &s3c_device_timer[0],
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &rx1950_backlight,
        &rx1950_device_gpiokeys,
        &power_supply,
index 8ad88ace795a41cc617a1cdba91aa08e46856e04..28889cc788b3c592acb6493603b6ae95cc549de6 100644 (file)
@@ -120,7 +120,7 @@ static struct platform_device crag6410_backlight_device = {
        .name           = "pwm-backlight",
        .id             = -1,
        .dev            = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &crag6410_backlight_data,
        },
 };
@@ -375,7 +375,7 @@ static struct platform_device *crag6410_devices[] __initdata = {
        &s3c_device_fb,
        &s3c_device_ohci,
        &s3c_device_usb_hsotg,
-       &s3c_device_timer[0],
+       &samsung_device_pwm,
        &s3c64xx_device_iis0,
        &s3c64xx_device_iis1,
        &samsung_device_keypad,
index 5b7f357d8c22c1de54a8e62a8b8225cf48af63e6..f39569e0f2e6c4045f95e333a255c72d87be4c98 100644 (file)
@@ -123,7 +123,7 @@ static struct platform_pwm_backlight_data hmt_backlight_data = {
 static struct platform_device hmt_backlight_device = {
        .name           = "pwm-backlight",
        .dev            = {
-               .parent = &s3c_device_timer[1].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &hmt_backlight_data,
        },
 };
@@ -239,7 +239,7 @@ static struct platform_device *hmt_devices[] __initdata = {
        &s3c_device_nand,
        &s3c_device_fb,
        &s3c_device_ohci,
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &hmt_backlight_device,
        &hmt_leds_device,
 };
index 58ac99041274e86b187826f8349bcf8c93d53d9b..86d980b448fd0bc272e1e0cf1ab616f0e32ab24e 100644 (file)
@@ -157,7 +157,7 @@ static struct platform_pwm_backlight_data smartq_backlight_data = {
 static struct platform_device smartq_backlight_device = {
        .name           = "pwm-backlight",
        .dev            = {
-               .parent = &s3c_device_timer[1].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &smartq_backlight_data,
        },
 };
@@ -246,7 +246,7 @@ static struct platform_device *smartq_devices[] __initdata = {
        &s3c_device_i2c0,
        &s3c_device_ohci,
        &s3c_device_rtc,
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_usb_hsotg,
        &s3c64xx_device_iis0,
index bd3295a19ad7dc02f18f3e38c335d4ca2deda8f7..d90b450c5645bb9f9c10944a65e3086623e25b3b 100644 (file)
@@ -274,6 +274,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
        &s3c_device_i2c1,
        &s3c_device_fb,
        &s3c_device_ohci,
+       &samsung_device_pwm,
        &s3c_device_usb_hsotg,
        &s3c64xx_device_iisv4,
        &samsung_device_keypad,
@@ -691,9 +692,9 @@ static void __init smdk6410_machine_init(void)
 
        s3c_ide_set_platdata(&smdk6410_ide_pdata);
 
-       samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
-
        platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
+
+       samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
 }
 
 MACHINE_START(SMDK6410, "SMDK6410")
index 73f71a698a3434b26cca9a26128ae746dc719363..0b00304c1e91840f1760c4cae2c80b4d9441ea79 100644 (file)
@@ -162,6 +162,7 @@ static struct platform_device *smdk6440_devices[] __initdata = {
        &s3c_device_rtc,
        &s3c_device_i2c0,
        &s3c_device_i2c1,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &s5p6440_device_iis,
@@ -254,8 +255,6 @@ static void __init smdk6440_machine_init(void)
        i2c_register_board_info(1, smdk6440_i2c_devs1,
                        ARRAY_SIZE(smdk6440_i2c_devs1));
 
-       samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
-
        s5p6440_set_lcd_interface();
        s3c_fb_set_platdata(&smdk6440_lcd_pdata);
 
@@ -264,6 +263,8 @@ static void __init smdk6440_machine_init(void)
        s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata);
 
        platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
+
+       samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
 }
 
 MACHINE_START(SMDK6440, "SMDK6440")
index 18303e12019f3bffe1784950870f532b663f0ab0..5949296e88fdc07af89538478f88e0a142e5f3b7 100644 (file)
@@ -180,6 +180,7 @@ static struct platform_device *smdk6450_devices[] __initdata = {
        &s3c_device_rtc,
        &s3c_device_i2c0,
        &s3c_device_i2c1,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &s5p6450_device_iis0,
@@ -273,8 +274,6 @@ static void __init smdk6450_machine_init(void)
        i2c_register_board_info(1, smdk6450_i2c_devs1,
                        ARRAY_SIZE(smdk6450_i2c_devs1));
 
-       samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
-
        s5p6450_set_lcd_interface();
        s3c_fb_set_platdata(&smdk6450_lcd_pdata);
 
@@ -283,6 +282,8 @@ static void __init smdk6450_machine_init(void)
        s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata);
 
        platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
+
+       samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
 }
 
 MACHINE_START(SMDK6450, "SMDK6450")
index 8c880f76f27436302d739bc9f877c6769b67724b..7c57a221785e65d3aeb55e9c637397b91a857daa 100644 (file)
@@ -194,6 +194,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
        &s3c_device_hsmmc0,
        &s3c_device_hsmmc1,
        &s3c_device_hsmmc2,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &smdkc100_lcd_powerdev,
@@ -246,9 +247,9 @@ static void __init smdkc100_machine_init(void)
        gpio_request(S5PC100_GPH0(6), "GPH0");
        smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 
-       samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data);
-
        platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
+
+       samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data);
 }
 
 MACHINE_START(SMDKC100, "SMDKC100")
index d50b6f124465e2cac96e524ba16639b64f57e3ed..6d72bb992e389b59872b3fead4742d4d3669e3bb 100644 (file)
@@ -218,6 +218,7 @@ static struct platform_device *smdkv210_devices[] __initdata = {
        &s3c_device_i2c0,
        &s3c_device_i2c1,
        &s3c_device_i2c2,
+       &samsung_device_pwm,
        &s3c_device_rtc,
        &s3c_device_ts,
        &s3c_device_usb_hsotg,
@@ -316,11 +317,11 @@ static void __init smdkv210_machine_init(void)
 
        s3c_fb_set_platdata(&smdkv210_lcd0_pdata);
 
-       samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
-
        s3c_hsotg_set_platdata(&smdkv210_hsotg_pdata);
 
        platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
+
+       samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
 }
 
 MACHINE_START(SMDKV210, "SMDKV210")
index e467a01dc2f9da45473d836b4e8095eeb08848d9..d51f9565567cd1d27a197ab83a7ab35618072147 100644 (file)
@@ -132,14 +132,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
        if (bl_data->check_fb)
                samsung_bl_data->check_fb = bl_data->check_fb;
 
-       /* Register the specific PWM timer dev for Backlight control */
-       ret = platform_device_register(
-                       &s3c_device_timer[samsung_bl_data->pwm_id]);
-       if (ret) {
-               printk(KERN_ERR "failed to register pwm timer for backlight: %d\n", ret);
-               goto err_plat_reg1;
-       }
-
        /* Register the Backlight dev */
        ret = platform_device_register(samsung_bl_device);
        if (ret) {
@@ -150,8 +142,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
        return;
 
 err_plat_reg2:
-       platform_device_unregister(&s3c_device_timer[samsung_bl_data->pwm_id]);
-err_plat_reg1:
        kfree(samsung_bl_data);
 err_data:
        kfree(samsung_bl_device);