greybus: lights: enable multi color LED support
authorKris Huang <huang_kris@projectara.com>
Tue, 9 Aug 2016 03:28:37 +0000 (11:28 +0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 10 Aug 2016 13:47:30 +0000 (15:47 +0200)
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 <huang_kris@projectara.com>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/kernel_ver.h
drivers/staging/greybus/light.c

index 62d6400..97e7ac9 100644 (file)
@@ -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
index fb41b0b..a57d593 100644 (file)
@@ -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)
 {