Skip to content

Commit ddfb97d

Browse files
andreamerelloJonathan Cameron
authored andcommitted
iio: core: add thermocouple_type standard attribute
We have a couple of thermocouple IIO drivers, supporting several chips. Some of them support only one specific thermocouple type (e.g. "K", "J"), one of them can be configured to work with several different thermocouple types. In certain applications thermocouples could be externally connected to the chip by the user. This patch introduces a new IIO standard attribute to report the supported thermocouple type and, where applicable, to allow it to be dynamically set using sysfs. 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>
1 parent 8cb3403 commit ddfb97d

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/iio/industrialio-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ static const char * const iio_chan_info_postfix[] = {
161161
[IIO_CHAN_INFO_DEBOUNCE_TIME] = "debounce_time",
162162
[IIO_CHAN_INFO_CALIBEMISSIVITY] = "calibemissivity",
163163
[IIO_CHAN_INFO_OVERSAMPLING_RATIO] = "oversampling_ratio",
164+
[IIO_CHAN_INFO_THERMOCOUPLE_TYPE] = "thermocouple_type",
164165
};
165166

166167
/**

‎include/linux/iio/types.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ enum iio_chan_info_enum {
5858
IIO_CHAN_INFO_DEBOUNCE_TIME,
5959
IIO_CHAN_INFO_CALIBEMISSIVITY,
6060
IIO_CHAN_INFO_OVERSAMPLING_RATIO,
61+
IIO_CHAN_INFO_THERMOCOUPLE_TYPE,
6162
};
6263

6364
#endif /* _IIO_TYPES_H_ */

0 commit comments

Comments
 (0)