diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-08-10 02:33:07 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-08-16 05:52:40 -0400 |
| commit | eeb45f85cd25b9bbb91e966b5f8faca6589d2752 (patch) | |
| tree | 1d1a6340f5cc52e7e9ab21051d1101b2ce3417eb /drivers/gpu/drm/omapdrm | |
| parent | 5cdc8dbbdae163b08baa60a1c9408c4ea3af8643 (diff) | |
drm/omap: add OMAP5 DSIPHY lane-enable support
We are missing OMAP5 DSIPHY lane-enable support, which has prevented
OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
to the recently added OMAP4 version.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
| -rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dsi.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 1855d69b211d..b56a05730314 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c | |||
| @@ -2108,9 +2108,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) | |||
| 2108 | u32 enable_mask, enable_shift; | 2108 | u32 enable_mask, enable_shift; |
| 2109 | u32 pipd_mask, pipd_shift; | 2109 | u32 pipd_mask, pipd_shift; |
| 2110 | 2110 | ||
| 2111 | if (!dsi->syscon) | ||
| 2112 | return 0; | ||
| 2113 | |||
| 2114 | if (dsi->module_id == 0) { | 2111 | if (dsi->module_id == 0) { |
| 2115 | enable_mask = OMAP4_DSI1_LANEENABLE_MASK; | 2112 | enable_mask = OMAP4_DSI1_LANEENABLE_MASK; |
| 2116 | enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT; | 2113 | enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT; |
| @@ -2130,14 +2127,45 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) | |||
| 2130 | (lanes << enable_shift) | (lanes << pipd_shift)); | 2127 | (lanes << enable_shift) | (lanes << pipd_shift)); |
| 2131 | } | 2128 | } |
| 2132 | 2129 | ||
| 2130 | /* OMAP5 CONTROL_DSIPHY */ | ||
| 2131 | |||
| 2132 | #define OMAP5_DSIPHY_SYSCON_OFFSET 0x74 | ||
| 2133 | |||
| 2134 | #define OMAP5_DSI1_LANEENABLE_SHIFT 24 | ||
| 2135 | #define OMAP5_DSI2_LANEENABLE_SHIFT 19 | ||
| 2136 | #define OMAP5_DSI_LANEENABLE_MASK 0x1f | ||
| 2137 | |||
| 2138 | static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes) | ||
| 2139 | { | ||
| 2140 | u32 enable_shift; | ||
| 2141 | |||
| 2142 | if (dsi->module_id == 0) | ||
| 2143 | enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT; | ||
| 2144 | else if (dsi->module_id == 1) | ||
| 2145 | enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT; | ||
| 2146 | else | ||
| 2147 | return -ENODEV; | ||
| 2148 | |||
| 2149 | return regmap_update_bits(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, | ||
| 2150 | OMAP5_DSI_LANEENABLE_MASK << enable_shift, | ||
| 2151 | lanes << enable_shift); | ||
| 2152 | } | ||
| 2153 | |||
| 2133 | static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask) | 2154 | static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask) |
| 2134 | { | 2155 | { |
| 2135 | return dsi_omap4_mux_pads(dsi, lane_mask); | 2156 | if (dsi->data->model == DSI_MODEL_OMAP4) |
| 2157 | return dsi_omap4_mux_pads(dsi, lane_mask); | ||
| 2158 | if (dsi->data->model == DSI_MODEL_OMAP5) | ||
| 2159 | return dsi_omap5_mux_pads(dsi, lane_mask); | ||
| 2160 | return 0; | ||
| 2136 | } | 2161 | } |
| 2137 | 2162 | ||
| 2138 | static void dsi_disable_pads(struct dsi_data *dsi) | 2163 | static void dsi_disable_pads(struct dsi_data *dsi) |
| 2139 | { | 2164 | { |
| 2140 | dsi_omap4_mux_pads(dsi, 0); | 2165 | if (dsi->data->model == DSI_MODEL_OMAP4) |
| 2166 | dsi_omap4_mux_pads(dsi, 0); | ||
| 2167 | else if (dsi->data->model == DSI_MODEL_OMAP5) | ||
| 2168 | dsi_omap5_mux_pads(dsi, 0); | ||
| 2141 | } | 2169 | } |
| 2142 | 2170 | ||
| 2143 | static int dsi_cio_init(struct platform_device *dsidev) | 2171 | static int dsi_cio_init(struct platform_device *dsidev) |
| @@ -5471,14 +5499,17 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) | |||
| 5471 | 5499 | ||
| 5472 | dsi->module_id = d->id; | 5500 | dsi->module_id = d->id; |
| 5473 | 5501 | ||
| 5474 | if (dsi->data->model == DSI_MODEL_OMAP4) { | 5502 | if (dsi->data->model == DSI_MODEL_OMAP4 || |
| 5503 | dsi->data->model == DSI_MODEL_OMAP5) { | ||
| 5475 | struct device_node *np; | 5504 | struct device_node *np; |
| 5476 | 5505 | ||
| 5477 | /* | 5506 | /* |
| 5478 | * The OMAP4 display DT bindings don't reference the padconf | 5507 | * The OMAP4/5 display DT bindings don't reference the padconf |
| 5479 | * syscon. Our only option to retrieve it is to find it by name. | 5508 | * syscon. Our only option to retrieve it is to find it by name. |
| 5480 | */ | 5509 | */ |
| 5481 | np = of_find_node_by_name(NULL, "omap4_padconf_global"); | 5510 | np = of_find_node_by_name(NULL, |
| 5511 | dsi->data->model == DSI_MODEL_OMAP4 ? | ||
| 5512 | "omap4_padconf_global" : "omap5_padconf_global"); | ||
| 5482 | if (!np) | 5513 | if (!np) |
| 5483 | return -ENODEV; | 5514 | return -ENODEV; |
| 5484 | 5515 | ||
