diff options
author | Archit Taneja <architt@codeaurora.org> | 2015-10-14 15:31:13 +0530 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2015-12-14 10:40:50 -0500 |
commit | 0c7df47f6a4c5d7c6c4fa1f5ecbee64c441f5939 (patch) | |
tree | 747a91a563affd7c1c005be197a798db4579265e /drivers/gpu/drm/msm/dsi | |
parent | 4ff9d4cbc15a1ac169eaabf2e3d282b7d2d3799d (diff) | |
download | linux-0c7df47f6a4c5d7c6c4fa1f5ecbee64c441f5939.tar.gz linux-0c7df47f6a4c5d7c6c4fa1f5ecbee64c441f5939.tar.bz2 linux-0c7df47f6a4c5d7c6c4fa1f5ecbee64c441f5939.zip |
drm/msm/dsi: Enable MMSS SPFB port via syscon
For DSIv2 to work, we need to enable MMSS_AHB_ARB_MASTER_PORT in
MMSS_SFPB. We enable the required bitfield by retrieving MMSS_SFPB
regmap pointer via syscon.
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/dsi')
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi_host.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index bbf7f72058d7..f61b88e91a8b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -24,10 +24,13 @@ #include <linux/of_graph.h> #include <linux/regulator/consumer.h> #include <linux/spinlock.h> +#include <linux/mfd/syscon.h> +#include <linux/regmap.h> #include <video/mipi_display.h> #include "dsi.h" #include "dsi.xml.h" +#include "sfpb.xml.h" #include "dsi_cfg.h" static int dsi_get_version(const void __iomem *base, u32 *major, u32 *minor) @@ -149,6 +152,8 @@ struct msm_dsi_host { u8 *rx_buf; + struct regmap *sfpb; + struct drm_display_mode *mode; /* connected device info */ @@ -1568,6 +1573,16 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) msm_host->device_node = device_node; + if (of_property_read_bool(np, "syscon-sfpb")) { + msm_host->sfpb = syscon_regmap_lookup_by_phandle(np, + "syscon-sfpb"); + if (IS_ERR(msm_host->sfpb)) { + dev_err(dev, "%s: failed to get sfpb regmap\n", + __func__); + return PTR_ERR(msm_host->sfpb); + } + } + return 0; } @@ -2031,6 +2046,20 @@ int msm_dsi_host_disable(struct mipi_dsi_host *host) return 0; } +static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable) +{ + enum sfpb_ahb_arb_master_port_en en; + + if (!msm_host->sfpb) + return; + + en = enable ? SFPB_MASTER_PORT_ENABLE : SFPB_MASTER_PORT_DISABLE; + + regmap_update_bits(msm_host->sfpb, REG_SFPB_GPREG, + SFPB_GPREG_MASTER_PORT_EN__MASK, + SFPB_GPREG_MASTER_PORT_EN(en)); +} + int msm_dsi_host_power_on(struct mipi_dsi_host *host) { struct msm_dsi_host *msm_host = to_msm_dsi_host(host); @@ -2043,6 +2072,8 @@ int msm_dsi_host_power_on(struct mipi_dsi_host *host) goto unlock_ret; } + msm_dsi_sfpb_config(msm_host, true); + ret = dsi_calc_clk_rate(msm_host); if (ret) { pr_err("%s: unable to calc clk rate, %d\n", __func__, ret); @@ -2130,6 +2161,8 @@ int msm_dsi_host_power_off(struct mipi_dsi_host *host) dsi_host_regulator_disable(msm_host); + msm_dsi_sfpb_config(msm_host, false); + DBG("-"); msm_host->power_on = false; |