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 <[email protected]>
Tested-by: Arnd Bergmann <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Ulf Magnusson <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Hans de Goede <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
This commit is contained in:
Rob Clark 2018-12-20 19:13:07 +01:00 • committed by Bartlomiej Zolnierkiewicz
commit b4a1ed0cd1
4 changed files with 6 additions and 8 deletions

View file

@ -184,7 +184,7 @@ config FB_MACMODES
depends on FB
config FB_BACKLIGHT
bool
tristate
depends on FB
select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE

View file

@ -60,7 +60,7 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
info->device = dev;
info->fbcon_rotate_hint = -1;
#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
mutex_init(&info->bl_curve_mutex);
#endif
@ -429,7 +429,7 @@ static ssize_t show_fbstate(struct device *device,
return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
}
#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
static ssize_t store_bl_curve(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
@ -510,7 +510,7 @@ static struct device_attribute device_attrs[] = {
__ATTR(stride, S_IRUGO, show_stride, NULL),
__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
__ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate),
#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
__ATTR(bl_curve, S_IRUGO|S_IWUSR, show_bl_curve, store_bl_curve),
#endif
};
@ -551,7 +551,7 @@ void fb_cleanup_device(struct fb_info *fb_info)
}
}
#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
/* This function generates a linear backlight curve
*
* 0: off