Skip to content

Commit

Permalink
HID: thingm: add support for blink(1) mk2
Browse files Browse the repository at this point in the history
The blink(1) mk2 is a new version of the blink(1) USB RGB LED. The new
generation has 2 individually-controllable RGB chips.

This patch adds support for this device to the thingm driver, which
registers 3 new standard LED class instances for the second RGB chip.

Note that the 'n' (set) command does not support setting a color for a
single RGB chip, so it was changed to 'c' (fade) with a timeout of 0.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Vivien Didelot authored and Jiri Kosina committed Apr 15, 2014
1 parent f70ed8a commit 3121b1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/hid/hid-thingm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/* Firmware major number of supported devices */
#define THINGM_MAJOR_MK1 '1'
#define THINGM_MAJOR_MK2 '2'

struct thingm_fwinfo {
char major;
Expand All @@ -35,6 +36,10 @@ const struct thingm_fwinfo thingm_fwinfo[] = {
.major = THINGM_MAJOR_MK1,
.numrgb = 1,
.first = 0,
}, {
.major = THINGM_MAJOR_MK2,
.numrgb = 2,
.first = 1,
}
};

Expand Down Expand Up @@ -117,7 +122,7 @@ static int thingm_version(struct thingm_device *tdev)

static int thingm_write_color(struct thingm_rgb *rgb)
{
u8 buf[REPORT_SIZE] = { REPORT_ID, 'n', 0, 0, 0, 0, 0, 0, 0 };
u8 buf[REPORT_SIZE] = { REPORT_ID, 'c', 0, 0, 0, 0, 0, rgb->num, 0 };

buf[2] = rgb->red.ldev.brightness;
buf[3] = rgb->green.ldev.brightness;
Expand Down

0 comments on commit 3121b1c

Please sign in to comment.