diff options
author | Robby Cai <robby.cai@nxp.com> | 2018-09-11 15:01:10 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2018-10-29 11:10:38 +0800 |
commit | eacc8aeb8dafff2dc92786ef85503e3fb9e5d69b (patch) | |
tree | 9a86311a1e33b32bff60cd392bbfede7291a7d41 /drivers/media/platform | |
parent | 02dfb90df87bab15d74777f40b76d14807bd757f (diff) |
MLK-19537-2 media: mipi_csi: use PHY slave reset for MIPI CSI
Remove PHY master reset and only need to use PHY slave reset for MIPI CSI.
Use regmap framework for cleanup.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6968f84ad8ee1613ff90d90e19e7434d5dd95126)
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/mxc/capture/mxc_mipi_csi.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/platform/mxc/capture/mxc_mipi_csi.c b/drivers/media/platform/mxc/capture/mxc_mipi_csi.c index b4b15e5cf453..a7964b7b8345 100644 --- a/drivers/media/platform/mxc/capture/mxc_mipi_csi.c +++ b/drivers/media/platform/mxc/capture/mxc_mipi_csi.c @@ -190,7 +190,8 @@ MODULE_PARM_DESC(debug, "Debug level (0-2)"); #define MIPI_CSIS_PKTDATA_EVEN 0x3000 #define MIPI_CSIS_PKTDATA_SIZE SZ_4K -#define MIPI_CSIS_MISC 0x8008 +#define GPR_MIPI_RESET 0x08 +#define GPR_MIPI_S_RESETN BIT(16) #define DEFAULT_SCLK_CSIS_FREQ 166000000UL @@ -392,18 +393,20 @@ static int mipi_csis_phy_init(struct csi_state *state) static int mipi_csis_phy_reset_mx8mm(struct csi_state *state) { - struct device_node *np; - void __iomem *reg; - - np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-csi"); - if (WARN_ON(!np)) - return -ENXIO; + struct device_node *np = state->dev->of_node; + struct regmap *gpr; - reg = of_iomap(np, 0); + gpr = syscon_regmap_lookup_by_phandle(np, "csi-gpr"); + if (IS_ERR(gpr)) + return PTR_ERR(gpr); - writel(0, reg + MIPI_CSIS_MISC); + regmap_update_bits(gpr, GPR_MIPI_RESET, + GPR_MIPI_S_RESETN, + 0x0); usleep_range(10, 20); - writel(0x30000, reg + MIPI_CSIS_MISC); + regmap_update_bits(gpr, GPR_MIPI_RESET, + GPR_MIPI_S_RESETN, + GPR_MIPI_S_RESETN); usleep_range(10, 20); return 0; |