// SPDX-License-Identifier: GPL-2.0 /* * Panel driver for the Samsung LMS397KF04 480x800 DPI RGB panel. * According to the data sheet the display controller is called DB7430. * Found in the Samsung Galaxy Beam GT-I8350 mobile phone. * Linus Walleij <linus.walleij@linaro.org>
*/ #include <drm/drm_mipi_dbi.h> #include <drm/drm_modes.h> #include <drm/drm_panel.h>
/* Power up */
ret = regulator_bulk_enable(ARRAY_SIZE(db->regulators),
db->regulators); if (ret) {
dev_err(db->dev, "failed to enable regulators: %d\n", ret); return ret;
}
msleep(50);
/* Turn on display */
mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON);
return 0;
}
/** * db7430_get_modes() - return the mode * @panel: the panel to get the mode for * @connector: reference to the central DRM connector control structure
*/ staticint db7430_get_modes(struct drm_panel *panel, struct drm_connector *connector)
{ struct db7430 *db = to_db7430(panel); struct drm_display_mode *mode; staticconst u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
mode = drm_mode_duplicate(connector->dev, &db7430_480_800_mode); if (!mode) {
dev_err(db->dev, "failed to add mode\n"); return -ENOMEM;
}
db = devm_drm_panel_alloc(dev, struct db7430, panel, &db7430_drm_funcs,
DRM_MODE_CONNECTOR_DPI); if (IS_ERR(db)) return PTR_ERR(db);
db->dev = dev;
/* * VCI is the analog voltage supply * VCCIO is the digital I/O voltage supply
*/
db->regulators[0].supply = "vci";
db->regulators[1].supply = "vccio";
ret = devm_regulator_bulk_get(dev,
ARRAY_SIZE(db->regulators),
db->regulators); if (ret) return dev_err_probe(dev, ret, "failed to get regulators\n");
db->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(db->reset)) {
ret = PTR_ERR(db->reset); return dev_err_probe(dev, ret, "no RESET GPIO\n");
}
ret = mipi_dbi_spi_init(spi, &db->dbi, NULL); if (ret) return dev_err_probe(dev, ret, "MIPI DBI init failed\n");
/* FIXME: if no external backlight, use internal backlight */
ret = drm_panel_of_backlight(&db->panel); if (ret) return dev_err_probe(dev, ret, "failed to add backlight\n");
/* * The DB7430 display controller may be used in several display products, * so list the different variants here and add per-variant data if needed.
*/ staticconststruct of_device_id db7430_match[] = {
{ .compatible = "samsung,lms397kf04", },
{},
};
MODULE_DEVICE_TABLE(of, db7430_match);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.