Lines Matching +full:exynos5433 +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
16 #include <linux/phy/phy.h>
19 #include <linux/soc/samsung/exynos-regs-pmu.h>
23 EXYNOS_MIPI_PHY_ID_NONE = -1,
161 "samsung,pmu-syscon",
162 "samsung,disp-sysreg",
163 "samsung,cam0-sysreg",
164 "samsung,cam1-sysreg"
221 struct phy *phy; member
231 struct regmap *enable_map = state->regmaps[data->enable_map]; in __set_phy_state()
232 struct regmap *resetn_map = state->regmaps[data->resetn_map]; in __set_phy_state()
234 spin_lock(&state->slock); in __set_phy_state()
237 if (!on && data->coupled_phy_id >= 0 && in __set_phy_state()
238 state->phys[data->coupled_phy_id].phy->power_count == 0) in __set_phy_state()
239 regmap_update_bits(enable_map, data->enable_reg, in __set_phy_state()
240 data->enable_val, 0); in __set_phy_state()
241 /* PHY reset */ in __set_phy_state()
243 regmap_update_bits(resetn_map, data->resetn_reg, in __set_phy_state()
244 data->resetn_val, data->resetn_val); in __set_phy_state()
246 regmap_update_bits(resetn_map, data->resetn_reg, in __set_phy_state()
247 data->resetn_val, 0); in __set_phy_state()
250 regmap_update_bits(enable_map, data->enable_reg, in __set_phy_state()
251 data->enable_val, data->enable_val); in __set_phy_state()
253 spin_unlock(&state->slock); in __set_phy_state()
259 container_of((desc), struct exynos_mipi_video_phy, phys[(desc)->index])
261 static int exynos_mipi_video_phy_power_on(struct phy *phy) in exynos_mipi_video_phy_power_on() argument
263 struct video_phy_desc *phy_desc = phy_get_drvdata(phy); in exynos_mipi_video_phy_power_on()
266 return __set_phy_state(phy_desc->data, state, 1); in exynos_mipi_video_phy_power_on()
269 static int exynos_mipi_video_phy_power_off(struct phy *phy) in exynos_mipi_video_phy_power_off() argument
271 struct video_phy_desc *phy_desc = phy_get_drvdata(phy); in exynos_mipi_video_phy_power_off()
274 return __set_phy_state(phy_desc->data, state, 0); in exynos_mipi_video_phy_power_off()
277 static struct phy *exynos_mipi_video_phy_xlate(struct device *dev, in exynos_mipi_video_phy_xlate()
282 if (WARN_ON(args->args[0] >= state->num_phys)) in exynos_mipi_video_phy_xlate()
283 return ERR_PTR(-ENODEV); in exynos_mipi_video_phy_xlate()
285 return state->phys[args->args[0]].phy; in exynos_mipi_video_phy_xlate()
298 struct device *dev = &pdev->dev; in exynos_mipi_video_phy_probe()
299 struct device_node *np = dev->of_node; in exynos_mipi_video_phy_probe()
305 return -ENODEV; in exynos_mipi_video_phy_probe()
309 return -ENOMEM; in exynos_mipi_video_phy_probe()
311 for (i = 0; i < phy_dev->num_regmaps; i++) { in exynos_mipi_video_phy_probe()
312 state->regmaps[i] = syscon_regmap_lookup_by_phandle(np, in exynos_mipi_video_phy_probe()
313 phy_dev->regmap_names[i]); in exynos_mipi_video_phy_probe()
314 if (IS_ERR(state->regmaps[i])) in exynos_mipi_video_phy_probe()
315 return PTR_ERR(state->regmaps[i]); in exynos_mipi_video_phy_probe()
317 state->num_phys = phy_dev->num_phys; in exynos_mipi_video_phy_probe()
318 spin_lock_init(&state->slock); in exynos_mipi_video_phy_probe()
322 for (i = 0; i < state->num_phys; i++) { in exynos_mipi_video_phy_probe()
323 struct phy *phy = devm_phy_create(dev, NULL, in exynos_mipi_video_phy_probe() local
325 if (IS_ERR(phy)) { in exynos_mipi_video_phy_probe()
326 dev_err(dev, "failed to create PHY %d\n", i); in exynos_mipi_video_phy_probe()
327 return PTR_ERR(phy); in exynos_mipi_video_phy_probe()
330 state->phys[i].phy = phy; in exynos_mipi_video_phy_probe()
331 state->phys[i].index = i; in exynos_mipi_video_phy_probe()
332 state->phys[i].data = &phy_dev->phys[i]; in exynos_mipi_video_phy_probe()
333 phy_set_drvdata(phy, &state->phys[i]); in exynos_mipi_video_phy_probe()
344 .compatible = "samsung,s5pv210-mipi-video-phy",
347 .compatible = "samsung,exynos5420-mipi-video-phy",
350 .compatible = "samsung,exynos5433-mipi-video-phy",
361 .name = "exynos-mipi-video-phy",
367 MODULE_DESCRIPTION("Samsung S5P/Exynos SoC MIPI CSI-2/DSI PHY driver");