diff options
author | Andrea Merello <andrea.merello@gmail.com> | 2019-11-20 15:47:51 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-11-23 12:33:07 +0000 |
commit | 8cb3403633146afe1ba81f79224679f5df2940d4 (patch) | |
tree | c9ebfe584e1e769c5615579a272a9fbd68cee373 /include/linux/iio | |
parent | 57a4274ce168d4e63a7b5f4a8a776f7bdd5666a9 (diff) | |
download | linux-8cb3403633146afe1ba81f79224679f5df2940d4.tar.gz linux-8cb3403633146afe1ba81f79224679f5df2940d4.tar.bz2 linux-8cb3403633146afe1ba81f79224679f5df2940d4.zip |
iio: core: add char type for sysfs attributes
This patch introduces IIO_VAL_CHAR type for standard IIO attributes to
allow for attributes that needs to be represented by character rather
than a number. This is preparatory for introducing a new attribute whose
purpose is to describe thermocouple type, that can be i.e. "J", "K", etc..
The char-type value is stored in the first "value" integer that is passed
to the .[read/write]_raw() callbacks.
Note that in order to make it possible for the IIO core to correctly parse
this type (actually, to avoid integer parsing), it became mandatory for
any driver that wish to use IIO_VAL_CHAR on a writable attribute to
implement .write_raw_get_fmt().
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Patrick Havelange <patrick.havelange@essensium.com>
Cc: Matt Weber <matthew.weber@rockwellcollins.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Chuhong Yuan <hslester96@gmail.com>
Cc: Daniel Gomez <dagmcr@gmail.com>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index fa824e160f35..8e0026da38c9 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -25,6 +25,7 @@ enum iio_event_info { #define IIO_VAL_INT_MULTIPLE 5 #define IIO_VAL_FRACTIONAL 10 #define IIO_VAL_FRACTIONAL_LOG2 11 +#define IIO_VAL_CHAR 12 enum iio_available_type { IIO_AVAIL_LIST, |