From c332018112f933300f64a93d8f5344885fdfe26a Mon Sep 17 00:00:00 2001 From: Min-wuk Lee Date: Wed, 2 Jul 2014 18:34:30 +0900 Subject: video: tegra: dc: fix dsi res parse In case ganged mode is not set, dsi resource (start address and size) needs to be determined by dsi instance. - For dsi_instance_0, TEGRA_DSI_BASE - For dsi_instance_1, TEGRA_DSIB_BASE This change fix index for this case, so it can parse proper resources from device tree reg property. Bug 1371533 Change-Id: I79555512277d0558bc5f03ea6a2452b3ef810fe7 Signed-off-by: Min-wuk Lee Reviewed-on: http://git-master/r/433573 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo --- drivers/video/tegra/dc/dsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/video/tegra/dc/dsi.c') diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index d238d1aa3..227ea51e5 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c @@ -4329,8 +4329,9 @@ static int _tegra_dc_dsi_init(struct tegra_dc *dc) struct clk *dsi_clk; struct clk *dsi_fixed_clk = NULL; struct clk *dsi_lp_clk = NULL; - struct tegra_dsi_out *dsi_pdata; + struct tegra_dsi_out *dsi_pdata = NULL; int err = 0, i; + int dsi_instance; char *ganged_reg_name[2] = {"ganged_dsia_regs", "ganged_dsib_regs"}; char *dsi_clk_name[2] = {"dsia", "dsib"}; char *dsi_lp_clk_name[2] = {"dsialp", "dsiblp"}; @@ -4348,10 +4349,16 @@ static int _tegra_dc_dsi_init(struct tegra_dc *dc) } dsi->max_instances = dc->out->dsi->ganged_type ? MAX_DSI_INSTANCE : 1; + dsi_instance = (int)dc->out->dsi->dsi_instance; for (i = 0; i < dsi->max_instances; i++) { if (np) { if (np_dsi && of_device_is_available(np_dsi)) { - of_address_to_resource(np_dsi, i, &dsi_res); + if (!dc->out->dsi->ganged_type) + of_address_to_resource(np_dsi, + dsi_instance, &dsi_res); + else /* ganged type */ + of_address_to_resource(np_dsi, + i, &dsi_res); res = &dsi_res; } else { err = -EINVAL; -- cgit v1.2.2