diff options
author | Mitch Luban <mluban@nvidia.com> | 2013-10-30 15:57:32 -0700 |
---|---|---|
committer | Mitch Luban <mluban@nvidia.com> | 2013-10-30 18:33:12 -0700 |
commit | 175d35129b8a499e786ad779e913bb2c13caf3c0 (patch) | |
tree | 7f3ad80070548a91c05debd269ecbe9ff1814bb9 | |
parent | 2611486c29791d083a6a58bb88a23de042d38031 (diff) |
Revert "ARM: DT: Add DT entry for PWMs and Backlight"
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, 62 insertions, 289 deletions
diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt index ae7b689d727c..1e4fc727f3b1 100644 --- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt @@ -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>; - }; diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts index 12862916790d..5dc5b14cde6e 100644 --- a/arch/arm/boot/dts/tegra114-dalmore.dts +++ b/arch/arm/boot/dts/tegra114-dalmore.dts @@ -12,13 +12,6 @@ }; }; - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; - pinmux { pinctrl-names = "default"; pinctrl-0 = <&state_default>; diff --git a/arch/arm/boot/dts/tegra114-macallan.dts b/arch/arm/boot/dts/tegra114-macallan.dts index 30100aa245bf..44707e7394ac 100644 --- a/arch/arm/boot/dts/tegra114-macallan.dts +++ b/arch/arm/boot/dts/tegra114-macallan.dts @@ -12,13 +12,6 @@ }; }; - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; - pinmux { pinctrl-names = "default"; pinctrl-0 = <&state_default>; diff --git a/arch/arm/boot/dts/tegra114-pluto.dts b/arch/arm/boot/dts/tegra114-pluto.dts index 7a18b2e9d9b8..161f1e4514f4 100644 --- a/arch/arm/boot/dts/tegra114-pluto.dts +++ b/arch/arm/boot/dts/tegra114-pluto.dts @@ -23,13 +23,6 @@ }; }; - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; - pinmux { pinctrl-names = "default"; pinctrl-0 = <&state_default>; diff --git a/arch/arm/boot/dts/tegra114-roth.dts b/arch/arm/boot/dts/tegra114-roth.dts index 8436eb75142d..dbeb7ccab374 100644 --- a/arch/arm/boot/dts/tegra114-roth.dts +++ b/arch/arm/boot/dts/tegra114-roth.dts @@ -25,13 +25,6 @@ }; }; - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 40000>; - max-brightness = <255>; - default-brightness = <77>; - }; - pmc { status = "okay"; nvidia,invert-interrupt; diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi index a25c62bdc50d..3067aef87abc 100644 --- a/arch/arm/boot/dts/tegra114.dtsi +++ b/arch/arm/boot/dts/tegra114.dtsi @@ -291,6 +291,7 @@ reg = <0x7000a000 0x100>; #pwm-cells = <2>; clocks = <&tegra_car 17>; + status = "disabled"; }; i2c1: i2c@7000c000 { diff --git a/arch/arm/boot/dts/tegra124-ardbeg.dts b/arch/arm/boot/dts/tegra124-ardbeg.dts index d942372a7a45..8ed179dd5269 100644 --- a/arch/arm/boot/dts/tegra124-ardbeg.dts +++ b/arch/arm/boot/dts/tegra124-ardbeg.dts @@ -92,11 +92,4 @@ pout-gpio = <&gpio 190 0>; tout-gpio = <&gpio 112 0>; }; - - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-bonaire.dts b/arch/arm/boot/dts/tegra124-bonaire.dts index ebc01dc25bbf..50098f7eb660 100644 --- a/arch/arm/boot/dts/tegra124-bonaire.dts +++ b/arch/arm/boot/dts/tegra124-bonaire.dts @@ -19,11 +19,4 @@ device_type = "memory"; reg = <0x80000000 0x20000000>; }; - - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 2 5000000>; - max-brightness = <255>; - default-brightness = <224>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-bonaire_sim.dts b/arch/arm/boot/dts/tegra124-bonaire_sim.dts index 4383048beb51..5e4b57bb371b 100644 --- a/arch/arm/boot/dts/tegra124-bonaire_sim.dts +++ b/arch/arm/boot/dts/tegra124-bonaire_sim.dts @@ -18,11 +18,4 @@ device_type = "memory"; reg = <0x80000000 0x20000000>; }; - - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-laguna.dts b/arch/arm/boot/dts/tegra124-laguna.dts index 00ae376f3d12..2d24324b348c 100644 --- a/arch/arm/boot/dts/tegra124-laguna.dts +++ b/arch/arm/boot/dts/tegra124-laguna.dts @@ -85,11 +85,4 @@ 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>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-loki.dts b/arch/arm/boot/dts/tegra124-loki.dts index 2f604675d1a5..5ae9d8e5aad4 100644 --- a/arch/arm/boot/dts/tegra124-loki.dts +++ b/arch/arm/boot/dts/tegra124-loki.dts @@ -85,11 +85,4 @@ 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>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-soc.dtsi b/arch/arm/boot/dts/tegra124-soc.dtsi index 26920ebed2ac..53d4b2d87d31 100644 --- a/arch/arm/boot/dts/tegra124-soc.dtsi +++ b/arch/arm/boot/dts/tegra124-soc.dtsi @@ -41,13 +41,6 @@ #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>; diff --git a/arch/arm/boot/dts/tegra124-tn8.dts b/arch/arm/boot/dts/tegra124-tn8.dts index b1c74497a64a..d97c4fab0a0b 100644 --- a/arch/arm/boot/dts/tegra124-tn8.dts +++ b/arch/arm/boot/dts/tegra124-tn8.dts @@ -147,11 +147,5 @@ /include/ "tegra124-tn8-generic.dtsi" - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; }; diff --git a/arch/arm/boot/dts/tegra124-vcm30_t124.dts b/arch/arm/boot/dts/tegra124-vcm30_t124.dts index c2ff8a5ba69c..cfbbe1146bb5 100644 --- a/arch/arm/boot/dts/tegra124-vcm30_t124.dts +++ b/arch/arm/boot/dts/tegra124-vcm30_t124.dts @@ -42,11 +42,4 @@ status = "okay"; }; }; - - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm 1 1000000>; - max-brightness = <255>; - default-brightness = <224>; - }; }; diff --git a/arch/arm/mach-tegra/board-ardbeg.c b/arch/arm/mach-tegra/board-ardbeg.c index 37549640b8aa..0ebad4e44816 100644 --- a/arch/arm/mach-tegra/board-ardbeg.c +++ b/arch/arm/mach-tegra/board-ardbeg.c @@ -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 diff --git a/arch/arm/mach-tegra/board-bonaire-panel.c b/arch/arm/mach-tegra/board-bonaire-panel.c index 6cd1e1f23b20..712c1417fc36 100644 --- a/arch/arm/mach-tegra/board-bonaire-panel.c +++ b/arch/arm/mach-tegra/board-bonaire-panel.c @@ -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) diff --git a/arch/arm/mach-tegra/board-bonaire.c b/arch/arm/mach-tegra/board-bonaire.c index 05031c556f7d..ee50e445bcdb 100644 --- a/arch/arm/mach-tegra/board-bonaire.c +++ b/arch/arm/mach-tegra/board-bonaire.c @@ -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 diff --git a/arch/arm/mach-tegra/board-dalmore.c b/arch/arm/mach-tegra/board-dalmore.c index eadfce5de676..aae3b0445c3d 100644 --- a/arch/arm/mach-tegra/board-dalmore.c +++ b/arch/arm/mach-tegra/board-dalmore.c @@ -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 diff --git a/arch/arm/mach-tegra/board-loki.c b/arch/arm/mach-tegra/board-loki.c index 9ba061aeafff..d304218df82c 100644 --- a/arch/arm/mach-tegra/board-loki.c +++ b/arch/arm/mach-tegra/board-loki.c @@ -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 diff --git a/arch/arm/mach-tegra/board-macallan.c b/arch/arm/mach-tegra/board-macallan.c index dc1fd12c2b88..f46a41f25141 100644 --- a/arch/arm/mach-tegra/board-macallan.c +++ b/arch/arm/mach-tegra/board-macallan.c @@ -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 diff --git a/arch/arm/mach-tegra/board-pismo.c b/arch/arm/mach-tegra/board-pismo.c index b692178e996c..7fe9ddfa26bd 100644 --- a/arch/arm/mach-tegra/board-pismo.c +++ b/arch/arm/mach-tegra/board-pismo.c @@ -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 diff --git a/arch/arm/mach-tegra/board-pluto.c b/arch/arm/mach-tegra/board-pluto.c index aef182bc76c9..abd2694be241 100644 --- a/arch/arm/mach-tegra/board-pluto.c +++ b/arch/arm/mach-tegra/board-pluto.c @@ -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 diff --git a/arch/arm/mach-tegra/board-roth-panel.c b/arch/arm/mach-tegra/board-roth-panel.c index 696a3cf82f8d..3c702c2ee5a2 100644 --- a/arch/arm/mach-tegra/board-roth-panel.c +++ b/arch/arm/mach-tegra/board-roth-panel.c @@ -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 diff --git a/arch/arm/mach-tegra/board-roth.c b/arch/arm/mach-tegra/board-roth.c index 2c6e333f7ce6..eff5a0274d31 100644 --- a/arch/arm/mach-tegra/board-roth.c +++ b/arch/arm/mach-tegra/board-roth.c @@ -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 diff --git a/arch/arm/mach-tegra/board-vcm30_t124.c b/arch/arm/mach-tegra/board-vcm30_t124.c index 653d5b226cec..24e15f16a235 100644 --- a/arch/arm/mach-tegra/board-vcm30_t124.c +++ b/arch/arm/mach-tegra/board-vcm30_t124.c @@ -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 diff --git a/arch/arm/mach-tegra/panel-a-1080p-11-6.c b/arch/arm/mach-tegra/panel-a-1080p-11-6.c index d0b31c90a480..2d58496c7d80 100644 --- a/arch/arm/mach-tegra/panel-a-1080p-11-6.c +++ b/arch/arm/mach-tegra/panel-a-1080p-11-6.c @@ -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; } diff --git a/arch/arm/mach-tegra/panel-a-1080p-14-0.c b/arch/arm/mach-tegra/panel-a-1080p-14-0.c index 90a31a211e99..023133f51b2a 100644 --- a/arch/arm/mach-tegra/panel-a-1080p-14-0.c +++ b/arch/arm/mach-tegra/panel-a-1080p-14-0.c @@ -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) { diff --git a/arch/arm/mach-tegra/panel-a-edp-1080p-14-0.c b/arch/arm/mach-tegra/panel-a-edp-1080p-14-0.c index db1f667155c9..1935794e24b8 100644 --- a/arch/arm/mach-tegra/panel-a-edp-1080p-14-0.c +++ b/arch/arm/mach-tegra/panel-a-edp-1080p-14-0.c @@ -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) { diff --git a/arch/arm/mach-tegra/panel-c-lvds-1366-14.c b/arch/arm/mach-tegra/panel-c-lvds-1366-14.c index 11fc75726cfb..b77b5b56afac 100644 --- a/arch/arm/mach-tegra/panel-c-lvds-1366-14.c +++ b/arch/arm/mach-tegra/panel-c-lvds-1366-14.c @@ -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) { diff --git a/arch/arm/mach-tegra/panel-j-1440-810-5-8.c b/arch/arm/mach-tegra/panel-j-1440-810-5-8.c index 708e268fda63..7130df0a14b9 100644 --- a/arch/arm/mach-tegra/panel-j-1440-810-5-8.c +++ b/arch/arm/mach-tegra/panel-j-1440-810-5-8.c @@ -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, diff --git a/arch/arm/mach-tegra/panel-j-720p-4-7.c b/arch/arm/mach-tegra/panel-j-720p-4-7.c index 7839c3b3f512..bec074d49193 100644 --- a/arch/arm/mach-tegra/panel-j-720p-4-7.c +++ b/arch/arm/mach-tegra/panel-j-720p-4-7.c @@ -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, diff --git a/arch/arm/mach-tegra/panel-l-720p-5-loki.c b/arch/arm/mach-tegra/panel-l-720p-5-loki.c index 7df7df8e3b1e..e2c276c432a9 100644 --- a/arch/arm/mach-tegra/panel-l-720p-5-loki.c +++ b/arch/arm/mach-tegra/panel-l-720p-5-loki.c @@ -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, diff --git a/arch/arm/mach-tegra/panel-p-wuxga-10-1.c b/arch/arm/mach-tegra/panel-p-wuxga-10-1.c index 7ee0fc1721c2..7cf6556a6d18 100644 --- a/arch/arm/mach-tegra/panel-p-wuxga-10-1.c +++ b/arch/arm/mach-tegra/panel-p-wuxga-10-1.c @@ -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) { diff --git a/arch/arm/mach-tegra/panel-s-wqxga-10-1.c b/arch/arm/mach-tegra/panel-s-wqxga-10-1.c index af7307b6e7e9..7b8b0877f56f 100644 --- a/arch/arm/mach-tegra/panel-s-wqxga-10-1.c +++ b/arch/arm/mach-tegra/panel-s-wqxga-10-1.c @@ -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) { diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 0eab4dfa35a8..e4c6d2772717 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -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[] = { |