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

Commit 6a529534 authored by Dhaval Patel's avatar Dhaval Patel Committed by Narendra Muppalla
Browse files

drm/msm/dsi-stagging: keep backlight api under LED config



Keep backlight API calls under LED config to avoid
compilation issues when it is not defined.

Change-Id: I2e0f507ea580838f31b04d7fc14af1d4997e6819
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 48f2d0f7
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);