aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-12-20 13:13:07 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-12-20 13:13:07 -0500
commitb4a1ed0cd18b771e4279b4eb9cf39b565560eea6 (patch)
tree29acad0b518ea8aea3d468822eb3c94b81e28662
parentc143a559b073aeea688b9bb7c5b46f3cf322d569 (diff)
fbdev: make FB_BACKLIGHT a tristate
BACKLIGHT_CLASS_DEVICE is already tristate, but a dependency FB_BACKLIGHT prevents it from being built as a module. There doesn't seem to be any particularly good reason for this, so switch FB_BACKLIGHT over to tristate. Signed-off-by: Rob Clark <robdclark@gmail.com> Tested-by: Arnd Bergmann <arnd@arndb.de> Cc: Simon Horman <horms+renesas@verge.net.au> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Ulf Magnusson <ulfalizer@gmail.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Hans de Goede <j.w.r.degoede@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--drivers/video/fbdev/Kconfig2
-rw-r--r--drivers/video/fbdev/core/fbsysfs.c8
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/uapi/linux/fb.h2
4 files changed, 6 insertions, 8 deletions
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e413f54208f4..5d85965767e3 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -184,7 +184,7 @@ config FB_MACMODES
184 depends on FB 184 depends on FB
185 185
186config FB_BACKLIGHT 186config FB_BACKLIGHT
187 bool 187 tristate
188 depends on FB 188 depends on FB
189 select BACKLIGHT_LCD_SUPPORT 189 select BACKLIGHT_LCD_SUPPORT
190 select BACKLIGHT_CLASS_DEVICE 190 select BACKLIGHT_CLASS_DEVICE
diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index e31a182b42bf..44cca39f2b51 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -60,7 +60,7 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
60 info->device = dev; 60 info->device = dev;
61 info->fbcon_rotate_hint = -1; 61 info->fbcon_rotate_hint = -1;
62 62
63#ifdef CONFIG_FB_BACKLIGHT 63#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
64 mutex_init(&info->bl_curve_mutex); 64 mutex_init(&info->bl_curve_mutex);
65#endif 65#endif
66 66
@@ -429,7 +429,7 @@ static ssize_t show_fbstate(struct device *device,
429 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state); 429 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
430} 430}
431 431
432#ifdef CONFIG_FB_BACKLIGHT 432#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
433static ssize_t store_bl_curve(struct device *device, 433static ssize_t store_bl_curve(struct device *device,
434 struct device_attribute *attr, 434 struct device_attribute *attr,
435 const char *buf, size_t count) 435 const char *buf, size_t count)
@@ -510,7 +510,7 @@ static struct device_attribute device_attrs[] = {
510 __ATTR(stride, S_IRUGO, show_stride, NULL), 510 __ATTR(stride, S_IRUGO, show_stride, NULL),
511 __ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate), 511 __ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
512 __ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate), 512 __ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate),
513#ifdef CONFIG_FB_BACKLIGHT 513#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
514 __ATTR(bl_curve, S_IRUGO|S_IWUSR, show_bl_curve, store_bl_curve), 514 __ATTR(bl_curve, S_IRUGO|S_IWUSR, show_bl_curve, store_bl_curve),
515#endif 515#endif
516}; 516};
@@ -551,7 +551,7 @@ void fb_cleanup_device(struct fb_info *fb_info)
551 } 551 }
552} 552}
553 553
554#ifdef CONFIG_FB_BACKLIGHT 554#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
555/* This function generates a linear backlight curve 555/* This function generates a linear backlight curve
556 * 556 *
557 * 0: off 557 * 0: off
diff --git a/include/linux/fb.h b/include/linux/fb.h
index a3cab6dc9b44..7cdd31a69719 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -485,7 +485,7 @@ struct fb_info {
485 struct list_head modelist; /* mode list */ 485 struct list_head modelist; /* mode list */
486 struct fb_videomode *mode; /* current mode */ 486 struct fb_videomode *mode; /* current mode */
487 487
488#ifdef CONFIG_FB_BACKLIGHT 488#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
489 /* assigned backlight device */ 489 /* assigned backlight device */
490 /* set before framebuffer registration, 490 /* set before framebuffer registration,
491 remove after unregister */ 491 remove after unregister */
diff --git a/include/uapi/linux/fb.h b/include/uapi/linux/fb.h
index 6cd9b198b7c6..b6aac7ee1f67 100644
--- a/include/uapi/linux/fb.h
+++ b/include/uapi/linux/fb.h
@@ -393,11 +393,9 @@ struct fb_cursor {
393 struct fb_image image; /* Cursor image */ 393 struct fb_image image; /* Cursor image */
394}; 394};
395 395
396#ifdef CONFIG_FB_BACKLIGHT
397/* Settings for the generic backlight code */ 396/* Settings for the generic backlight code */
398#define FB_BACKLIGHT_LEVELS 128 397#define FB_BACKLIGHT_LEVELS 128
399#define FB_BACKLIGHT_MAX 0xFF 398#define FB_BACKLIGHT_MAX 0xFF
400#endif
401 399
402 400
403#endif /* _UAPI_LINUX_FB_H */ 401#endif /* _UAPI_LINUX_FB_H */