Revert "ARM: DT: Add DT entry for PWMs and Backlight"
Mitch Luban [Wed, 30 Oct 2013 22:57:32 +0000 (15:57 -0700)]
This change prevented 25x16 panel from booting.

This reverts commit 30014ab843618322bb487e1e9e52edec3dfac4b6.

Change-Id: I0e41b1215772938be54faea6e5884177184c4036
Reviewed-on: http://git-master/r/309812
Tested-by: Mitch Luban <mluban@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

35 files changed:
Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
arch/arm/boot/dts/tegra114-dalmore.dts
arch/arm/boot/dts/tegra114-macallan.dts
arch/arm/boot/dts/tegra114-pluto.dts
arch/arm/boot/dts/tegra114-roth.dts
arch/arm/boot/dts/tegra114.dtsi
arch/arm/boot/dts/tegra124-ardbeg.dts
arch/arm/boot/dts/tegra124-bonaire.dts
arch/arm/boot/dts/tegra124-bonaire_sim.dts
arch/arm/boot/dts/tegra124-laguna.dts
arch/arm/boot/dts/tegra124-loki.dts
arch/arm/boot/dts/tegra124-soc.dtsi
arch/arm/boot/dts/tegra124-tn8.dts
arch/arm/boot/dts/tegra124-vcm30_t124.dts
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-bonaire-panel.c
arch/arm/mach-tegra/board-bonaire.c
arch/arm/mach-tegra/board-dalmore.c
arch/arm/mach-tegra/board-loki.c
arch/arm/mach-tegra/board-macallan.c
arch/arm/mach-tegra/board-pismo.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-roth-panel.c
arch/arm/mach-tegra/board-roth.c
arch/arm/mach-tegra/board-vcm30_t124.c
arch/arm/mach-tegra/panel-a-1080p-11-6.c
arch/arm/mach-tegra/panel-a-1080p-14-0.c
arch/arm/mach-tegra/panel-a-edp-1080p-14-0.c
arch/arm/mach-tegra/panel-c-lvds-1366-14.c
arch/arm/mach-tegra/panel-j-1440-810-5-8.c
arch/arm/mach-tegra/panel-j-720p-4-7.c
arch/arm/mach-tegra/panel-l-720p-5-loki.c
arch/arm/mach-tegra/panel-p-wuxga-10-1.c
arch/arm/mach-tegra/panel-s-wqxga-10-1.c
drivers/video/backlight/pwm_bl.c

index ae7b689..1e4fc72 100644 (file)
@@ -11,23 +11,13 @@ Required properties:
   - default-brightness-level: the default brightness level (index into the
       array defined by the "brightness-levels" property)
 
-   The following fields are mutually exclusive  with "brightness-levels"
-   and "default-brightness-level".It is used in case where levels are
-   not available on the backlight device and the device can interpolate
-   values.In this case the minium value that is considered is 0.
-
-  - max-brightness: the maximum brighness value that is allowed by the
-       backlight device.
-  - default-brightness: the default brighness value that is allowed by the
-       backlight device.
-
 Optional properties:
   - pwm-names: a list of names for the PWM devices specified in the
                "pwms" property (see PWM binding[0])
 
 [0]: Documentation/devicetree/bindings/pwm/pwm.txt
 
-Examples:
+Example:
 
        backlight {
                compatible = "pwm-backlight";
@@ -36,10 +26,3 @@ Examples:
                brightness-levels = <0 4 8 16 32 64 128 255>;
                default-brightness-level = <6>;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
index 1286291..5dc5b14 100644 (file)
                };
        };
 
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
-
        pinmux {
                pinctrl-names = "default";
                pinctrl-0 = <&state_default>;
index 30100aa..44707e7 100644 (file)
                };
        };
 
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
-
        pinmux {
                pinctrl-names = "default";
                pinctrl-0 = <&state_default>;
index 7a18b2e..161f1e4 100644 (file)
                };
        };
 
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
-
        pinmux {
                pinctrl-names = "default";
                pinctrl-0 = <&state_default>;
index 8436eb7..dbeb7cc 100644 (file)
                };
        };
 
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 40000>;
-               max-brightness = <255>;
-               default-brightness = <77>;
-       };
-
        pmc {
                status = "okay";
                nvidia,invert-interrupt;
index a25c62b..3067aef 100644 (file)
                reg = <0x7000a000 0x100>;
                #pwm-cells = <2>;
                clocks = <&tegra_car 17>;
+               status = "disabled";
        };
 
        i2c1: i2c@7000c000 {
index d942372..8ed179d 100644 (file)
                pout-gpio = <&gpio 190 0>;
                tout-gpio = <&gpio 112 0>;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
index ebc01dc..50098f7 100644 (file)
                device_type = "memory";
                reg = <0x80000000 0x20000000>;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 2 5000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
index 4383048..5e4b57b 100644 (file)
                device_type = "memory";
                reg = <0x80000000 0x20000000>;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
index 00ae376..2d24324 100644 (file)
                nvidia,core-power-req-active-high;
                nvidia,sys-clock-req-active-high;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
index 2f60467..5ae9d8e 100644 (file)
                nvidia,core-power-req-active-high;
                nvidia,sys-clock-req-active-high;
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 40000>;
-               max-brightness = <255>;
-               default-brightness = <77>;
-       };
 };
index 26920eb..53d4b2d 100644 (file)
                #clock-cells = <1>;
        };
 
-       pwm: pwm {
-               compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm";
-               reg = <0x7000a000 0x100>;
-               #pwm-cells = <2>;
-               clocks = <&tegra_car 17>;
-       };
-
        apbdma: dma@60020000 {
                compatible = "nvidia,tegra124-apbdma";
                reg = <0x60020000 0x1400>;
index b1c7449..d97c4fa 100644 (file)
 
 /include/ "tegra124-tn8-generic.dtsi"
 
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
 
index c2ff8a5..cfbbe11 100644 (file)
                        status = "okay";
                };
        };
-
-       backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 1 1000000>;
-               max-brightness = <255>;
-               default-brightness = <224>;
-       };
 };
index 3754964..0ebad4e 100644 (file)
@@ -940,10 +940,6 @@ static struct of_dev_auxdata ardbeg_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-i2c", 0x7000d100, "tegra12-i2c.5",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index 6cd1e1f..712c141 100644 (file)
@@ -758,9 +758,6 @@ static struct platform_device bonaire_nvmap_device = {
 
 static struct platform_device *bonaire_gfx_devices[] __initdata = {
        &bonaire_nvmap_device,
-};
-
-static struct platform_device *bonaire_backlight_devices[] __initdata = {
        &tegra_pwfm_device,
        &bonaire_backlight_device,
 };
@@ -799,12 +796,6 @@ int __init bonaire_panel_init(void)
        err = platform_add_devices(bonaire_gfx_devices,
                                   ARRAY_SIZE(bonaire_gfx_devices));
 
-       if (!of_have_populated_dt()) {
-               /* if error then appened the error */
-               err = platform_add_devices(bonaire_backlight_devices,
-                       ARRAY_SIZE(bonaire_backlight_devices));
-       }
-
 #ifdef CONFIG_TEGRA_GRHOST
        phost1x = bonaire_host1x_init();
        if (!phost1x)
index 05031c5..ee50e44 100644 (file)
@@ -616,10 +616,6 @@ struct of_dev_auxdata tegra_bonaire_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index eadfce5..aae3b04 100644 (file)
@@ -744,10 +744,6 @@ struct of_dev_auxdata dalmore_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index 9ba061a..d304218 100644 (file)
@@ -726,10 +726,6 @@ struct of_dev_auxdata loki_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-i2c", 0x7000d100, "tegra12-i2c.5",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index dc1fd12..f46a41f 100644 (file)
@@ -626,10 +626,6 @@ struct of_dev_auxdata macallan_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000d000, "tegra11-i2c.4",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index b692178..7fe9ddf 100644 (file)
@@ -729,10 +729,6 @@ struct of_dev_auxdata pismo_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index aef182b..abd2694 100644 (file)
@@ -1310,10 +1310,6 @@ struct of_dev_auxdata pluto_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index 696a3cf..3c702c2 100644 (file)
@@ -1004,13 +1004,11 @@ int __init roth_panel_init(int board_id)
                return err;
 
 #if IS_EXTERNAL_PWM
-       if (!of_have_populated_dt()) {
-               err = platform_add_devices(roth_bl_device,
+       err = platform_add_devices(roth_bl_device,
                                ARRAY_SIZE(roth_bl_device));
-               if (err) {
-                       pr_err("disp1 bl dev registration failed");
-                       return err;
-               }
+       if (err) {
+               pr_err("disp1 bl device registration failed");
+               return err;
        }
 #endif
 
index 2c6e333..eff5a02 100644 (file)
@@ -708,10 +708,6 @@ struct of_dev_auxdata roth_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra114-vi", TEGRA_VI_BASE, "vi", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-isp", TEGRA_ISP_BASE, "isp", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index 653d5b2..24e15f1 100644 (file)
@@ -481,10 +481,6 @@ struct of_dev_auxdata vcm30_t124_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-ahub", 0x70300000,
                                "tegra30-ahub-apbif", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-pwm", TEGRA_PWFM_BASE, "tegra-pwm",
-                               NULL),
-       OF_DEV_AUXDATA("pwm-backlight", NULL, "pwm-backlight",
-                               NULL),
        {}
 };
 #endif
index d0b31c9..2d58496 100644 (file)
@@ -403,14 +403,11 @@ static struct platform_device __maybe_unused
 static int  __init dsi_a_1080p_11_6_register_bl_dev(void)
 {
        int err = 0;
-       if (!of_have_populated_dt()) {
-               err =
-               platform_add_devices(dsi_a_1080p_11_6_bl_devices,
-                       ARRAY_SIZE(dsi_a_1080p_11_6_bl_devices));
-               if (err) {
-                       pr_err("disp1 bl device registration failed");
-                       return err;
-               }
+       err = platform_add_devices(dsi_a_1080p_11_6_bl_devices,
+                               ARRAY_SIZE(dsi_a_1080p_11_6_bl_devices));
+       if (err) {
+               pr_err("disp1 bl device registration failed");
+               return err;
        }
        return err;
 }
index 90a31a2..023133f 100644 (file)
@@ -400,7 +400,7 @@ static struct platform_device __maybe_unused
        &dsi_a_1080p_14_0_bl_device,
 };
 
-static int  __init __dsi_a_1080p_14_0_register_bl_dev(void)
+static int  __init dsi_a_1080p_14_0_register_bl_dev(void)
 {
        int err = 0;
        err = platform_add_devices(dsi_a_1080p_14_0_bl_devices,
@@ -412,14 +412,6 @@ static int  __init __dsi_a_1080p_14_0_register_bl_dev(void)
        return err;
 }
 
-static int  __init dsi_a_1080p_14_0_register_bl_dev(void)
-{
-       int err = 0;
-       if (!of_have_populated_dt())
-               err = __dsi_a_1080p_14_0_register_bl_dev();
-       return err;
-}
-
 static void dsi_a_1080p_14_0_set_disp_device(
        struct platform_device *laguna_display_device)
 {
index db1f667..1935794 100644 (file)
@@ -312,7 +312,7 @@ static struct platform_device __maybe_unused
        &edp_a_1080p_14_0_bl_device,
 };
 
-static int  __init __edp_a_1080p_14_0_register_bl_dev(void)
+static int  __init edp_a_1080p_14_0_register_bl_dev(void)
 {
        int err = 0;
        err = platform_add_devices(edp_a_1080p_14_0_bl_devices,
@@ -324,14 +324,6 @@ static int  __init __edp_a_1080p_14_0_register_bl_dev(void)
        return err;
 }
 
-static int  __init edp_a_1080p_14_0_register_bl_dev(void)
-{
-       int err = 0;
-       if (!of_have_populated_dt())
-               err = __edp_a_1080p_14_0_register_bl_dev();
-       return err;
-}
-
 static void edp_a_1080p_14_0_set_disp_device(
        struct platform_device *laguna_display_device)
 {
index 11fc757..b77b5b5 100644 (file)
@@ -329,7 +329,7 @@ static struct platform_device __maybe_unused
        &lvds_c_1366_14_bl_device,
 };
 
-static int  __init __lvds_c_1366_14_register_bl_dev(void)
+static int  __init lvds_c_1366_14_register_bl_dev(void)
 {
        int err = 0;
        err = platform_add_devices(lvds_c_1366_14_bl_devices,
@@ -341,14 +341,6 @@ static int  __init __lvds_c_1366_14_register_bl_dev(void)
        return err;
 }
 
-static int  __init lvds_c_1366_14_register_bl_dev(void)
-{
-       int err = 0;
-       if (!of_have_populated_dt())
-               err = __lvds_c_1366_14_register_bl_dev();
-       return 0;
-}
-
 static void lvds_c_1366_14_set_disp_device(
        struct platform_device *laguna_display_device)
 {
index 708e268..7130df0 100644 (file)
@@ -479,19 +479,16 @@ static int dsi_j_1440_810_5_8_register_bl_dev(void)
 {
        int err = 0;
 
-       if (!of_have_populated_dt()) {
-               err = platform_device_register(&tegra_pwfm_device);
-               if (err) {
-                       pr_err("disp1 pwm device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&tegra_pwfm_device);
+       if (err) {
+               pr_err("disp1 pwm device registration failed");
+               return err;
+       }
 
-               err = platform_device_register
-                               (&dsi_j_1440_810_5_8_bl_device);
-               if (err) {
-                       pr_err("disp1 bl device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&dsi_j_1440_810_5_8_bl_device);
+       if (err) {
+               pr_err("disp1 bl device registration failed");
+               return err;
        }
 
        err = gpio_request(dsi_j_1440_810_5_8_pdata.dsi_panel_bl_pwm_gpio,
index 7839c3b..bec074d 100644 (file)
@@ -135,18 +135,16 @@ static struct tegra_dsi_out dsi_j_720p_4_7_pdata;
 static int dsi_j_720p_4_7_register_bl_dev(void)
 {
        int err = 0;
-       if (!of_have_populated_dt()) {
-               err = platform_device_register(&tegra_pwfm_device);
-               if (err) {
-                       pr_err("disp1 pwm device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&tegra_pwfm_device);
+       if (err) {
+               pr_err("disp1 pwm device registration failed");
+               return err;
+       }
 
-               err = platform_device_register(&dsi_j_720p_4_7_bl_device);
-               if (err) {
-                       pr_err("disp1 bl device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&dsi_j_720p_4_7_bl_device);
+       if (err) {
+               pr_err("disp1 bl device registration failed");
+               return err;
        }
 
        err = gpio_request(dsi_j_720p_4_7_pdata.dsi_panel_bl_pwm_gpio,
index 7df7df8..e2c276c 100644 (file)
@@ -579,19 +579,16 @@ static int dsi_l_720p_5_loki_register_bl_dev(void)
 {
        int err = 0;
 
-       if (!of_have_populated_dt()) {
-               err = platform_device_register(&tegra_pwfm_device);
-               if (err) {
-                       pr_err("disp1 pwm device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&tegra_pwfm_device);
+       if (err) {
+               pr_err("disp1 pwm device registration failed");
+               return err;
+       }
 
-               err = platform_device_register(
-                                       &dsi_l_720p_5_loki_bl_device);
-               if (err) {
-                       pr_err("disp1 bl device registration failed");
-                       return err;
-               }
+       err = platform_device_register(&dsi_l_720p_5_loki_bl_device);
+       if (err) {
+               pr_err("disp1 bl device registration failed");
+               return err;
        }
 
        err = gpio_request(dsi_l_720p_5_loki_pdata.dsi_panel_bl_pwm_gpio,
index 7ee0fc1..7cf6556 100644 (file)
@@ -619,7 +619,7 @@ static unsigned int dsi_p_tn8_edp_brightness[] = {
        255, 227, 199, 171, 143, 115, 87, 59, 31, 0
 };
 
-static int  __init __dsi_p_wuxga_10_1_register_bl_dev(void)
+static int  __init dsi_p_wuxga_10_1_register_bl_dev(void)
 {
        int err = 0;
        struct board_info board_info;
@@ -648,14 +648,6 @@ static int  __init __dsi_p_wuxga_10_1_register_bl_dev(void)
        return err;
 }
 
-static int  __init dsi_p_wuxga_10_1_register_bl_dev(void)
-{
-       int err = 0;
-       if (!of_have_populated_dt())
-               err = __dsi_p_wuxga_10_1_register_bl_dev();
-       return err;
-}
-
 static void dsi_p_wuxga_10_1_set_disp_device(
        struct platform_device *display_device)
 {
index af7307b..7b8b087 100644 (file)
@@ -690,7 +690,7 @@ static unsigned int dsi_s_tn8_edp_brightness[] = {
        255, 227, 199, 171, 143, 115, 87, 59, 31, 0
 };
 
-static int __init __dsi_s_wqxga_10_1_register_bl_dev(void)
+static int __init dsi_s_wqxga_10_1_register_bl_dev(void)
 {
        int err = 0;
        struct board_info board_info;
@@ -719,14 +719,6 @@ static int __init __dsi_s_wqxga_10_1_register_bl_dev(void)
        return err;
 }
 
-static int __init dsi_s_wqxga_10_1_register_bl_dev(void)
-{
-       int err = 0;
-       if (!of_have_populated_dt())
-               err = __dsi_s_wqxga_10_1_register_bl_dev();
-       return err;
-}
-
 static void dsi_s_wqxga_10_1_set_disp_device(
        struct platform_device *dalmore_display_device)
 {
index 0eab4df..e4c6d27 100644 (file)
@@ -150,17 +150,29 @@ static const struct backlight_ops pwm_backlight_ops = {
 };
 
 #ifdef CONFIG_OF
-static int parse_level_brightness_dt(struct device *dev,
-                                 struct platform_pwm_backlight_data *data,
-                                 int max_brightness)
+static int pwm_backlight_parse_dt(struct device *dev,
+                                 struct platform_pwm_backlight_data *data)
 {
        struct device_node *node = dev->of_node;
-       data->max_brightness = max_brightness;
+       struct property *prop;
+       int length;
+       u32 value;
+       int ret;
+
+       if (!node)
+               return -ENODEV;
+
+       memset(data, 0, sizeof(*data));
+
+       /* determine the number of brightness levels */
+       prop = of_find_property(node, "brightness-levels", &length);
+       if (!prop)
+               return -EINVAL;
+
+       data->max_brightness = length / sizeof(u32);
 
        /* read brightness levels from DT property */
        if (data->max_brightness > 0) {
-               u32 value;
-               int ret;
                size_t size = sizeof(*data->levels) * data->max_brightness;
 
                data->levels = devm_kzalloc(dev, size, GFP_KERNEL);
@@ -188,55 +200,13 @@ static int parse_level_brightness_dt(struct device *dev,
                data->max_brightness--;
        }
 
-       return 0;
-}
-
-static int parse_interpole_brightness_dt(struct device *dev,
-                                 struct platform_pwm_backlight_data *data)
-{
-       int ret = 0;
-       struct device_node *node = dev->of_node;
-
-       ret = of_property_read_u32(node, "max-brightness",
-                                       &data->max_brightness);
-       if (ret < 0)
-               goto end;
-
-       ret = of_property_read_u32(node, "default-brightness",
-                                       &data->dft_brightness);
-       if (ret < 0)
-               goto end;
-end:
-       return ret;
-}
-
-static int pwm_backlight_parse_dt(struct device *dev,
-                                 struct platform_pwm_backlight_data *data)
-{
-       struct device_node *node = dev->of_node;
-       struct property *prop;
-       int length;
-
-       if (!node)
-               return -ENODEV;
-
-       memset(data, 0, sizeof(*data));
-
        /*
         * TODO: Most users of this driver use a number of GPIOs to control
         *       backlight power. Support for specifying these needs to be
         *       added.
         */
 
-       /* determine the number of brightness levels if available else
-        * use the interpolation method to get the maximum brightness
-        * that can be set*/
-       prop = of_find_property(node, "brightness-levels", &length);
-       if (prop)
-               return parse_level_brightness_dt(dev,
-                                       data, length / sizeof(u32));
-       else
-               return parse_interpole_brightness_dt(dev, data);
+       return 0;
 }
 
 static struct of_device_id pwm_backlight_of_match[] = {