浏览代码

HID: thingm: remove the "fade" sysfs attribute

As for the "play" sysfs attribute, remove this other non-standard
attribute, so the driver only implements what is required to switch the
LED on and off. Thus, a fade time won't be ideal for some fast-changing
triggers.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Vivien Didelot 11 年之前
父节点
当前提交
aee114fd3c
共有 2 个文件被更改,包括 0 次插入49 次删除
  1. 0 8
      Documentation/ABI/testing/sysfs-driver-hid-thingm
  2. 0 41
      drivers/hid/hid-thingm.c

+ 0 - 8
Documentation/ABI/testing/sysfs-driver-hid-thingm

@@ -6,11 +6,3 @@ Description:	The ThingM blink1 is an USB RGB LED. The color notation is
 		color. Write the 24-bit hexadecimal color to change the current
 		color. Write the 24-bit hexadecimal color to change the current
 		LED color. The default color is full white (0xFFFFFF).
 		LED color. The default color is full white (0xFFFFFF).
 		For instance, set the color to green with: echo 00FF00 > rgb
 		For instance, set the color to green with: echo 00FF00 > rgb
-
-What:		/sys/class/leds/blink1::<serial>/fade
-Date:		January 2013
-Contact:	Vivien Didelot <vivien.didelot@savoirfairelinux.com>
-Description:	This attribute allows to set a fade time in milliseconds for
-		the next color change. Read the attribute to know the current
-		fade time. The default value is set to 0 (no fade time). For
-		instance, set a fade time of 2 seconds with: echo 2000 > fade

+ 0 - 41
drivers/hid/hid-thingm.c

@@ -26,14 +26,12 @@
  * @hdev:		HID device.
  * @hdev:		HID device.
  * @led_cdev:		LED class instance.
  * @led_cdev:		LED class instance.
  * @rgb:		8-bit per channel RGB notation.
  * @rgb:		8-bit per channel RGB notation.
- * @fade:		fade time in hundredths of a second.
  * @brightness:		brightness coefficient.
  * @brightness:		brightness coefficient.
  */
  */
 struct blink1_data {
 struct blink1_data {
 	struct hid_device *hdev;
 	struct hid_device *hdev;
 	struct led_classdev led_cdev;
 	struct led_classdev led_cdev;
 	u32 rgb;
 	u32 rgb;
-	u16 fade;
 	u8 brightness;
 	u8 brightness;
 };
 };
 
 
@@ -64,12 +62,6 @@ static int blink1_update_color(struct blink1_data *data)
 		buf[4] = DIV_ROUND_CLOSEST(blink1_rgb_to_b(data->rgb), coef);
 		buf[4] = DIV_ROUND_CLOSEST(blink1_rgb_to_b(data->rgb), coef);
 	}
 	}
 
 
-	if (data->fade) {
-		buf[1] = 'c';
-		buf[5] = (data->fade & 0xFF00) >> 8;
-		buf[6] = (data->fade & 0x00FF);
-	}
-
 	return blink1_send_command(data, buf);
 	return blink1_send_command(data, buf);
 }
 }
 
 
@@ -121,42 +113,9 @@ static ssize_t blink1_store_rgb(struct device *dev,
 
 
 static DEVICE_ATTR(rgb, S_IRUGO | S_IWUSR, blink1_show_rgb, blink1_store_rgb);
 static DEVICE_ATTR(rgb, S_IRUGO | S_IWUSR, blink1_show_rgb, blink1_store_rgb);
 
 
-static ssize_t blink1_show_fade(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct blink1_data *data = dev_get_drvdata(dev->parent);
-
-	return sprintf(buf, "%d\n", data->fade * 10);
-}
-
-static ssize_t blink1_store_fade(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count)
-{
-	struct blink1_data *data = dev_get_drvdata(dev->parent);
-	long unsigned int fade;
-	int ret;
-
-	ret = kstrtoul(buf, 10, &fade);
-	if (ret)
-		return ret;
-
-	/* blink(1) accepts 16-bit fade time, number of 10ms ticks */
-	fade = DIV_ROUND_CLOSEST(fade, 10);
-	if (fade > 65535)
-		return -EINVAL;
-
-	data->fade = fade;
-
-	return count;
-}
-
-static DEVICE_ATTR(fade, S_IRUGO | S_IWUSR,
-		blink1_show_fade, blink1_store_fade);
-
 static const struct attribute_group blink1_sysfs_group = {
 static const struct attribute_group blink1_sysfs_group = {
 	.attrs = (struct attribute *[]) {
 	.attrs = (struct attribute *[]) {
 		&dev_attr_rgb.attr,
 		&dev_attr_rgb.attr,
-		&dev_attr_fade.attr,
 		NULL
 		NULL
 	},
 	},
 };
 };