Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb36dbfd authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAPDSS: Taal: remove external backlight support



Taal panel driver supports two kinds of backlight control: 1) using DSI
commands sent to the panel to control the backlight, 2) calling function
pointers going to the board file to control the backlight.

The second option is a bit hacky, and will no longer be needed when the
PWM driver supports the backlight features. After that we can use the
standard PWM backlight driver.

This patch removes the second backlight control mechanism, and adds a
boolean field, use_dsi_backlight, to nokia_dsi_panel_data which the
board file can use to inform whether the panel driver should use DSI
commands to control the backlight.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 0373cac6
Loading
Loading
Loading
Loading
+30 −46
Original line number Diff line number Diff line
@@ -208,8 +208,6 @@ struct taal_data {

	struct delayed_work te_timeout_work;

	bool use_dsi_bl;

	bool cabc_broken;
	unsigned cabc_mode;

@@ -541,7 +539,6 @@ static int taal_bl_update_status(struct backlight_device *dev)
{
	struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
	int r;
	int level;

@@ -555,7 +552,6 @@ static int taal_bl_update_status(struct backlight_device *dev)

	mutex_lock(&td->lock);

	if (td->use_dsi_bl) {
	if (td->enabled) {
		dsi_bus_lock(dssdev);

@@ -567,12 +563,6 @@ static int taal_bl_update_status(struct backlight_device *dev)
	} else {
		r = 0;
	}
	} else {
		if (!panel_data->set_backlight)
			r = -EINVAL;
		else
			r = panel_data->set_backlight(dssdev, level);
	}

	mutex_unlock(&td->lock);

@@ -950,7 +940,7 @@ static int taal_probe(struct omap_dss_device *dssdev)
{
	struct backlight_properties props;
	struct taal_data *td;
	struct backlight_device *bldev;
	struct backlight_device *bldev = NULL;
	struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
	struct panel_config *panel_config = NULL;
	int r, i;
@@ -1011,20 +1001,13 @@ static int taal_probe(struct omap_dss_device *dssdev)

	taal_hw_reset(dssdev);

	/* if no platform set_backlight() defined, presume DSI backlight
	 * control */
	if (panel_data->use_dsi_backlight) {
		memset(&props, 0, sizeof(struct backlight_properties));
	if (!panel_data->set_backlight)
		td->use_dsi_bl = true;

	if (td->use_dsi_bl)
		props.max_brightness = 255;
	else
		props.max_brightness = 127;

		props.type = BACKLIGHT_RAW;
	bldev = backlight_device_register(dev_name(&dssdev->dev), &dssdev->dev,
					dssdev, &taal_bl_ops, &props);
		bldev = backlight_device_register(dev_name(&dssdev->dev),
				&dssdev->dev, dssdev, &taal_bl_ops, &props);
		if (IS_ERR(bldev)) {
			r = PTR_ERR(bldev);
			goto err_bl;
@@ -1034,12 +1017,10 @@ static int taal_probe(struct omap_dss_device *dssdev)

		bldev->props.fb_blank = FB_BLANK_UNBLANK;
		bldev->props.power = FB_BLANK_UNBLANK;
	if (td->use_dsi_bl)
		bldev->props.brightness = 255;
	else
		bldev->props.brightness = 127;

		taal_bl_update_status(bldev);
	}

	if (panel_data->use_ext_te) {
		int gpio = panel_data->ext_te_gpio;
@@ -1097,6 +1078,7 @@ static int taal_probe(struct omap_dss_device *dssdev)
	if (panel_data->use_ext_te)
		gpio_free(panel_data->ext_te_gpio);
err_gpio:
	if (bldev != NULL)
		backlight_device_unregister(bldev);
err_bl:
	destroy_workqueue(td->workqueue);
@@ -1126,9 +1108,11 @@ static void __exit taal_remove(struct omap_dss_device *dssdev)
	}

	bldev = td->bldev;
	if (bldev != NULL) {
		bldev->props.power = FB_BLANK_POWERDOWN;
		taal_bl_update_status(bldev);
		backlight_device_unregister(bldev);
	}

	taal_cancel_ulps_work(dssdev);
	taal_cancel_esd_work(dssdev);
+2 −6
Original line number Diff line number Diff line
@@ -10,9 +10,7 @@ struct omap_dss_device;
 * @ext_te_gpio: external TE GPIO
 * @esd_interval: interval of ESD checks, 0 = disabled (ms)
 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
 * @max_backlight_level: maximum backlight level
 * @set_backlight: pointer to backlight set function
 * @get_backlight: pointer to backlight get function
 * @use_dsi_backlight: true if panel uses DSI command to control backlight
 */
struct nokia_dsi_panel_data {
	const char *name;
@@ -25,9 +23,7 @@ struct nokia_dsi_panel_data {
	unsigned esd_interval;
	unsigned ulps_timeout;

	int max_backlight_level;
	int (*set_backlight)(struct omap_dss_device *dssdev, int level);
	int (*get_backlight)(struct omap_dss_device *dssdev);
	bool use_dsi_backlight;
};

#endif /* __OMAP_NOKIA_DSI_PANEL_H */