From 811b1f58610d219610c223a1d63031171a079a7c Mon Sep 17 00:00:00 2001 From: Kris Huang Date: Tue, 9 Aug 2016 11:28:37 +0800 Subject: [PATCH] greybus: lights: enable multi color LED support A backport (commit 79c4de08c0e5a26b04a4ac9e6543dad6379f0b40) was applied in kernel which adding attribute-group support in led-class. Remove the LED_HAVE_GROUPS flag check entirely that allow led drivers to create custom attributes like color/fade_in/fade_out. Testing Done: Compiled and verified on EVT2 and gpbridge-test module with device class daughter board. Signed-off-by: Kris Huang Reviewed-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/kernel_ver.h | 7 ------- drivers/staging/greybus/light.c | 8 -------- 2 files changed, 15 deletions(-) diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h index 62d640013035..97e7ac9498fd 100644 --- a/drivers/staging/greybus/kernel_ver.h +++ b/drivers/staging/greybus/kernel_ver.h @@ -252,13 +252,6 @@ static inline size_t sg_pcopy_from_buffer(struct scatterlist *sgl, list_entry((ptr)->prev, type, member) #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) -/* - * Before this version the led classdev did not support groups - */ -#define LED_HAVE_GROUPS -#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) /* * At this time the internal API for the set brightness was changed to the async diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index fb41b0b1a98c..a57d59339bd6 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -172,7 +172,6 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel) } #endif /* !LED_HAVE_FLASH */ -#ifdef LED_HAVE_GROUPS static int gb_lights_color_set(struct gb_channel *channel, u32 color); static int gb_lights_fade_set(struct gb_channel *channel); @@ -378,13 +377,6 @@ static int gb_lights_color_set(struct gb_channel *channel, u32 color) return ret; } -#else /* LED_HAVE_GROUPS */ -static int channel_attr_groups_set(struct gb_channel *channel, - struct led_classdev *cdev) -{ - return 0; -} -#endif /* !LED_HAVE_GROUPS */ static int __gb_lights_led_brightness_set(struct gb_channel *channel) { -- 2.39.5