Lines Matching +full:disp +full:- +full:syscon

1 // SPDX-License-Identifier: GPL-2.0-only
11 #include <linux/mfd/syscon.h>
114 ret = regmap_read(mic->sysreg, DSD_CFG_MUX, &val); in mic_set_path()
116 DRM_DEV_ERROR(mic->dev, in mic_set_path()
122 if (mic->i80_mode) in mic_set_path()
131 ret = regmap_write(mic->sysreg, DSD_CFG_MUX, val); in mic_set_path()
133 DRM_DEV_ERROR(mic->dev, in mic_set_path()
142 writel(MIC_SW_RST, mic->reg + MIC_OP); in mic_sw_reset()
144 while (retry-- > 0) { in mic_sw_reset()
145 ret = readl(mic->reg + MIC_OP); in mic_sw_reset()
152 return -ETIMEDOUT; in mic_sw_reset()
157 struct videomode vm = mic->vm; in mic_set_porch_timing()
163 writel(reg, mic->reg + MIC_V_TIMING_0); in mic_set_porch_timing()
167 writel(reg, mic->reg + MIC_V_TIMING_1); in mic_set_porch_timing()
172 writel(reg, mic->reg + MIC_INPUT_TIMING_0); in mic_set_porch_timing()
176 writel(reg, mic->reg + MIC_INPUT_TIMING_1); in mic_set_porch_timing()
181 struct videomode *vm = &mic->vm; in mic_set_img_size()
184 reg = MIC_IMG_H_SIZE(vm->hactive) + in mic_set_img_size()
185 MIC_IMG_V_SIZE(vm->vactive); in mic_set_img_size()
187 writel(reg, mic->reg + MIC_IMG_SIZE); in mic_set_img_size()
192 struct videomode vm = mic->vm; in mic_set_output_timing()
195 DRM_DEV_DEBUG(mic->dev, "w: %u, h: %u\n", vm.hactive, vm.vactive); in mic_set_output_timing()
198 writel(reg, mic->reg + MIC_2D_OUTPUT_TIMING_2); in mic_set_output_timing()
200 if (!mic->i80_mode) { in mic_set_output_timing()
204 writel(reg, mic->reg + MIC_2D_OUTPUT_TIMING_0); in mic_set_output_timing()
208 writel(reg, mic->reg + MIC_2D_OUTPUT_TIMING_1); in mic_set_output_timing()
214 u32 reg = readl(mic->reg + MIC_OP); in mic_set_reg_on()
221 if (mic->i80_mode) in mic_set_reg_on()
228 writel(reg, mic->reg + MIC_OP); in mic_set_reg_on()
233 struct exynos_mic *mic = bridge->driver_private; in mic_post_disable()
236 if (!mic->enabled) in mic_post_disable()
241 pm_runtime_put(mic->dev); in mic_post_disable()
242 mic->enabled = 0; in mic_post_disable()
252 struct exynos_mic *mic = bridge->driver_private; in mic_mode_set()
255 drm_display_mode_to_videomode(mode, &mic->vm); in mic_mode_set()
256 mic->i80_mode = to_exynos_crtc(bridge->encoder->crtc)->i80_mode; in mic_mode_set()
262 struct exynos_mic *mic = bridge->driver_private; in mic_pre_enable()
266 if (mic->enabled) in mic_pre_enable()
269 ret = pm_runtime_resume_and_get(mic->dev); in mic_pre_enable()
277 DRM_DEV_ERROR(mic->dev, "Failed to reset\n"); in mic_pre_enable()
281 if (!mic->i80_mode) in mic_pre_enable()
286 mic->enabled = 1; in mic_pre_enable()
292 pm_runtime_put(mic->dev); in mic_pre_enable()
313 if (e->possible_crtcs == drm_crtc_mask(&crtc->base)) in exynos_mic_bind()
316 return -ENODEV; in exynos_mic_bind()
318 mic->bridge.driver_private = mic; in exynos_mic_bind()
320 return drm_bridge_attach(encoder, &mic->bridge, NULL, 0); in exynos_mic_bind()
329 if (!mic->enabled) in exynos_mic_unbind()
332 pm_runtime_put(mic->dev); in exynos_mic_unbind()
348 for (i = NUM_CLKS - 1; i > -1; i--) in exynos_mic_suspend()
349 clk_disable_unprepare(mic->clks[i]); in exynos_mic_suspend()
360 ret = clk_prepare_enable(mic->clks[i]); in exynos_mic_resume()
364 while (--i > -1) in exynos_mic_resume()
365 clk_disable_unprepare(mic->clks[i]); in exynos_mic_resume()
377 struct device *dev = &pdev->dev; in exynos_mic_probe()
386 ret = -ENOMEM; in exynos_mic_probe()
390 mic->dev = dev; in exynos_mic_probe()
392 ret = of_address_to_resource(dev->of_node, 0, &res); in exynos_mic_probe()
397 mic->reg = devm_ioremap(dev, res.start, resource_size(&res)); in exynos_mic_probe()
398 if (!mic->reg) { in exynos_mic_probe()
400 ret = -ENOMEM; in exynos_mic_probe()
404 mic->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, in exynos_mic_probe()
405 "samsung,disp-syscon"); in exynos_mic_probe()
406 if (IS_ERR(mic->sysreg)) { in exynos_mic_probe()
408 ret = PTR_ERR(mic->sysreg); in exynos_mic_probe()
413 mic->clks[i] = devm_clk_get(dev, clk_names[i]); in exynos_mic_probe()
414 if (IS_ERR(mic->clks[i])) { in exynos_mic_probe()
417 ret = PTR_ERR(mic->clks[i]); in exynos_mic_probe()
424 mic->bridge.funcs = &mic_bridge_funcs; in exynos_mic_probe()
425 mic->bridge.of_node = dev->of_node; in exynos_mic_probe()
427 drm_bridge_add(&mic->bridge); in exynos_mic_probe()
449 component_del(&pdev->dev, &exynos_mic_component_ops); in exynos_mic_remove()
450 pm_runtime_disable(&pdev->dev); in exynos_mic_remove()
452 drm_bridge_remove(&mic->bridge); in exynos_mic_remove()
456 { .compatible = "samsung,exynos5433-mic" },
465 .name = "exynos-mic",