apalis-tk1: handle backlight in the device tree Apalis-TK1_LXDE-Image_2.8b2.97-20180331
authorDominik Sliwa <dominik.sliwa@toradex.com>
Tue, 27 Mar 2018 14:36:23 +0000 (16:36 +0200)
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>
Wed, 28 Mar 2018 16:40:19 +0000 (18:40 +0200)
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi
arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi
arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi
arch/arm/configs/apalis-tk1_defconfig
drivers/video/tegra/dc/of_dc.c

index cc48334cdc68e07d905c14fd6c25886ef4cc2948..a951d3e219273b5c3d50174613267788139c4d57 100644 (file)
@@ -69,7 +69,7 @@
                                        status = "okay";
                                        nvidia,out-type = <TEGRA_DC_OUT_DP>;
                                        nvidia,out-flags = <TEGRA_DC_OUT_CONTINUOUS_MODE>;
-                                       nvidia,out-parent-clk = "pll_d";
+                                       nvidia,out-parent-clk = "pll_d_out0";
                                        nvidia,out-max-pixclk = <3367>; /* KHZ2PICOS(297000) */
                                        nvidia,out-align = <TEGRA_DC_ALIGN_MSB>;
                                        nvidia,out-order = <TEGRA_DC_ORDER_RED_BLUE>;
        hdmi_ddc: i2c@7000c400 {
                clock-frequency = <10000>;
        };
+
+       bl: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&tegra_pwm 3 5000000>; /* PWM freq. 200Hz */
+
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <6>;
+
+               enable-gpios = <&gpio TEGRA_GPIO(BB, 5) 0>;
+               power-supply = <&reg_3v3_mxm>;
+       };
 };
index e00f482907b7780d5cdd9ef110b04264655701cd..b4c08bb002bb0ff6323472f0534949e7e6d83881 100644 (file)
                        };
                };
 
-               vdd_lcd_bl_en: regulator@6 {
-                       compatible = "regulator-fixed-sync";
-                       reg = <6>;
-                       regulator-name = "BKL1_ON";
-                       regulator-min-microvolt = <3300000>;
-                       regulator-max-microvolt = <3300000>;
-                       /* Apalis BKL1_ON */
-                       gpio = <&gpio TEGRA_GPIO(BB, 5) 0>;
-                       enable-active-high;
-
-                       consumers {
-                               c1 {
-                                       regulator-consumer-supply = "vdd_lcd_bl";
-                               };
-                               c2 {
-                                       regulator-consumer-supply = "vdd_lcd_bl_en";
-                               };
-                       };
-               };
        };
 };
index a7774abcda1d9a46ab1a2995d24c6903a657c182..7a86968c51f38b907e24c14f9b43c3f8f6ed15e6 100644 (file)
@@ -69,7 +69,7 @@
                                        status = "okay";
                                        nvidia,out-type = <TEGRA_DC_OUT_DP>;
                                        nvidia,out-flags = <TEGRA_DC_OUT_CONTINUOUS_MODE>;
-                                       nvidia,out-parent-clk = "pll_d";
+                                       nvidia,out-parent-clk = "pll_d_out0";
                                        nvidia,out-max-pixclk = <3367>; /* KHZ2PICOS(297000) */
                                        nvidia,out-align = <TEGRA_DC_ALIGN_MSB>;
                                        nvidia,out-order = <TEGRA_DC_ORDER_RED_BLUE>;
        hdmi_ddc: i2c@7000c700 {
                clock-frequency = <10000>;
        };
-       
+
+       bl: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&tegra_pwm 3 5000000>; /* PWM freq. 200Hz */
+
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <6>;
+
+               enable-gpios = <&gpio TEGRA_GPIO(BB, 5) 0>;
+               power-supply = <&reg_3v3_mxm>;
+       };
 };
index 5639ba3c7f993d93ce2f8ac6e7243232a65a995e..98607a7ecdc10464d34163e930ef260a4ec3cfd8 100644 (file)
                        };
                };
 
-               vdd_lcd_bl_en: regulator@6 {
-                       compatible = "regulator-fixed-sync";
-                       reg = <6>;
-                       regulator-name = "BKL1_ON";
-                       regulator-min-microvolt = <3300000>;
-                       regulator-max-microvolt = <3300000>;
-                       /* Apalis BKL1_ON */
-                       gpio = <&gpio TEGRA_GPIO(BB, 5) 0>;
-                       enable-active-high;
-
-                       consumers {
-                               c1 {
-                                       regulator-consumer-supply = "vdd_lcd_bl";
-                               };
-                               c2 {
-                                       regulator-consumer-supply = "vdd_lcd_bl_en";
-                               };
-                       };
-               };
        };
 };
index 95b55128f72ae0ceb8ab3147bc08c3c42a1f9132..e820c0ded65f5e7e9ff61506569a483464f5e66a 100644 (file)
@@ -294,7 +294,6 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_BACKLIGHT_PWM=y
-CONFIG_BACKLIGHT_TEGRA_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
index ee1dc1f81f874f715b14eb70e60e8c3e1228041c..1f38c3e8e36bb61a7b913b943faeb6d6316f11d8 100644 (file)
@@ -73,7 +73,6 @@ static struct regulator *of_hdmi_vddio;
 static struct regulator *of_hdmi_reg;
 static struct regulator *of_hdmi_pll;
 static struct regulator *of_lvds_dp_reg;
-static struct regulator *of_lvds_bl_reg;
 
 #ifdef CONFIG_TEGRA_DC_CMU
 static struct tegra_dc_cmu default_cmu = {
@@ -1647,21 +1646,7 @@ static int dc_lvds_enable(struct device *dev)
                of_lvds_dp_reg = NULL;
                return ret;
        }
-
-       if (!of_lvds_bl_reg) {
-               of_lvds_bl_reg = regulator_get(dev, "vdd_lcd_bl");
-               if (IS_ERR_OR_NULL(of_lvds_bl_reg)) {
-                       pr_err("lvds: couldn't get regulator vdd_lcd_bl\n");
-                       of_lvds_bl_reg = NULL;
-               }
-       }
-
-       if (of_lvds_bl_reg) {
-               if (regulator_enable(of_lvds_bl_reg) < 0)
-                       pr_err("vdd_lcd_bl failed to enable\n");
-       }
-
-       return 0;
+       return ret;
 }
 
 static int dc_lvds_disable(void)
@@ -1671,11 +1656,6 @@ static int dc_lvds_disable(void)
                regulator_put(of_lvds_dp_reg);
                of_lvds_dp_reg = NULL;
        }
-       if (of_lvds_bl_reg) {
-               regulator_disable(of_lvds_bl_reg);
-               regulator_put(of_lvds_bl_reg);
-               of_lvds_bl_reg = NULL;
-       }
        return 0;
 }