aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2014-04-14 16:50:17 -0400
committerJiri Kosina <jkosina@suse.cz>2014-04-15 08:42:51 -0400
commit21200ad10aba00943f9aa832fab04b8926dc7a52 (patch)
tree1a360d23df440bb1c00dcbbe48af76243b8433e7 /drivers/hid
parent0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff)
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.c33
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 @@
28 * @rgb: 8-bit per channel RGB notation. 28 * @rgb: 8-bit per channel RGB notation.
29 * @fade: fade time in hundredths of a second. 29 * @fade: fade time in hundredths of a second.
30 * @brightness: brightness coefficient. 30 * @brightness: brightness coefficient.
31 * @play: play/pause in-memory patterns.
32 */ 31 */
33struct blink1_data { 32struct blink1_data {
34 struct hid_device *hdev; 33 struct hid_device *hdev;
@@ -36,7 +35,6 @@ struct blink1_data {
36 u32 rgb; 35 u32 rgb;
37 u16 fade; 36 u16 fade;
38 u8 brightness; 37 u8 brightness;
39 bool play;
40}; 38};
41 39
42static int blink1_send_command(struct blink1_data *data, 40static int blink1_send_command(struct blink1_data *data,
@@ -155,41 +153,10 @@ static ssize_t blink1_store_fade(struct device *dev,
155static DEVICE_ATTR(fade, S_IRUGO | S_IWUSR, 153static DEVICE_ATTR(fade, S_IRUGO | S_IWUSR,
156 blink1_show_fade, blink1_store_fade); 154 blink1_show_fade, blink1_store_fade);
157 155
158static ssize_t blink1_show_play(struct device *dev,
159 struct device_attribute *attr, char *buf)
160{
161 struct blink1_data *data = dev_get_drvdata(dev->parent);
162
163 return sprintf(buf, "%d\n", data->play);
164}
165
166static ssize_t blink1_store_play(struct device *dev,
167 struct device_attribute *attr, const char *buf, size_t count)
168{
169 struct blink1_data *data = dev_get_drvdata(dev->parent);
170 u8 cmd[BLINK1_CMD_SIZE] = { 1, 'p', 0, 0, 0, 0, 0, 0, 0 };
171 long unsigned int play;
172 int ret;
173
174 ret = kstrtoul(buf, 10, &play);
175 if (ret)
176 return ret;
177
178 data->play = !!play;
179 cmd[2] = data->play;
180 ret = blink1_send_command(data, cmd);
181
182 return ret ? ret : count;
183}
184
185static DEVICE_ATTR(play, S_IRUGO | S_IWUSR,
186 blink1_show_play, blink1_store_play);
187
188static const struct attribute_group blink1_sysfs_group = { 156static const struct attribute_group blink1_sysfs_group = {
189 .attrs = (struct attribute *[]) { 157 .attrs = (struct attribute *[]) {
190 &dev_attr_rgb.attr, 158 &dev_attr_rgb.attr,
191 &dev_attr_fade.attr, 159 &dev_attr_fade.attr,
192 &dev_attr_play.attr,
193 NULL 160 NULL
194 }, 161 },
195}; 162};