Lines Matching +full:logicvc +full:- +full:3
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2019-2022 Bootlin
38 struct logicvc_drm *logicvc = logicvc_drm(drm_dev); in logicvc_drm_gem_dma_dumb_create() local
41 args->pitch = logicvc->config.row_stride * DIV_ROUND_UP(args->bpp, 8); in logicvc_drm_gem_dma_dumb_create()
51 .name = "logicvc-drm",
52 .desc = "Xylon LogiCVC DRM driver",
64 .name = "logicvc-drm",
69 struct logicvc_drm *logicvc = data; in logicvc_drm_irq_handler() local
74 regmap_read(logicvc->regmap, LOGICVC_INT_STAT_REG, &stat); in logicvc_drm_irq_handler()
77 regmap_write(logicvc->regmap, LOGICVC_INT_STAT_REG, stat); in logicvc_drm_irq_handler()
80 logicvc_crtc_vblank_handler(logicvc); in logicvc_drm_irq_handler()
87 static int logicvc_drm_config_parse(struct logicvc_drm *logicvc) in logicvc_drm_config_parse() argument
89 struct drm_device *drm_dev = &logicvc->drm_dev; in logicvc_drm_config_parse()
90 struct device *dev = drm_dev->dev; in logicvc_drm_config_parse()
91 struct device_node *of_node = dev->of_node; in logicvc_drm_config_parse()
92 struct logicvc_drm_config *config = &logicvc->config; in logicvc_drm_config_parse()
97 &config->dithering); in logicvc_drm_config_parse()
100 &config->background_layer); in logicvc_drm_config_parse()
103 &config->layers_configurable); in logicvc_drm_config_parse()
107 &config->display_interface); in logicvc_drm_config_parse()
113 &config->display_colorspace); in logicvc_drm_config_parse()
119 &config->display_depth); in logicvc_drm_config_parse()
125 &config->row_stride); in logicvc_drm_config_parse()
131 drm_err(drm_dev, "Missing non-optional layers node\n"); in logicvc_drm_config_parse()
132 return -EINVAL; in logicvc_drm_config_parse()
135 config->layers_count = of_get_child_count(layers_node); in logicvc_drm_config_parse()
136 if (!config->layers_count) { in logicvc_drm_config_parse()
138 "Missing a non-optional layers children node\n"); in logicvc_drm_config_parse()
139 return -EINVAL; in logicvc_drm_config_parse()
145 static int logicvc_clocks_prepare(struct logicvc_drm *logicvc) in logicvc_clocks_prepare() argument
147 struct drm_device *drm_dev = &logicvc->drm_dev; in logicvc_clocks_prepare()
148 struct device *dev = drm_dev->dev; in logicvc_clocks_prepare()
156 .clk = &logicvc->vclk, in logicvc_clocks_prepare()
161 .clk = &logicvc->vclk2, in logicvc_clocks_prepare()
166 .clk = &logicvc->lvdsclk, in logicvc_clocks_prepare()
171 .clk = &logicvc->lvdsclkn, in logicvc_clocks_prepare()
184 if (PTR_ERR(clk) == -ENOENT && clocks_map[i].optional) in logicvc_clocks_prepare()
187 drm_err(drm_dev, "Missing non-optional clock %s\n", in logicvc_clocks_prepare()
219 static int logicvc_clocks_unprepare(struct logicvc_drm *logicvc) in logicvc_clocks_unprepare() argument
222 &logicvc->vclk, in logicvc_clocks_unprepare()
223 &logicvc->vclk2, in logicvc_clocks_unprepare()
224 &logicvc->lvdsclk, in logicvc_clocks_unprepare()
225 &logicvc->lvdsclkn, in logicvc_clocks_unprepare()
242 .major = 3,
256 logicvc_drm_caps_match(struct logicvc_drm *logicvc) in logicvc_drm_caps_match() argument
258 struct drm_device *drm_dev = &logicvc->drm_dev; in logicvc_drm_caps_match()
265 regmap_read(logicvc->regmap, LOGICVC_IP_VERSION_REG, &version); in logicvc_drm_caps_match()
287 drm_info(drm_dev, "LogiCVC version %d.%02d.%c\n", major, minor, level); in logicvc_drm_caps_match()
294 struct device_node *of_node = pdev->dev.of_node; in logicvc_drm_probe()
298 struct logicvc_drm *logicvc; in logicvc_drm_probe() local
299 struct device *dev = &pdev->dev; in logicvc_drm_probe()
309 if (ret && ret != -ENODEV) { in logicvc_drm_probe()
314 reserved_mem_node = of_parse_phandle(of_node, "memory-region", 0); in logicvc_drm_probe()
321 if (of_node->parent) in logicvc_drm_probe()
322 regmap = syscon_node_to_regmap(of_node->parent); in logicvc_drm_probe()
339 logicvc_drm_regmap_config.max_register = resource_size(&res) - in logicvc_drm_probe()
353 ret = -ENODEV; in logicvc_drm_probe()
357 logicvc = devm_drm_dev_alloc(dev, &logicvc_drm_driver, in logicvc_drm_probe()
359 if (IS_ERR(logicvc)) { in logicvc_drm_probe()
360 ret = PTR_ERR(logicvc); in logicvc_drm_probe()
364 platform_set_drvdata(pdev, logicvc); in logicvc_drm_probe()
365 drm_dev = &logicvc->drm_dev; in logicvc_drm_probe()
367 logicvc->regmap = regmap; in logicvc_drm_probe()
368 INIT_LIST_HEAD(&logicvc->layers_list); in logicvc_drm_probe()
370 caps = logicvc_drm_caps_match(logicvc); in logicvc_drm_probe()
372 ret = -EINVAL; in logicvc_drm_probe()
376 logicvc->caps = caps; in logicvc_drm_probe()
379 logicvc->reserved_mem_base = reserved_mem->base; in logicvc_drm_probe()
381 ret = logicvc_clocks_prepare(logicvc); in logicvc_drm_probe()
388 dev_name(dev), logicvc); in logicvc_drm_probe()
394 ret = logicvc_drm_config_parse(logicvc); in logicvc_drm_probe()
395 if (ret && ret != -ENODEV) { in logicvc_drm_probe()
406 ret = logicvc_layers_init(logicvc); in logicvc_drm_probe()
412 ret = logicvc_crtc_init(logicvc); in logicvc_drm_probe()
418 logicvc_layers_attach_crtc(logicvc); in logicvc_drm_probe()
420 ret = logicvc_interface_init(logicvc); in logicvc_drm_probe()
422 if (ret != -EPROBE_DEFER) in logicvc_drm_probe()
428 logicvc_interface_attach_crtc(logicvc); in logicvc_drm_probe()
430 ret = logicvc_mode_init(logicvc); in logicvc_drm_probe()
442 switch (drm_dev->mode_config.preferred_depth) { in logicvc_drm_probe()
457 logicvc_mode_fini(logicvc); in logicvc_drm_probe()
460 logicvc_clocks_unprepare(logicvc); in logicvc_drm_probe()
471 struct logicvc_drm *logicvc = platform_get_drvdata(pdev); in logicvc_drm_remove() local
472 struct device *dev = &pdev->dev; in logicvc_drm_remove()
473 struct drm_device *drm_dev = &logicvc->drm_dev; in logicvc_drm_remove()
478 logicvc_mode_fini(logicvc); in logicvc_drm_remove()
480 logicvc_clocks_unprepare(logicvc); in logicvc_drm_remove()
486 { .compatible = "xylon,logicvc-3.02.a-display" },
487 { .compatible = "xylon,logicvc-4.01.a-display" },
496 .name = "logicvc-drm",
504 MODULE_DESCRIPTION("Xylon LogiCVC DRM driver");