diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-10-03 14:58:33 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-10-05 01:10:42 +0200 |
commit | 4162e8426c79448239da03cd2ab8b951d2b49e32 (patch) | |
tree | 4f444b79c29949627d8fc84b44c7ab06dad0f916 /arch/arm/mach-tegra/board-apalis-tk1-panel.c | |
parent | 9382b7e30394dd909ef0cbb610ccf06ef1863640 (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>
Diffstat (limited to 'arch/arm/mach-tegra/board-apalis-tk1-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-apalis-tk1-panel.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-apalis-tk1-panel.c b/arch/arm/mach-tegra/board-apalis-tk1-panel.c index 9ee23e710f2f..e4995841b8e4 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 |