diff mbox

[1/2] omap: dss2: Add recommended bpp option for generic dpi panels

Message ID 1297530130-10355-2-git-send-email-daniel.morsing@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Daniel Morsing Feb. 12, 2011, 5:02 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 07eb30e..b52a28f 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -43,6 +43,8 @@  struct panel_config {
 	/* Unit: line clocks */
 	int acb;	/* ac-bias pin frequency */
 
+	int recommended_bpp; /* overrides the default bpp */
+
 	enum omap_panel_config config;
 
 	int power_on_delay;
@@ -331,6 +333,17 @@  static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
 	return dpi_check_timings(dssdev, timings);
 }
 
+static int generic_dpi_panel_get_bpp(struct omap_dss_device *dssdev)
+{
+	struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev);
+	struct panel_config *panel_config = drv_data->panel_config;
+
+	if (panel_config->recommended_bpp != 0)
+		return panel_config->recommended_bpp;
+
+	return omapdss_default_get_recommended_bpp(dssdev);
+}
+
 static struct omap_dss_driver dpi_driver = {
 	.probe		= generic_dpi_panel_probe,
 	.remove		= generic_dpi_panel_remove,
@@ -344,6 +357,8 @@  static struct omap_dss_driver dpi_driver = {
 	.get_timings	= generic_dpi_panel_get_timings,
 	.check_timings	= generic_dpi_panel_check_timings,
 
+	.get_recommended_bpp = generic_dpi_panel_get_bpp,
+
 	.driver         = {
 		.name   = "generic_dpi_panel",
 		.owner  = THIS_MODULE,