Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1626773
| From | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] drm/omap: displays: panel-dpi: add backlight dependency |
| Date | 2017-04-19 22:30 +0200 |
| Message-ID | <ty4oG-7U8-27@gated-at.bofh.it> (permalink) |
| References | <ty23v-6o6-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Arnd,
Thank you for the patch.
On Wednesday 19 Apr 2017 19:59:17 Arnd Bergmann wrote:
> The panel driver gained support for backlight but fails to link now
> when that is disabled:
>
> drivers/gpu/drm/omapdrm/displays/panel-dpi.o: In function
> `panel_dpi_probe_of': panel-dpi.c:(.text.panel_dpi_probe_of+0xe8):
> undefined reference to `of_find_backlight_by_node'
>
> This adds a dependency like we have for the other panel drivers.
I believe the dependency should be made optional. DPI panels that don't need
backlight control should be supported by a kernel that has backlight support
compiled out. How about something like
From 07a98ab23b2080c79abbf8b5e7479123c50e6be7 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Wed, 19 Apr 2017 23:13:43 +0300
Subject: [PATCH] backlight: Define API stub when backlight support is disabled
The of_find_backlight_by_node() function has a stubbed when CONFIG_OF is
disabled, but drivers that use backlights optionally will still fail to
link if backlight support is disabled. Fix it by defining the stub when
CONFIG_BACKLIGHT_CLASS_DEVICE is disabled.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/linux/backlight.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 5f2fd61ef4fb..fae0b189f7b4 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -162,7 +162,7 @@ struct generic_bl_info {
void (*kick_battery)(void);
};
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
struct backlight_device *of_find_backlight_by_node(struct device_node *node);
#else
static inline struct backlight_device *
We might need to create stubs for backlight_force_update() and
backlight_device_set_brightness() too.
> Fixes: 39135a305a0f ("drm/omap: displays: panel-dpi: Support for handling
> backlight devices")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/omapdrm/displays/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/displays/Kconfig
> b/drivers/gpu/drm/omapdrm/displays/Kconfig index c226da145fb3..a349cb61961e
> 100644
> --- a/drivers/gpu/drm/omapdrm/displays/Kconfig
> +++ b/drivers/gpu/drm/omapdrm/displays/Kconfig
> @@ -35,6 +35,7 @@ config DRM_OMAP_CONNECTOR_ANALOG_TV
>
> config DRM_OMAP_PANEL_DPI
> tristate "Generic DPI panel"
> + depends on BACKLIGHT_CLASS_DEVICE
> help
> Driver for generic DPI panels.
--
Regards,
Laurent Pinchart
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] drm/omap: displays: panel-dpi: add backlight dependency Arnd Bergmann <arnd@arndb.de> - 2017-04-19 20:00 +0200
[PATCH 2/3] drm/panel: S6E3HA2 needs backlight code Arnd Bergmann <arnd@arndb.de> - 2017-04-19 20:10 +0200
Re: [PATCH 1/3] drm/omap: displays: panel-dpi: add backlight dependency Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2017-04-19 22:30 +0200
Re: [PATCH 1/3] drm/omap: displays: panel-dpi: add backlight dependency Arnd Bergmann <arnd@arndb.de> - 2017-04-19 22:40 +0200
Re: [PATCH 1/3] drm/omap: displays: panel-dpi: add backlight dependency Jani Nikula <jani.nikula@linux.intel.com> - 2017-04-20 11:10 +0200
csiph-web