Commit b4a1ed0c authored by Rob Clark's avatar Rob Clark Committed by Bartlomiej Zolnierkiewicz
Browse files

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: default avatarRob Clark <robdclark@gmail.com>
Tested-by: default avatarArnd 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: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent c143a559
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ config FB_MACMODES
       depends on FB
       depends on FB


config FB_BACKLIGHT
config FB_BACKLIGHT
	bool
	tristate
	depends on FB
	depends on FB
	select BACKLIGHT_LCD_SUPPORT
	select BACKLIGHT_LCD_SUPPORT
	select BACKLIGHT_CLASS_DEVICE
	select BACKLIGHT_CLASS_DEVICE
+4 −4
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
	info->device = dev;
	info->device = dev;
	info->fbcon_rotate_hint = -1;
	info->fbcon_rotate_hint = -1;


#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
	mutex_init(&info->bl_curve_mutex);
	mutex_init(&info->bl_curve_mutex);
#endif
#endif


@@ -429,7 +429,7 @@ static ssize_t show_fbstate(struct device *device,
	return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
	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,
static ssize_t store_bl_curve(struct device *device,
			      struct device_attribute *attr,
			      struct device_attribute *attr,
			      const char *buf, size_t count)
			      const char *buf, size_t count)
@@ -510,7 +510,7 @@ static struct device_attribute device_attrs[] = {
	__ATTR(stride, S_IRUGO, show_stride, NULL),
	__ATTR(stride, S_IRUGO, show_stride, NULL),
	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
	__ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate),
	__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),
	__ATTR(bl_curve, S_IRUGO|S_IWUSR, show_bl_curve, store_bl_curve),
#endif
#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
/* This function generates a linear backlight curve
 *
 *
 *     0: off
 *     0: off
+1 −1
Original line number Original line Diff line number Diff line
@@ -485,7 +485,7 @@ struct fb_info {
	struct list_head modelist;      /* mode list */
	struct list_head modelist;      /* mode list */
	struct fb_videomode *mode;	/* current mode */
	struct fb_videomode *mode;	/* current mode */


#ifdef CONFIG_FB_BACKLIGHT
#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
	/* assigned backlight device */
	/* assigned backlight device */
	/* set before framebuffer registration, 
	/* set before framebuffer registration, 
	   remove after unregister */
	   remove after unregister */
+0 −2
Original line number Original line Diff line number Diff line
@@ -393,11 +393,9 @@ struct fb_cursor {
	struct fb_image	image;	/* Cursor image */
	struct fb_image	image;	/* Cursor image */
};
};


#ifdef CONFIG_FB_BACKLIGHT
/* Settings for the generic backlight code */
/* Settings for the generic backlight code */
#define FB_BACKLIGHT_LEVELS	128
#define FB_BACKLIGHT_LEVELS	128
#define FB_BACKLIGHT_MAX	0xFF
#define FB_BACKLIGHT_MAX	0xFF
#endif




#endif /* _UAPI_LINUX_FB_H */
#endif /* _UAPI_LINUX_FB_H */