diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-05-04 14:43:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:36:06 -0700 |
commit | e9124afad3d419213b1cd80e40bcf65445ba11f9 (patch) | |
tree | 4dd9d39142a2836287aa057ff6d2b65abb1ff278 /drivers/staging/iio | |
parent | 8474ddd7cba04c2e8d8691abda32ae0f4a684137 (diff) | |
download | kernel_samsung_smdk4412-e9124afad3d419213b1cd80e40bcf65445ba11f9.zip kernel_samsung_smdk4412-e9124afad3d419213b1cd80e40bcf65445ba11f9.tar.gz kernel_samsung_smdk4412-e9124afad3d419213b1cd80e40bcf65445ba11f9.tar.bz2 |
staging:iio:tsl2563 add a name attribute under the iio
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | 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 }; |