summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2017-10-03 14:58:33 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-10-05 01:10:42 +0200
commit4162e8426c79448239da03cd2ab8b951d2b49e32 (patch)
tree4f444b79c29949627d8fc84b44c7ab06dad0f916
parent9382b7e30394dd909ef0cbb610ccf06ef1863640 (diff)
ARM: tegra: apalis-tk1: move hdmi ddc config to dt
We moved HDMI DDC configuration to the device-tree. If DDC config is missing from the device-tree we default to v1.2 config. 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-apalis-eval.dts1
-rw-r--r--arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts3
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi12
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi12
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-gpio.dtsi65
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi2
-rw-r--r--arch/arm/mach-tegra/board-apalis-tk1-panel.c18
7 files changed, 109 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/tegra124-apalis-eval.dts b/arch/arm/boot/dts/tegra124-apalis-eval.dts
index 37b3d35..a918523 100644
--- a/arch/arm/boot/dts/tegra124-apalis-eval.dts
+++ b/arch/arm/boot/dts/tegra124-apalis-eval.dts
@@ -1,6 +1,7 @@
/dts-v1/;
#include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-apalis-displays.dtsi"
#include "tegra124-platforms/tegra124-apalis-keys.dtsi"
#include "tegra124-platforms/tegra124-apalis-gpio.dtsi"
#include "tegra124-platforms/tegra124-apalis-pinmux.dtsi"
diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts b/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
index 35caf0f..786488a 100644
--- a/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
+++ b/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
@@ -1,8 +1,9 @@
/dts-v1/;
#include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi"
#include "tegra124-platforms/tegra124-apalis-keys.dtsi"
-#include "tegra124-platforms/tegra124-apalis-gpio.dtsi"
+#include "tegra124-platforms/tegra124-apalis-v1.2-gpio.dtsi"
#include "tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi"
#include "tegra124-platforms/tegra124-apalis-pmic.dtsi"
#include "tegra124-platforms/tegra124-apalis-v1.2-fixed.dtsi"
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
new file mode 100644
index 0000000..d9eeadc
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-displays.dtsi
@@ -0,0 +1,12 @@
+/ {
+ host1x {
+ hdmi {
+ status = "okay";
+ nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+ };
+ };
+
+ hdmi_ddc: i2c@7000c400 {
+ clock-frequency = <10000>;
+ };
+};
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
new file mode 100644
index 0000000..e7141b3
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-displays.dtsi
@@ -0,0 +1,12 @@
+/ {
+ host1x {
+ hdmi {
+ status = "okay";
+ nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+ };
+ };
+
+ hdmi_ddc: i2c@7000c700 {
+ clock-frequency = <10000>;
+ };
+};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-gpio.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-gpio.dtsi
new file mode 100644
index 0000000..54f0534
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-gpio.dtsi
@@ -0,0 +1,65 @@
+#include <dt-bindings/gpio/tegra-gpio.h>
+
+/ {
+ gpio: gpio@6000d000 {
+ gpio-init-names = "default";
+ gpio-init-0 = <&gpio_default>;
+
+ gpio_default: default {
+ gpio-input = <
+ TEGRA_GPIO(A, 1)
+ TEGRA_GPIO(B, 1)
+ TEGRA_GPIO(I, 5)
+ TEGRA_GPIO(I, 6)
+ TEGRA_GPIO(J, 0)
+ TEGRA_GPIO(J, 2)
+ TEGRA_GPIO(K, 2)
+ TEGRA_GPIO(K, 7)
+ TEGRA_GPIO(N, 7)
+ TEGRA_GPIO(T, 5)
+ TEGRA_GPIO(T, 6)
+ TEGRA_GPIO(O, 5)
+ TEGRA_GPIO(V, 3)
+ TEGRA_GPIO(W, 3)
+ TEGRA_GPIO(W, 5)
+ TEGRA_GPIO(BB, 0)
+ TEGRA_GPIO(BB, 4)
+ TEGRA_GPIO(CC, 5)
+ TEGRA_GPIO(DD, 1)
+ TEGRA_GPIO(DD, 2)
+ TEGRA_GPIO(DD, 3)
+ TEGRA_GPIO(DD, 5)
+ TEGRA_GPIO(DD, 6)
+ TEGRA_GPIO(EE, 3)
+ TEGRA_GPIO(EE, 5)
+ TEGRA_GPIO(FF, 1)
+ >;
+ gpio-output-low = <
+ TEGRA_GPIO(C, 0)
+ TEGRA_GPIO(O, 5) /* LAN_WAKE_N */
+ TEGRA_GPIO(O, 6) /* LAN_DEV_OFF_N */
+ TEGRA_GPIO(Q, 0) /* Shift_CTRL_OE[0] */
+ TEGRA_GPIO(Q, 1) /* Shift_CTRL_OE[1] */
+ TEGRA_GPIO(Q, 2) /* Shift_CTRL_OE[2] */
+ TEGRA_GPIO(Q, 4) /* Shift_CTRL_OE[4] */
+ TEGRA_GPIO(R, 0) /* Shift_CTRL_Dir_In[0] */
+ TEGRA_GPIO(R, 1) /* Shift_CTRL_Dir_In[1] */
+ TEGRA_GPIO(R, 2) /* Shift_CTRL_OE[3] */
+ TEGRA_GPIO(S, 2) /* LAN_RESET_N */
+ TEGRA_GPIO(S, 3) /* Shift_CTRL_Dir_In[2] */
+ TEGRA_GPIO(U, 4) /* RESET_MOCI_CTRL */
+ TEGRA_GPIO(BB, 3)
+ TEGRA_GPIO(BB, 6)
+ >;
+ gpio-output-high = <
+ TEGRA_GPIO(N, 2)
+ TEGRA_GPIO(N, 4)
+ TEGRA_GPIO(N, 5)
+ TEGRA_GPIO(Q, 5) /* Shift_CTRL_Dir_Out[0] */
+ TEGRA_GPIO(Q, 6) /* Shift_CTRL_Dir_Out[1] */
+ TEGRA_GPIO(Q, 7) /* Shift_CTRL_Dir_Out[2] */
+ TEGRA_GPIO(BB, 5)
+ >;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi
index 4433616..d49673f 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-apalis-v1.2-pinmux.dtsi
@@ -247,7 +247,6 @@
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
- nvidia,rcv-sel = <TEGRA_PIN_DISABLE>;
};
ddc_sda_pv5 {
nvidia,pins = "ddc_sda_pv5";
@@ -255,7 +254,6 @@
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
- nvidia,rcv-sel = <TEGRA_PIN_DISABLE>;
};
/* Apalis MMC1 */
diff --git a/arch/arm/mach-tegra/board-apalis-tk1-panel.c b/arch/arm/mach-tegra/board-apalis-tk1-panel.c
index 9ee23e7..e499584 100644
--- a/arch/arm/mach-tegra/board-apalis-tk1-panel.c
+++ b/arch/arm/mach-tegra/board-apalis-tk1-panel.c
@@ -378,7 +378,7 @@ static struct tegra_dc_out apalis_tk1_disp2_out = {
.parent_clk = "pll_d",
#endif /* CONFIG_TEGRA_HDMI_PRIMARY */
- .ddc_bus = 1,
+ .ddc_bus = 3,
.hotplug_gpio = apalis_tk1_hdmi_hpd,
.hdmi_out = &apalis_tk1_hdmi_out,
@@ -628,12 +628,14 @@ int __init apalis_tk1_panel_init(void)
struct device_node *dc1_node = NULL;
struct device_node *dc2_node = NULL;
+ struct device_node *hdmi_node = NULL;
#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
struct dma_declare_info vpr_dma_info;
struct dma_declare_info generic_dma_info;
#endif
find_dc_node(&dc1_node, &dc2_node);
+ hdmi_node = of_find_node_by_path("/host1x/hdmi");
#ifndef CONFIG_TEGRA_HDMI_PRIMARY
apalis_tk1_panel_select();
@@ -700,6 +702,20 @@ int __init apalis_tk1_panel_init(void)
return -EINVAL;
}
+ if (hdmi_node) {
+ struct device_node *ddc;
+ int id;
+ ddc = of_parse_phandle(hdmi_node, "nvidia,ddc-i2c-bus", 0);
+ if (ddc) {
+ id = of_alias_get_id(ddc, "i2c");
+ if (id >= 0) {
+ apalis_tk1_disp2_out.ddc_bus = id;
+ } else
+ pr_err("Invalid HDMI ddc in the device-tree\n");
+ } else
+ pr_err("No ddc for HDMI node in the device-tree\n");
+ }
+
if (!of_have_populated_dt() || !dc1_node ||
!of_device_is_available(dc1_node)) {
#ifndef CONFIG_TEGRA_HDMI_PRIMARY