Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: exynos-mipi-video: Add support for Exynos 5420 and 5433 SoCs

This patch adds support for MIPI DPHYs found in Exynos5420-compatible
(5420, 5422 and 5800) and Exynos5433 SoCs. Those SoCs differs from
earlier by different offset of MIPI DPHY registers in PMU controllers
(Exynos 5420-compatible case) or by moving MIPI DPHY reset registers to
separate system register controllers (Exynos 5433 case). In both case
also additional 5th PHY (MIPI CSIS 2) has been added.

Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Marek Szyprowski and committed by
Kishon Vijay Abraham I
71f5c63c 97a3042f

+147 -3
+16 -2
Documentation/devicetree/bindings/phy/samsung-phy.txt
··· 2 2 ------------------------------------------------- 3 3 4 4 Required properties: 5 - - compatible : should be "samsung,s5pv210-mipi-video-phy"; 5 + - compatible : should be one of the listed compatibles: 6 + - "samsung,s5pv210-mipi-video-phy" 7 + - "samsung,exynos5420-mipi-video-phy" 8 + - "samsung,exynos5433-mipi-video-phy" 6 9 - #phy-cells : from the generic phy bindings, must be 1; 7 - - syscon - phandle to the PMU system controller; 10 + 11 + In case of s5pv210 and exynos5420 compatible PHYs: 12 + - syscon - phandle to the PMU system controller 13 + 14 + In case of exynos5433 compatible PHY: 15 + - samsung,pmu-syscon - phandle to the PMU system controller 16 + - samsung,disp-sysreg - phandle to the DISP system registers controller 17 + - samsung,cam0-sysreg - phandle to the CAM0 system registers controller 18 + - samsung,cam1-sysreg - phandle to the CAM1 system registers controller 8 19 9 20 For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in 10 21 the PHY specifier identifies the PHY and its meaning is as follows: ··· 23 12 1 - MIPI DSIM 0, 24 13 2 - MIPI CSIS 1, 25 14 3 - MIPI DSIM 1. 15 + "samsung,exynos5420-mipi-video-phy" and "samsung,exynos5433-mipi-video-phy" 16 + supports additional fifth PHY: 17 + 4 - MIPI CSIS 2. 26 18 27 19 Samsung EXYNOS SoC series Display Port PHY 28 20 -------------------------------------------------
+128 -1
drivers/phy/phy-exynos-mipi-video.c
··· 1 1 /* 2 2 * Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY driver 3 3 * 4 - * Copyright (C) 2013 Samsung Electronics Co., Ltd. 4 + * Copyright (C) 2013,2016 Samsung Electronics Co., Ltd. 5 5 * Author: Sylwester Nawrocki <s.nawrocki@samsung.com> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify ··· 13 13 #include <linux/io.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/mfd/syscon/exynos4-pmu.h> 16 + #include <linux/mfd/syscon/exynos5-pmu.h> 16 17 #include <linux/module.h> 17 18 #include <linux/of.h> 18 19 #include <linux/of_address.h> ··· 29 28 EXYNOS_MIPI_PHY_ID_DSIM0, 30 29 EXYNOS_MIPI_PHY_ID_CSIS1, 31 30 EXYNOS_MIPI_PHY_ID_DSIM1, 31 + EXYNOS_MIPI_PHY_ID_CSIS2, 32 32 EXYNOS_MIPI_PHYS_NUM 33 33 }; 34 34 35 35 enum exynos_mipi_phy_regmap_id { 36 36 EXYNOS_MIPI_REGMAP_PMU, 37 + EXYNOS_MIPI_REGMAP_DISP, 38 + EXYNOS_MIPI_REGMAP_CAM0, 39 + EXYNOS_MIPI_REGMAP_CAM1, 37 40 EXYNOS_MIPI_REGMAPS_NUM 38 41 }; 39 42 ··· 101 96 }, 102 97 }; 103 98 99 + static const struct mipi_phy_device_desc exynos5420_mipi_phy = { 100 + .num_regmaps = 1, 101 + .regmap_names = {"syscon"}, 102 + .num_phys = 5, 103 + .phys = { 104 + { 105 + /* EXYNOS_MIPI_PHY_ID_CSIS0 */ 106 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM0, 107 + .enable_val = EXYNOS5_PHY_ENABLE, 108 + .enable_reg = EXYNOS5420_MIPI_PHY0_CONTROL, 109 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 110 + .resetn_val = EXYNOS5_MIPI_PHY_S_RESETN, 111 + .resetn_reg = EXYNOS5420_MIPI_PHY0_CONTROL, 112 + .resetn_map = EXYNOS_MIPI_REGMAP_PMU, 113 + }, { 114 + /* EXYNOS_MIPI_PHY_ID_DSIM0 */ 115 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS0, 116 + .enable_val = EXYNOS5_PHY_ENABLE, 117 + .enable_reg = EXYNOS5420_MIPI_PHY0_CONTROL, 118 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 119 + .resetn_val = EXYNOS5_MIPI_PHY_M_RESETN, 120 + .resetn_reg = EXYNOS5420_MIPI_PHY0_CONTROL, 121 + .resetn_map = EXYNOS_MIPI_REGMAP_PMU, 122 + }, { 123 + /* EXYNOS_MIPI_PHY_ID_CSIS1 */ 124 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM1, 125 + .enable_val = EXYNOS5_PHY_ENABLE, 126 + .enable_reg = EXYNOS5420_MIPI_PHY1_CONTROL, 127 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 128 + .resetn_val = EXYNOS5_MIPI_PHY_S_RESETN, 129 + .resetn_reg = EXYNOS5420_MIPI_PHY1_CONTROL, 130 + .resetn_map = EXYNOS_MIPI_REGMAP_PMU, 131 + }, { 132 + /* EXYNOS_MIPI_PHY_ID_DSIM1 */ 133 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS1, 134 + .enable_val = EXYNOS5_PHY_ENABLE, 135 + .enable_reg = EXYNOS5420_MIPI_PHY1_CONTROL, 136 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 137 + .resetn_val = EXYNOS5_MIPI_PHY_M_RESETN, 138 + .resetn_reg = EXYNOS5420_MIPI_PHY1_CONTROL, 139 + .resetn_map = EXYNOS_MIPI_REGMAP_PMU, 140 + }, { 141 + /* EXYNOS_MIPI_PHY_ID_CSIS2 */ 142 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE, 143 + .enable_val = EXYNOS5_PHY_ENABLE, 144 + .enable_reg = EXYNOS5420_MIPI_PHY2_CONTROL, 145 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 146 + .resetn_val = EXYNOS5_MIPI_PHY_S_RESETN, 147 + .resetn_reg = EXYNOS5420_MIPI_PHY2_CONTROL, 148 + .resetn_map = EXYNOS_MIPI_REGMAP_PMU, 149 + }, 150 + }, 151 + }; 152 + 153 + #define EXYNOS5433_SYSREG_DISP_MIPI_PHY 0x100C 154 + #define EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON 0x1014 155 + #define EXYNOS5433_SYSREG_CAM1_MIPI_DPHY_CON 0x1020 156 + 157 + static const struct mipi_phy_device_desc exynos5433_mipi_phy = { 158 + .num_regmaps = 4, 159 + .regmap_names = { 160 + "samsung,pmu-syscon", 161 + "samsung,disp-sysreg", 162 + "samsung,cam0-sysreg", 163 + "samsung,cam1-sysreg" 164 + }, 165 + .num_phys = 5, 166 + .phys = { 167 + { 168 + /* EXYNOS_MIPI_PHY_ID_CSIS0 */ 169 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM0, 170 + .enable_val = EXYNOS5_PHY_ENABLE, 171 + .enable_reg = EXYNOS5433_MIPI_PHY0_CONTROL, 172 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 173 + .resetn_val = BIT(0), 174 + .resetn_reg = EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON, 175 + .resetn_map = EXYNOS_MIPI_REGMAP_CAM0, 176 + }, { 177 + /* EXYNOS_MIPI_PHY_ID_DSIM0 */ 178 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS0, 179 + .enable_val = EXYNOS5_PHY_ENABLE, 180 + .enable_reg = EXYNOS5433_MIPI_PHY0_CONTROL, 181 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 182 + .resetn_val = BIT(0), 183 + .resetn_reg = EXYNOS5433_SYSREG_DISP_MIPI_PHY, 184 + .resetn_map = EXYNOS_MIPI_REGMAP_DISP, 185 + }, { 186 + /* EXYNOS_MIPI_PHY_ID_CSIS1 */ 187 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE, 188 + .enable_val = EXYNOS5_PHY_ENABLE, 189 + .enable_reg = EXYNOS5433_MIPI_PHY1_CONTROL, 190 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 191 + .resetn_val = BIT(1), 192 + .resetn_reg = EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON, 193 + .resetn_map = EXYNOS_MIPI_REGMAP_CAM0, 194 + }, { 195 + /* EXYNOS_MIPI_PHY_ID_DSIM1 */ 196 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE, 197 + .enable_val = EXYNOS5_PHY_ENABLE, 198 + .enable_reg = EXYNOS5433_MIPI_PHY1_CONTROL, 199 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 200 + .resetn_val = BIT(1), 201 + .resetn_reg = EXYNOS5433_SYSREG_DISP_MIPI_PHY, 202 + .resetn_map = EXYNOS_MIPI_REGMAP_DISP, 203 + }, { 204 + /* EXYNOS_MIPI_PHY_ID_CSIS2 */ 205 + .coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE, 206 + .enable_val = EXYNOS5_PHY_ENABLE, 207 + .enable_reg = EXYNOS5433_MIPI_PHY2_CONTROL, 208 + .enable_map = EXYNOS_MIPI_REGMAP_PMU, 209 + .resetn_val = BIT(0), 210 + .resetn_reg = EXYNOS5433_SYSREG_CAM1_MIPI_DPHY_CON, 211 + .resetn_map = EXYNOS_MIPI_REGMAP_CAM1, 212 + }, 213 + }, 214 + }; 104 215 105 216 struct exynos_mipi_video_phy { 106 217 struct regmap *regmaps[EXYNOS_MIPI_REGMAPS_NUM]; ··· 362 241 { 363 242 .compatible = "samsung,s5pv210-mipi-video-phy", 364 243 .data = &s5pv210_mipi_phy, 244 + }, { 245 + .compatible = "samsung,exynos5420-mipi-video-phy", 246 + .data = &exynos5420_mipi_phy, 247 + }, { 248 + .compatible = "samsung,exynos5433-mipi-video-phy", 249 + .data = &exynos5433_mipi_phy, 365 250 }, 366 251 { /* sentinel */ }, 367 252 };
+3
include/linux/mfd/syscon/exynos5-pmu.h
··· 38 38 39 39 /* Exynos5433 specific register definitions */ 40 40 #define EXYNOS5433_USBHOST30_PHY_CONTROL (0x728) 41 + #define EXYNOS5433_MIPI_PHY0_CONTROL (0x710) 42 + #define EXYNOS5433_MIPI_PHY1_CONTROL (0x714) 43 + #define EXYNOS5433_MIPI_PHY2_CONTROL (0x718) 41 44 42 45 #define EXYNOS5_PHY_ENABLE BIT(0) 43 46