Lines Matching refs:dev
77 panel_mipi_dbi_check_commands(struct device *dev, const struct firmware *fw)
85 dev_err(dev, "config: file size=%zu is too small\n", size);
90 dev_err(dev, "config: Bad magic: %15ph\n", config->magic);
95 dev_err(dev, "config: version=%u is not supported\n", config->file_format_version);
99 drm_dev_dbg(dev, DRM_UT_DRIVER, "size=%zu version=%u\n", size, config->file_format_version);
110 dev_err(dev, "config: command=0x%02x num_parameters=%u overflows\n",
116 drm_dev_dbg(dev, DRM_UT_DRIVER, "sleep %ums\n", parameters[0]);
118 drm_dev_dbg(dev, DRM_UT_DRIVER, "command %02x %*ph\n",
123 dev_err(dev, "config: malformed command array\n");
127 commands = devm_kzalloc(dev, sizeof(*commands), GFP_KERNEL);
132 commands->buf = devm_kmemdup(dev, config->commands, commands->len, GFP_KERNEL);
139 static struct panel_mipi_dbi_commands *panel_mipi_dbi_commands_from_fw(struct device *dev)
147 ret = of_property_read_string_index(dev->of_node, "compatible", 0, &compatible);
152 ret = request_firmware(&fw, fw_name, dev);
154 dev_err(dev, "No config file found for compatible '%s' (error=%d)\n",
160 commands = panel_mipi_dbi_check_commands(dev, fw);
194 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
198 if (!drm_dev_enter(pipe->crtc.dev, &idx))
201 drm_dbg(pipe->crtc.dev, "\n");
234 struct device *dev = dbidev->drm.dev;
238 ret = of_get_drm_panel_display_mode(dev->of_node, mode, NULL);
240 dev_err(dev, "%pOF: failed to get panel-timing (error=%d)\n", dev->of_node, ret);
257 dev_err(dev, "%pOF: panel-timing out of bounds\n", dev->of_node);
273 struct device *dev = &spi->dev;
281 dbidev = devm_drm_dev_alloc(dev, &panel_mipi_dbi_driver, struct mipi_dbi_dev, drm);
292 dbidev->regulator = devm_regulator_get(dev, "power");
294 return dev_err_probe(dev, PTR_ERR(dbidev->regulator),
297 dbidev->io_regulator = devm_regulator_get(dev, "io");
299 return dev_err_probe(dev, PTR_ERR(dbidev->io_regulator),
302 dbidev->backlight = devm_of_find_backlight(dev);
304 return dev_err_probe(dev, PTR_ERR(dbidev->backlight), "Failed to get backlight\n");
306 dbi->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
308 return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n");
311 dc = devm_gpiod_get_optional(dev, "dc", GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
313 return dev_err_probe(dev, PTR_ERR(dc), "Failed to get GPIO 'dc'\n");
319 if (device_property_present(dev, "write-only"))
322 dbidev->driver_private = panel_mipi_dbi_commands_from_fw(dev);
356 static int __maybe_unused panel_mipi_dbi_pm_suspend(struct device *dev)
358 return drm_mode_config_helper_suspend(dev_get_drvdata(dev));
361 static int __maybe_unused panel_mipi_dbi_pm_resume(struct device *dev)
363 drm_mode_config_helper_resume(dev_get_drvdata(dev));