Skip to content

Commit 71f5c63

Browse files
mszyprowkishon
authored andcommitted
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>
1 parent 97a3042 commit 71f5c63

3 files changed

Lines changed: 147 additions & 3 deletions

File tree

‎Documentation/devicetree/bindings/phy/samsung-phy.txt‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,30 @@ Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY
22
-------------------------------------------------
33

44
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"
69
- #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
819

920
For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in
1021
the PHY specifier identifies the PHY and its meaning is as follows:
1122
0 - MIPI CSIS 0,
1223
1 - MIPI DSIM 0,
1324
2 - MIPI CSIS 1,
1425
3 - MIPI DSIM 1.
26+
"samsung,exynos5420-mipi-video-phy" and "samsung,exynos5433-mipi-video-phy"
27+
supports additional fifth PHY:
28+
4 - MIPI CSIS 2.
1529

1630
Samsung EXYNOS SoC series Display Port PHY
1731
-------------------------------------------------

‎drivers/phy/phy-exynos-mipi-video.c‎

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY driver
33
*
4-
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
4+
* Copyright (C) 2013,2016 Samsung Electronics Co., Ltd.
55
* Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
66
*
77
* This program is free software; you can redistribute it and/or modify
@@ -13,6 +13,7 @@
1313
#include <linux/io.h>
1414
#include <linux/kernel.h>
1515
#include <linux/mfd/syscon/exynos4-pmu.h>
16+
#include <linux/mfd/syscon/exynos5-pmu.h>
1617
#include <linux/module.h>
1718
#include <linux/of.h>
1819
#include <linux/of_address.h>
@@ -28,11 +29,15 @@ enum exynos_mipi_phy_id {
2829
EXYNOS_MIPI_PHY_ID_DSIM0,
2930
EXYNOS_MIPI_PHY_ID_CSIS1,
3031
EXYNOS_MIPI_PHY_ID_DSIM1,
32+
EXYNOS_MIPI_PHY_ID_CSIS2,
3133
EXYNOS_MIPI_PHYS_NUM
3234
};
3335

3436
enum exynos_mipi_phy_regmap_id {
3537
EXYNOS_MIPI_REGMAP_PMU,
38+
EXYNOS_MIPI_REGMAP_DISP,
39+
EXYNOS_MIPI_REGMAP_CAM0,
40+
EXYNOS_MIPI_REGMAP_CAM1,
3641
EXYNOS_MIPI_REGMAPS_NUM
3742
};
3843

@@ -96,6 +101,122 @@ static const struct mipi_phy_device_desc s5pv210_mipi_phy = {
96101
},
97102
};
98103

104+
static const struct mipi_phy_device_desc exynos5420_mipi_phy = {
105+
.num_regmaps = 1,
106+
.regmap_names = {"syscon"},
107+
.num_phys = 5,
108+
.phys = {
109+
{
110+
/* EXYNOS_MIPI_PHY_ID_CSIS0 */
111+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM0,
112+
.enable_val = EXYNOS5_PHY_ENABLE,
113+
.enable_reg = EXYNOS5420_MIPI_PHY0_CONTROL,
114+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
115+
.resetn_val = EXYNOS5_MIPI_PHY_S_RESETN,
116+
.resetn_reg = EXYNOS5420_MIPI_PHY0_CONTROL,
117+
.resetn_map = EXYNOS_MIPI_REGMAP_PMU,
118+
}, {
119+
/* EXYNOS_MIPI_PHY_ID_DSIM0 */
120+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS0,
121+
.enable_val = EXYNOS5_PHY_ENABLE,
122+
.enable_reg = EXYNOS5420_MIPI_PHY0_CONTROL,
123+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
124+
.resetn_val = EXYNOS5_MIPI_PHY_M_RESETN,
125+
.resetn_reg = EXYNOS5420_MIPI_PHY0_CONTROL,
126+
.resetn_map = EXYNOS_MIPI_REGMAP_PMU,
127+
}, {
128+
/* EXYNOS_MIPI_PHY_ID_CSIS1 */
129+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM1,
130+
.enable_val = EXYNOS5_PHY_ENABLE,
131+
.enable_reg = EXYNOS5420_MIPI_PHY1_CONTROL,
132+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
133+
.resetn_val = EXYNOS5_MIPI_PHY_S_RESETN,
134+
.resetn_reg = EXYNOS5420_MIPI_PHY1_CONTROL,
135+
.resetn_map = EXYNOS_MIPI_REGMAP_PMU,
136+
}, {
137+
/* EXYNOS_MIPI_PHY_ID_DSIM1 */
138+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS1,
139+
.enable_val = EXYNOS5_PHY_ENABLE,
140+
.enable_reg = EXYNOS5420_MIPI_PHY1_CONTROL,
141+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
142+
.resetn_val = EXYNOS5_MIPI_PHY_M_RESETN,
143+
.resetn_reg = EXYNOS5420_MIPI_PHY1_CONTROL,
144+
.resetn_map = EXYNOS_MIPI_REGMAP_PMU,
145+
}, {
146+
/* EXYNOS_MIPI_PHY_ID_CSIS2 */
147+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE,
148+
.enable_val = EXYNOS5_PHY_ENABLE,
149+
.enable_reg = EXYNOS5420_MIPI_PHY2_CONTROL,
150+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
151+
.resetn_val = EXYNOS5_MIPI_PHY_S_RESETN,
152+
.resetn_reg = EXYNOS5420_MIPI_PHY2_CONTROL,
153+
.resetn_map = EXYNOS_MIPI_REGMAP_PMU,
154+
},
155+
},
156+
};
157+
158+
#define EXYNOS5433_SYSREG_DISP_MIPI_PHY 0x100C
159+
#define EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON 0x1014
160+
#define EXYNOS5433_SYSREG_CAM1_MIPI_DPHY_CON 0x1020
161+
162+
static const struct mipi_phy_device_desc exynos5433_mipi_phy = {
163+
.num_regmaps = 4,
164+
.regmap_names = {
165+
"samsung,pmu-syscon",
166+
"samsung,disp-sysreg",
167+
"samsung,cam0-sysreg",
168+
"samsung,cam1-sysreg"
169+
},
170+
.num_phys = 5,
171+
.phys = {
172+
{
173+
/* EXYNOS_MIPI_PHY_ID_CSIS0 */
174+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_DSIM0,
175+
.enable_val = EXYNOS5_PHY_ENABLE,
176+
.enable_reg = EXYNOS5433_MIPI_PHY0_CONTROL,
177+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
178+
.resetn_val = BIT(0),
179+
.resetn_reg = EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON,
180+
.resetn_map = EXYNOS_MIPI_REGMAP_CAM0,
181+
}, {
182+
/* EXYNOS_MIPI_PHY_ID_DSIM0 */
183+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_CSIS0,
184+
.enable_val = EXYNOS5_PHY_ENABLE,
185+
.enable_reg = EXYNOS5433_MIPI_PHY0_CONTROL,
186+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
187+
.resetn_val = BIT(0),
188+
.resetn_reg = EXYNOS5433_SYSREG_DISP_MIPI_PHY,
189+
.resetn_map = EXYNOS_MIPI_REGMAP_DISP,
190+
}, {
191+
/* EXYNOS_MIPI_PHY_ID_CSIS1 */
192+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE,
193+
.enable_val = EXYNOS5_PHY_ENABLE,
194+
.enable_reg = EXYNOS5433_MIPI_PHY1_CONTROL,
195+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
196+
.resetn_val = BIT(1),
197+
.resetn_reg = EXYNOS5433_SYSREG_CAM0_MIPI_DPHY_CON,
198+
.resetn_map = EXYNOS_MIPI_REGMAP_CAM0,
199+
}, {
200+
/* EXYNOS_MIPI_PHY_ID_DSIM1 */
201+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE,
202+
.enable_val = EXYNOS5_PHY_ENABLE,
203+
.enable_reg = EXYNOS5433_MIPI_PHY1_CONTROL,
204+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
205+
.resetn_val = BIT(1),
206+
.resetn_reg = EXYNOS5433_SYSREG_DISP_MIPI_PHY,
207+
.resetn_map = EXYNOS_MIPI_REGMAP_DISP,
208+
}, {
209+
/* EXYNOS_MIPI_PHY_ID_CSIS2 */
210+
.coupled_phy_id = EXYNOS_MIPI_PHY_ID_NONE,
211+
.enable_val = EXYNOS5_PHY_ENABLE,
212+
.enable_reg = EXYNOS5433_MIPI_PHY2_CONTROL,
213+
.enable_map = EXYNOS_MIPI_REGMAP_PMU,
214+
.resetn_val = BIT(0),
215+
.resetn_reg = EXYNOS5433_SYSREG_CAM1_MIPI_DPHY_CON,
216+
.resetn_map = EXYNOS_MIPI_REGMAP_CAM1,
217+
},
218+
},
219+
};
99220

100221
struct exynos_mipi_video_phy {
101222
struct regmap *regmaps[EXYNOS_MIPI_REGMAPS_NUM];
@@ -241,6 +362,12 @@ static const struct of_device_id exynos_mipi_video_phy_of_match[] = {
241362
{
242363
.compatible = "samsung,s5pv210-mipi-video-phy",
243364
.data = &s5pv210_mipi_phy,
365+
}, {
366+
.compatible = "samsung,exynos5420-mipi-video-phy",
367+
.data = &exynos5420_mipi_phy,
368+
}, {
369+
.compatible = "samsung,exynos5433-mipi-video-phy",
370+
.data = &exynos5433_mipi_phy,
244371
},
245372
{ /* sentinel */ },
246373
};

‎include/linux/mfd/syscon/exynos5-pmu.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838

3939
/* Exynos5433 specific register definitions */
4040
#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)
4144

4245
#define EXYNOS5_PHY_ENABLE BIT(0)
4346

0 commit comments

Comments
 (0)