diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2014-04-14 16:50:17 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-04-15 14:42:51 +0200 |
commit | 21200ad10aba00943f9aa832fab04b8926dc7a52 (patch) | |
tree | 1a360d23df440bb1c00dcbbe48af76243b8433e7 /drivers/hid | |
parent | 0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff) | |
download | linux-21200ad10aba00943f9aa832fab04b8926dc7a52.tar.bz2 |
HID: thingm: remove the "play" sysfs attribute
When the thingm driver registers an instance of LED class, it creates a
"play" sysfs attribute for this blink(1) specific feature.
Since this feature is not specific to the RGB chip but to the HID device
itself, let's remove this attribute from the LED instance and only
implement what is useful to switch on and off the LED.
This feature is still easily accessible through hidraw.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-thingm.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/drivers/hid/hid-thingm.c b/drivers/hid/hid-thingm.c index a97c78845f7b..7e376b855632 100644 --- a/drivers/hid/hid-thingm.c +++ b/drivers/hid/hid-thingm.c @@ -28,7 +28,6 @@ * @rgb: 8-bit per channel RGB notation. * @fade: fade time in hundredths of a second. * @brightness: brightness coefficient. - * @play: play/pause in-memory patterns. */ struct blink1_data { struct hid_device *hdev; @@ -36,7 +35,6 @@ struct blink1_data { u32 rgb; u16 fade; u8 brightness; - bool play; }; static int blink1_send_command(struct blink1_data *data, @@ -155,41 +153,10 @@ static ssize_t blink1_store_fade(struct device *dev, static DEVICE_ATTR(fade, S_IRUGO | S_IWUSR, blink1_show_fade, blink1_store_fade); -static ssize_t blink1_show_play(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct blink1_data *data = dev_get_drvdata(dev->parent); - - return sprintf(buf, "%d\n", data->play); -} - -static ssize_t blink1_store_play(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) -{ - struct blink1_data *data = dev_get_drvdata(dev->parent); - u8 cmd[BLINK1_CMD_SIZE] = { 1, 'p', 0, 0, 0, 0, 0, 0, 0 }; - long unsigned int play; - int ret; - - ret = kstrtoul(buf, 10, &play); - if (ret) - return ret; - - data->play = !!play; - cmd[2] = data->play; - ret = blink1_send_command(data, cmd); - - return ret ? ret : count; -} - -static DEVICE_ATTR(play, S_IRUGO | S_IWUSR, - blink1_show_play, blink1_store_play); - static const struct attribute_group blink1_sysfs_group = { .attrs = (struct attribute *[]) { &dev_attr_rgb.attr, &dev_attr_fade.attr, - &dev_attr_play.attr, NULL }, }; |