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

Commit 7084219c authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/dsi-stagging: keep backlight api under LED config" into msm-4.8

parents a6c9b6f3 6a529534
Loading
Loading
Loading
Loading
+42 −26
Original line number Diff line number Diff line
@@ -317,13 +317,12 @@ static int dsi_panel_pinctrl_init(struct dsi_panel *panel)
	return rc;
}

static int dsi_panel_bl_register(struct dsi_panel *panel)
#ifdef CONFIG_LEDS_TRIGGERS
static int dsi_panel_led_bl_register(struct dsi_panel *panel,
				struct dsi_backlight_config *bl)
{
	int rc = 0;
	struct dsi_backlight_config *bl = &panel->bl_config;

	switch (bl->type) {
	case DSI_BACKLIGHT_WLED:
	led_trigger_register_simple("bkl-trigger", &bl->wled);

	/* LED APIs don't tell us directly whether a classdev has yet
@@ -334,8 +333,7 @@ static int dsi_panel_bl_register(struct dsi_panel *panel)
	 * Check the cdev list directly and defer if appropriate.
	 */
	if (!bl->wled) {
			pr_err("[%s] backlight registration failed\n",
					panel->name);
		pr_err("[%s] backlight registration failed\n", panel->name);
		rc = -EINVAL;
	} else {
		read_lock(&bl->wled->leddev_list_lock);
@@ -350,6 +348,24 @@ static int dsi_panel_bl_register(struct dsi_panel *panel)
		}
	}

	return rc;
}
#else
static int dsi_panel_led_bl_register(struct dsi_panel *panel,
				struct dsi_backlight_config *bl)
{
	return 0;
}
#endif

static int dsi_panel_bl_register(struct dsi_panel *panel)
{
	int rc = 0;
	struct dsi_backlight_config *bl = &panel->bl_config;

	switch (bl->type) {
	case DSI_BACKLIGHT_WLED:
		rc = dsi_panel_led_bl_register(panel, bl);
		break;
	default:
		pr_err("Backlight type(%d) not supported\n", bl->type);