diff options
| -rw-r--r-- | drivers/hid/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-led.c | 26 |
4 files changed, 29 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index e33ccefe3e54..8b4b38fb9e7e 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
| @@ -398,6 +398,7 @@ config HID_LED | |||
| 398 | - Dream Cheeky Webmail Notifier and Friends Alert | 398 | - Dream Cheeky Webmail Notifier and Friends Alert |
| 399 | - ThingM blink(1) | 399 | - ThingM blink(1) |
| 400 | - Delcom Visual Signal Indicator Generation 2 | 400 | - Delcom Visual Signal Indicator Generation 2 |
| 401 | - Greynut Luxafor | ||
| 401 | 402 | ||
| 402 | To compile this driver as a module, choose M here: the | 403 | To compile this driver as a module, choose M here: the |
| 403 | module will be called hid-led. | 404 | module will be called hid-led. |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f808ae71f9a1..a034f14f6d6f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1965,6 +1965,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
| 1965 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) }, | 1965 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) }, |
| 1966 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) }, | 1966 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) }, |
| 1967 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) }, | 1967 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) }, |
| 1968 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_LUXAFOR) }, | ||
| 1968 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500) }, | 1969 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500) }, |
| 1969 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_KEYBOARD) }, | 1970 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_KEYBOARD) }, |
| 1970 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) }, | 1971 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index ffefbd09fb4c..dafd2a37da1f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -685,6 +685,7 @@ | |||
| 685 | #define USB_DEVICE_ID_PICOLCD_BOOTLOADER 0xf002 | 685 | #define USB_DEVICE_ID_PICOLCD_BOOTLOADER 0xf002 |
| 686 | #define USB_DEVICE_ID_PICK16F1454 0x0042 | 686 | #define USB_DEVICE_ID_PICK16F1454 0x0042 |
| 687 | #define USB_DEVICE_ID_PICK16F1454_V2 0xf2f7 | 687 | #define USB_DEVICE_ID_PICK16F1454_V2 0xf2f7 |
| 688 | #define USB_DEVICE_ID_LUXAFOR 0xf372 | ||
| 688 | 689 | ||
| 689 | #define USB_VENDOR_ID_MICROSOFT 0x045e | 690 | #define USB_VENDOR_ID_MICROSOFT 0x045e |
| 690 | #define USB_DEVICE_ID_SIDEWINDER_GV 0x003b | 691 | #define USB_DEVICE_ID_SIDEWINDER_GV 0x003b |
diff --git a/drivers/hid/hid-led.c b/drivers/hid/hid-led.c index d793ecefb8b6..4c43ef8e71f8 100644 --- a/drivers/hid/hid-led.c +++ b/drivers/hid/hid-led.c | |||
| @@ -28,6 +28,7 @@ enum hidled_type { | |||
| 28 | DREAM_CHEEKY, | 28 | DREAM_CHEEKY, |
| 29 | THINGM, | 29 | THINGM, |
| 30 | DELCOM, | 30 | DELCOM, |
| 31 | LUXAFOR, | ||
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 33 | static unsigned const char riso_kagaku_tbl[] = { | 34 | static unsigned const char riso_kagaku_tbl[] = { |
| @@ -329,6 +330,19 @@ static int delcom_init(struct hidled_device *ldev) | |||
| 329 | return dp.fw.family_code == 2 ? 0 : -ENODEV; | 330 | return dp.fw.family_code == 2 ? 0 : -ENODEV; |
| 330 | } | 331 | } |
| 331 | 332 | ||
| 333 | static int luxafor_write(struct led_classdev *cdev, enum led_brightness br) | ||
| 334 | { | ||
| 335 | struct hidled_led *led = to_hidled_led(cdev); | ||
| 336 | __u8 buf[MAX_REPORT_SIZE] = { [1] = 1 }; | ||
| 337 | |||
| 338 | buf[2] = led->rgb->num + 1; | ||
| 339 | buf[3] = led->rgb->red.cdev.brightness; | ||
| 340 | buf[4] = led->rgb->green.cdev.brightness; | ||
| 341 | buf[5] = led->rgb->blue.cdev.brightness; | ||
| 342 | |||
| 343 | return hidled_send(led->rgb->ldev, buf); | ||
| 344 | } | ||
| 345 | |||
| 332 | static const struct hidled_config hidled_configs[] = { | 346 | static const struct hidled_config hidled_configs[] = { |
| 333 | { | 347 | { |
| 334 | .type = RISO_KAGAKU, | 348 | .type = RISO_KAGAKU, |
| @@ -373,6 +387,16 @@ static const struct hidled_config hidled_configs[] = { | |||
| 373 | .init = delcom_init, | 387 | .init = delcom_init, |
| 374 | .write = delcom_write, | 388 | .write = delcom_write, |
| 375 | }, | 389 | }, |
| 390 | { | ||
| 391 | .type = LUXAFOR, | ||
| 392 | .name = "Greynut Luxafor", | ||
| 393 | .short_name = "luxafor", | ||
| 394 | .max_brightness = 255, | ||
| 395 | .num_leds = 6, | ||
| 396 | .report_size = 9, | ||
| 397 | .report_type = OUTPUT_REPORT, | ||
| 398 | .write = luxafor_write, | ||
| 399 | }, | ||
| 376 | }; | 400 | }; |
| 377 | 401 | ||
| 378 | static int hidled_init_led(struct hidled_led *led, const char *color_name, | 402 | static int hidled_init_led(struct hidled_led *led, const char *color_name, |
| @@ -480,6 +504,8 @@ static const struct hid_device_id hidled_table[] = { | |||
| 480 | USB_DEVICE_ID_BLINK1), .driver_data = THINGM }, | 504 | USB_DEVICE_ID_BLINK1), .driver_data = THINGM }, |
| 481 | { HID_USB_DEVICE(USB_VENDOR_ID_DELCOM, | 505 | { HID_USB_DEVICE(USB_VENDOR_ID_DELCOM, |
| 482 | USB_DEVICE_ID_DELCOM_VISUAL_IND), .driver_data = DELCOM }, | 506 | USB_DEVICE_ID_DELCOM_VISUAL_IND), .driver_data = DELCOM }, |
| 507 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, | ||
| 508 | USB_DEVICE_ID_LUXAFOR), .driver_data = LUXAFOR }, | ||
| 483 | { } | 509 | { } |
| 484 | }; | 510 | }; |
| 485 | MODULE_DEVICE_TABLE(hid, hidled_table); | 511 | MODULE_DEVICE_TABLE(hid, hidled_table); |
