Lines Matching +full:s5pv210 +full:- +full:mipi +full:- +full:video +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Samsung S5P/Exynos SoC series MIPI CSIS/DSIM DPHY driver
14 #include <linux/phy/phy.h>
18 #include <linux/soc/samsung/exynos-regs-pmu.h>
22 EXYNOS_MIPI_PHY_ID_NONE = -1,
160 "samsung,pmu-syscon",
161 "samsung,disp-sysreg",
162 "samsung,cam0-sysreg",
163 "samsung,cam1-sysreg"
220 struct phy *phy; member
230 struct regmap *enable_map = state->regmaps[data->enable_map]; in __set_phy_state()
231 struct regmap *resetn_map = state->regmaps[data->resetn_map]; in __set_phy_state()
233 spin_lock(&state->slock); in __set_phy_state()
236 if (!on && data->coupled_phy_id >= 0 && in __set_phy_state()
237 state->phys[data->coupled_phy_id].phy->power_count == 0) in __set_phy_state()
238 regmap_update_bits(enable_map, data->enable_reg, in __set_phy_state()
239 data->enable_val, 0); in __set_phy_state()
240 /* PHY reset */ in __set_phy_state()
242 regmap_update_bits(resetn_map, data->resetn_reg, in __set_phy_state()
243 data->resetn_val, data->resetn_val); in __set_phy_state()
245 regmap_update_bits(resetn_map, data->resetn_reg, in __set_phy_state()
246 data->resetn_val, 0); in __set_phy_state()
249 regmap_update_bits(enable_map, data->enable_reg, in __set_phy_state()
250 data->enable_val, data->enable_val); in __set_phy_state()
252 spin_unlock(&state->slock); in __set_phy_state()
258 container_of((desc), struct exynos_mipi_video_phy, phys[(desc)->index])
260 static int exynos_mipi_video_phy_power_on(struct phy *phy) in exynos_mipi_video_phy_power_on() argument
262 struct video_phy_desc *phy_desc = phy_get_drvdata(phy); in exynos_mipi_video_phy_power_on()
265 return __set_phy_state(phy_desc->data, state, 1); in exynos_mipi_video_phy_power_on()
268 static int exynos_mipi_video_phy_power_off(struct phy *phy) in exynos_mipi_video_phy_power_off() argument
270 struct video_phy_desc *phy_desc = phy_get_drvdata(phy); in exynos_mipi_video_phy_power_off()
273 return __set_phy_state(phy_desc->data, state, 0); in exynos_mipi_video_phy_power_off()
276 static struct phy *exynos_mipi_video_phy_xlate(struct device *dev, in exynos_mipi_video_phy_xlate()
281 if (WARN_ON(args->args[0] >= state->num_phys)) in exynos_mipi_video_phy_xlate()
282 return ERR_PTR(-ENODEV); in exynos_mipi_video_phy_xlate()
284 return state->phys[args->args[0]].phy; in exynos_mipi_video_phy_xlate()
297 struct device *dev = &pdev->dev; in exynos_mipi_video_phy_probe()
298 struct device_node *np = dev->of_node; in exynos_mipi_video_phy_probe()
304 return -ENODEV; in exynos_mipi_video_phy_probe()
308 return -ENOMEM; in exynos_mipi_video_phy_probe()
310 state->regmaps[i] = syscon_node_to_regmap(dev->parent->of_node); in exynos_mipi_video_phy_probe()
311 if (!IS_ERR(state->regmaps[i])) in exynos_mipi_video_phy_probe()
313 for (; i < phy_dev->num_regmaps; i++) { in exynos_mipi_video_phy_probe()
314 state->regmaps[i] = syscon_regmap_lookup_by_phandle(np, in exynos_mipi_video_phy_probe()
315 phy_dev->regmap_names[i]); in exynos_mipi_video_phy_probe()
316 if (IS_ERR(state->regmaps[i])) in exynos_mipi_video_phy_probe()
317 return PTR_ERR(state->regmaps[i]); in exynos_mipi_video_phy_probe()
319 state->num_phys = phy_dev->num_phys; in exynos_mipi_video_phy_probe()
320 spin_lock_init(&state->slock); in exynos_mipi_video_phy_probe()
324 for (i = 0; i < state->num_phys; i++) { in exynos_mipi_video_phy_probe()
325 struct phy *phy = devm_phy_create(dev, NULL, in exynos_mipi_video_phy_probe() local
327 if (IS_ERR(phy)) { in exynos_mipi_video_phy_probe()
328 dev_err(dev, "failed to create PHY %d\n", i); in exynos_mipi_video_phy_probe()
329 return PTR_ERR(phy); in exynos_mipi_video_phy_probe()
332 state->phys[i].phy = phy; in exynos_mipi_video_phy_probe()
333 state->phys[i].index = i; in exynos_mipi_video_phy_probe()
334 state->phys[i].data = &phy_dev->phys[i]; in exynos_mipi_video_phy_probe()
335 phy_set_drvdata(phy, &state->phys[i]); in exynos_mipi_video_phy_probe()
346 .compatible = "samsung,s5pv210-mipi-video-phy",
349 .compatible = "samsung,exynos5420-mipi-video-phy",
352 .compatible = "samsung,exynos5433-mipi-video-phy",
363 .name = "exynos-mipi-video-phy",
369 MODULE_DESCRIPTION("Samsung S5P/Exynos SoC MIPI CSI-2/DSI PHY driver");