summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2018-03-27 16:36:23 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-03-28 18:40:19 +0200
commite81dd8a3500fea94ce8786554cbc29bc6b2a9207 (patch)
treed02226e829a0065c863a495067e3a7f07c540c38
parentaaa7a0c4587331ec1d92bf12c54b2928dc3cd602 (diff)
apalis-tk1: handle backlight in the device treeApalis-TK1_LXDE-Image_2.8b2.97-20180331toradex_tk1_l4t_r21.6
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi13
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi19
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi14
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi19
-rw-r--r--arch/arm/configs/apalis-tk1_defconfig1
-rw-r--r--drivers/video/tegra/dc/of_dc.c22
6 files changed, 25 insertions, 63 deletions
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
index cc48334..a951d3e 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
@@ -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>;
@@ -208,4 +208,15 @@
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>;
+ };
};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi
index e00f482..b4c08bb 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-fixed.dtsi
@@ -206,24 +206,5 @@
};
};
- 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";
- };
- };
- };
};
};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi
index a7774ab..7a86968 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi
@@ -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>;
@@ -208,5 +208,15 @@
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>;
+ };
};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi
index 5639ba3..98607a7 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi
@@ -206,24 +206,5 @@
};
};
- 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";
- };
- };
- };
};
};
diff --git a/arch/arm/configs/apalis-tk1_defconfig b/arch/arm/configs/apalis-tk1_defconfig
index 95b5512..e820c0d 100644
--- a/arch/arm/configs/apalis-tk1_defconfig
+++ b/arch/arm/configs/apalis-tk1_defconfig
@@ -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
diff --git a/drivers/video/tegra/dc/of_dc.c b/drivers/video/tegra/dc/of_dc.c
index ee1dc1f..1f38c3e 100644
--- a/drivers/video/tegra/dc/of_dc.c
+++ b/drivers/video/tegra/dc/of_dc.c
@@ -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;
}