From 8ff6b3bc9493089247e012a9fcba7198e194b4a5 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 13 Sep 2015 20:26:11 -0700 Subject: iio: chemical: Add IIO_CONCENTRATION channel type There are air quality sensors that report data back in parts per million of VOC (Volatile Organic Compounds) which are usually indexed from CO2 or another common pollutant. This patchset adds an IIO_CONCENTRATION type that returns a percentage of substance because no other channels types fit this use case. Modifiers for IIO_MOD_CO2 and IIO_MOD_VOC gas types are defined. Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron --- include/uapi/linux/iio/types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/uapi') diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 2f8b11722204..1e4c4e346ffb 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -35,6 +35,7 @@ enum iio_chan_type { IIO_ENERGY, IIO_DISTANCE, IIO_VELOCITY, + IIO_CONCENTRATION, }; enum iio_modifier { @@ -72,6 +73,8 @@ enum iio_modifier { IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z, IIO_MOD_I, IIO_MOD_Q, + IIO_MOD_CO2, + IIO_MOD_VOC, }; enum iio_event_type { -- cgit v1.2.3 From d38d54692d454e4dded125677e39f53514dc4277 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 13 Sep 2015 20:26:12 -0700 Subject: iio: resistance: add IIO_RESISTANCE channel type Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron --- Documentation/ABI/testing/sysfs-bus-iio | 8 ++++++++ drivers/iio/industrialio-core.c | 1 + include/uapi/linux/iio/types.h | 1 + 3 files changed, 10 insertions(+) (limited to 'include/uapi') diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 08903b940957..8ce14c85156d 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -1471,3 +1471,11 @@ KernelVersion: 4.3 Contact: linux-iio@vger.kernel.org Description: Raw (unscaled no offset etc.) percentage reading of a substance. + +What: /sys/bus/iio/devices/iio:deviceX/in_resistance_raw +What: /sys/bus/iio/devices/iio:deviceX/in_resistanceX_raw +KernelVersion: 4.3 +Contact: linux-iio@vger.kernel.org +Description: + Raw (unscaled no offset etc.) resistance reading that can be processed + into an ohm value. diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index ee09a945a2c7..208358f9e7e3 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -76,6 +76,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_DISTANCE] = "distance", [IIO_VELOCITY] = "velocity", [IIO_CONCENTRATION] = "concentration", + [IIO_RESISTANCE] = "resistance", }; static const char * const iio_modifier_names[] = { diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 1e4c4e346ffb..7c63bd67c36e 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -36,6 +36,7 @@ enum iio_chan_type { IIO_DISTANCE, IIO_VELOCITY, IIO_CONCENTRATION, + IIO_RESISTANCE, }; enum iio_modifier { -- cgit v1.2.3 From 3c2f85b8ce8acee0502d61fb53015eabd7d4c8fb Mon Sep 17 00:00:00 2001 From: Easwar Hariharan Date: Mon, 26 Oct 2015 10:28:31 -0400 Subject: staging/rdma/hfi1: Remove QSFP_ENABLED from HFI capability mask The QSFP interface code has been running without issues and the flag is never set to off. This patch removes the QSFP_ENABLED bit from HFI1_CAP. Reviewed-by: Mike Marciniszyn Signed-off-by: Easwar Hariharan Signed-off-by: Ira Weiny Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rdma/hfi1/chip.c | 3 +-- drivers/staging/rdma/hfi1/common.h | 2 -- drivers/staging/rdma/hfi1/qsfp.c | 13 ++++--------- include/uapi/rdma/hfi/hfi1_user.h | 4 ++-- 4 files changed, 7 insertions(+), 15 deletions(-) (limited to 'include/uapi') diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c index 1747ab6410a9..a898d3eed888 100644 --- a/drivers/staging/rdma/hfi1/chip.c +++ b/drivers/staging/rdma/hfi1/chip.c @@ -5714,8 +5714,7 @@ void init_qsfp(struct hfi1_pportdata *ppd) u64 qsfp_mask; if (loopback == LOOPBACK_SERDES || loopback == LOOPBACK_LCB || - ppd->dd->icode == ICODE_FUNCTIONAL_SIMULATOR || - !HFI1_CAP_IS_KSET(QSFP_ENABLED)) { + ppd->dd->icode == ICODE_FUNCTIONAL_SIMULATOR) { ppd->driver_link_ready = 1; return; } diff --git a/drivers/staging/rdma/hfi1/common.h b/drivers/staging/rdma/hfi1/common.h index 5f2293729cf9..de62cbe2224c 100644 --- a/drivers/staging/rdma/hfi1/common.h +++ b/drivers/staging/rdma/hfi1/common.h @@ -147,7 +147,6 @@ HFI1_CAP_USE_SDMA_HEAD | \ HFI1_CAP_EXTENDED_PSN | \ HFI1_CAP_PRINT_UNIMPL | \ - HFI1_CAP_QSFP_ENABLED | \ HFI1_CAP_NO_INTEGRITY | \ HFI1_CAP_PKEY_CHECK) << \ HFI1_CAP_USER_SHIFT) @@ -163,7 +162,6 @@ HFI1_CAP_SDMA | \ HFI1_CAP_PRINT_UNIMPL | \ HFI1_CAP_STATIC_RATE_CTRL | \ - HFI1_CAP_QSFP_ENABLED | \ HFI1_CAP_PKEY_CHECK | \ HFI1_CAP_MULTI_PKT_EGR | \ HFI1_CAP_EXTENDED_PSN | \ diff --git a/drivers/staging/rdma/hfi1/qsfp.c b/drivers/staging/rdma/hfi1/qsfp.c index 3138936157db..ffdb1d787a80 100644 --- a/drivers/staging/rdma/hfi1/qsfp.c +++ b/drivers/staging/rdma/hfi1/qsfp.c @@ -403,16 +403,11 @@ static const char *pwr_codes = "1.5W2.0W2.5W3.5W"; int qsfp_mod_present(struct hfi1_pportdata *ppd) { - if (HFI1_CAP_IS_KSET(QSFP_ENABLED)) { - struct hfi1_devdata *dd = ppd->dd; - u64 reg; + struct hfi1_devdata *dd = ppd->dd; + u64 reg; - reg = read_csr(dd, - dd->hfi1_id ? ASIC_QSFP2_IN : ASIC_QSFP1_IN); - return !(reg & QSFP_HFI0_MODPRST_N); - } - /* always return cable present */ - return 1; + reg = read_csr(dd, dd->hfi1_id ? ASIC_QSFP2_IN : ASIC_QSFP1_IN); + return !(reg & QSFP_HFI0_MODPRST_N); } /* diff --git a/include/uapi/rdma/hfi/hfi1_user.h b/include/uapi/rdma/hfi/hfi1_user.h index 78c442fbf263..599562fe5d57 100644 --- a/include/uapi/rdma/hfi/hfi1_user.h +++ b/include/uapi/rdma/hfi/hfi1_user.h @@ -88,7 +88,7 @@ #define HFI1_CAP_SDMA_AHG (1UL << 2) /* Enable SDMA AHG support */ #define HFI1_CAP_EXTENDED_PSN (1UL << 3) /* Enable Extended PSN support */ #define HFI1_CAP_HDRSUPP (1UL << 4) /* Enable Header Suppression */ -/* 1UL << 5 reserved */ +/* 1UL << 5 unused */ #define HFI1_CAP_USE_SDMA_HEAD (1UL << 6) /* DMA Hdr Q tail vs. use CSR */ #define HFI1_CAP_MULTI_PKT_EGR (1UL << 7) /* Enable multi-packet Egr buffs*/ #define HFI1_CAP_NODROP_RHQ_FULL (1UL << 8) /* Don't drop on Hdr Q full */ @@ -99,7 +99,7 @@ #define HFI1_CAP_NO_INTEGRITY (1UL << 13) /* Enable ctxt integrity checks */ #define HFI1_CAP_PKEY_CHECK (1UL << 14) /* Enable ctxt PKey checking */ #define HFI1_CAP_STATIC_RATE_CTRL (1UL << 15) /* Allow PBC.StaticRateControl */ -#define HFI1_CAP_QSFP_ENABLED (1UL << 16) /* Enable QSFP check during LNI */ +/* 1UL << 16 unused */ #define HFI1_CAP_SDMA_HEAD_CHECK (1UL << 17) /* SDMA head checking */ #define HFI1_CAP_EARLY_CREDIT_RETURN (1UL << 18) /* early credit return */ -- cgit v1.2.3