[PATCH 18/19] staging:iio:tsl2563 add a name attribute under the iio

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Cameron
Date: Monday, April 26, 2010 - 12:31 pm

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/light/tsl2563.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
index 911c898..da3d51c 100644
--- a/drivers/staging/iio/light/tsl2563.c
+++ b/drivers/staging/iio/light/tsl2563.c
@@ -598,12 +598,24 @@ static DEVICE_ATTR(calib0, S_IRUGO | S_IWUSR,
 static DEVICE_ATTR(calib1, S_IRUGO | S_IWUSR,
 		   tsl2563_calib1_show, tsl2563_calib1_store);
 
+static ssize_t tsl2563_show_name(struct device *dev,
+				struct device_attribute *attr,
+				char *buf)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct tsl2563_chip *chip = indio_dev->dev_data;
+	return sprintf(buf, "%s\n", chip->client->name);
+}
+
+DEVICE_ATTR(name, S_IRUGO, tsl2563_show_name, NULL);
+
 static struct attribute *tsl2563_attributes[] = {
 	&dev_attr_adc0.attr,
 	&dev_attr_adc1.attr,
 	&dev_attr_illuminance0_input.attr,
 	&dev_attr_calib0.attr,
 	&dev_attr_calib1.attr,
+	&dev_attr_name.attr,
 	NULL
 };
 
-- 
1.6.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/19] staging:iio: Add new attrs for sampling freq ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 03/19] iio:staging:accelerometers move towards the ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 04/19] staging:iio: Support functions for scan mask ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 05/19] staging: iio: Move from class to bus, Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 06/19] staging:iio: Move event attributes into the ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 07/19] staging:iio: Clean out unused IIO_SCAN_EL an ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 08/19] staging:iio:max1363 move to new abi., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 09/19] staging:iio: Documentation, update iio_utils ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 10/19] staging:iio: ABI documentation (partial), Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 11/19] staging:iio: Directory name changes to match ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 12/19] staging:iio:tsl2563: change lux to illuminan ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 13/19] staging:iio: Remove naming via IDR's where n ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 14/19] staging:iio:max1363 add support for max11606 ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 15/19] staging:iio:max1363 add support for 8 bit eq ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 16/19] Staging: IIO: Fix uses of spinlocks prior to ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 17/19] staging:iio:ring_sw: Fix incorrect test on s ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 18/19] staging:iio:tsl2563 add a name attribute und ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)
[PATCH 19/19] staging:iio:Documentation: Rewrite example f ..., Jonathan Cameron, (Mon Apr 26, 12:31 pm)