Lines Matching defs:sdev

279 	struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
282 for (i = 0; i < sdev->clk_count; ++i) {
283 if (sdev->clks[i]) {
284 clk_disable_unprepare(sdev->clks[i]);
285 clk_put(sdev->clks[i]);
290 static int simpledrm_device_init_clocks(struct simpledrm_device *sdev)
292 struct drm_device *dev = &sdev->dev;
302 sdev->clk_count = of_clk_get_parent_count(of_node);
303 if (!sdev->clk_count)
306 sdev->clks = drmm_kzalloc(dev, sdev->clk_count * sizeof(sdev->clks[0]),
308 if (!sdev->clks)
311 for (i = 0; i < sdev->clk_count; ++i) {
327 sdev->clks[i] = clock;
332 sdev);
337 if (sdev->clks[i]) {
338 clk_disable_unprepare(sdev->clks[i]);
339 clk_put(sdev->clks[i]);
345 static int simpledrm_device_init_clocks(struct simpledrm_device *sdev)
377 struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
380 for (i = 0; i < sdev->regulator_count; ++i) {
381 if (sdev->regulators[i]) {
382 regulator_disable(sdev->regulators[i]);
383 regulator_put(sdev->regulators[i]);
388 static int simpledrm_device_init_regulators(struct simpledrm_device *sdev)
390 struct drm_device *dev = &sdev->dev;
412 sdev->regulators = drmm_kzalloc(dev,
413 count * sizeof(sdev->regulators[0]),
415 if (!sdev->regulators)
446 sdev->regulators[i++] = regulator;
448 sdev->regulator_count = i;
452 sdev);
457 if (sdev->regulators[i]) {
458 regulator_disable(sdev->regulators[i]);
459 regulator_put(sdev->regulators[i]);
465 static int simpledrm_device_init_regulators(struct simpledrm_device *sdev)
488 struct simpledrm_device *sdev = simpledrm_device_of_dev(dev);
503 struct iosys_map dst = sdev->screen_base;
508 iosys_map_incr(&dst, drm_fb_clip_offset(sdev->pitch, sdev->format, &dst_clip));
509 drm_fb_blit(&dst, &sdev->pitch, sdev->format->format, shadow_plane_state->data,
522 struct simpledrm_device *sdev = simpledrm_device_of_dev(dev);
529 iosys_map_memset(&sdev->screen_base, 0, 0, sdev->pitch * sdev->mode.vdisplay);
551 struct simpledrm_device *sdev = simpledrm_device_of_dev(crtc->dev);
553 return drm_crtc_helper_mode_valid_fixed(crtc, mode, &sdev->mode);
581 struct simpledrm_device *sdev = simpledrm_device_of_dev(connector->dev);
583 return drm_connector_helper_get_modes_fixed(connector, &sdev->mode);
625 struct simpledrm_device *sdev;
640 sdev = devm_drm_dev_alloc(&pdev->dev, drv, struct simpledrm_device, dev);
641 if (IS_ERR(sdev))
642 return ERR_CAST(sdev);
643 dev = &sdev->dev;
644 platform_set_drvdata(pdev, sdev);
650 ret = simpledrm_device_init_clocks(sdev);
653 ret = simpledrm_device_init_regulators(sdev);
711 sdev->mode = simpledrm_mode(width, height, width_mm, height_mm);
712 sdev->format = format;
713 sdev->pitch = stride;
715 drm_dbg(dev, "display mode={" DRM_MODE_FMT "}\n", DRM_MODE_ARG(&sdev->mode));
738 iosys_map_set_vaddr(&sdev->screen_base, screen_base);
770 iosys_map_set_vaddr_iomem(&sdev->screen_base, screen_base);
794 sdev->formats, ARRAY_SIZE(sdev->formats));
796 primary_plane = &sdev->primary_plane;
798 sdev->formats, nformats,
808 crtc = &sdev->crtc;
817 encoder = &sdev->encoder;
826 connector = &sdev->connector;
842 return sdev;
868 struct simpledrm_device *sdev;
873 sdev = simpledrm_device_create(&simpledrm_driver, pdev);
874 if (IS_ERR(sdev))
875 return PTR_ERR(sdev);
876 dev = &sdev->dev;
882 color_mode = drm_format_info_bpp(sdev->format, 0);
884 color_mode = sdev->format->depth; // can be 15 or 16
893 struct simpledrm_device *sdev = platform_get_drvdata(pdev);
894 struct drm_device *dev = &sdev->dev;