From patchwork Sun Apr 19 06:05:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11497143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C71F56CA for ; Sun, 19 Apr 2020 06:06:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADED32076A for ; Sun, 19 Apr 2020 06:06:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="VYZRXgtt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725947AbgDSGGD (ORCPT ); Sun, 19 Apr 2020 02:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgDSGGC (ORCPT ); Sun, 19 Apr 2020 02:06:02 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37049C061A0C for ; Sat, 18 Apr 2020 23:06:01 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id g10so4776881lfj.13 for ; Sat, 18 Apr 2020 23:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VX6tMFQF79i/ftypgBXXLpWGwJKO5n2LFJJUQCNDLbI=; b=VYZRXgtt76KAzkGTlkhcYV7C3oZ54V2PNDiye5y4PpD7RY/ZDHqj3Sl6JjfiwKt3K0 aIfHvPz9odBQXH4HcxGad6bp0w4xeCrvoc4CqtBN3G+gcLRAj+Fjvda6OfkjVcs40IQ8 4quT6a+ZnD73s8JhwZAnBlQHZwpQqt/mvnqxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VX6tMFQF79i/ftypgBXXLpWGwJKO5n2LFJJUQCNDLbI=; b=Zt0o9XL9X6Im76mt12iFGR6F1mA4nlB/bAJU3Rf8OWCd6CyiOex8O4BeaJb5xtGg0M OB638mipqwaA99hUzmvymApXoLdGT+FfYvdQYg7Obkm4buRWk87jswlfRooZiN2x9tk8 kumcNzFGvwC8TJiEHNNXu2fa25JMjUzPYylMTTSJcGoX6qRr2xICOoXAtq1M7IG335sC Gvg5JctrHWkHkcrbvHkv4B4TSIYyd7ybvEmGMu3Vkq9nyTavVupGZsjFPKvoIOSvZUHf 8Yy6D8tOHgl2DrEH6ifF8l/Za2r17onanGUpjDNoQhxGSVkiyZVV4MDnSmZNXp9Z6P8H uABw== X-Gm-Message-State: AGi0PuYA5DSwoPSU/ENiLgGhFkqgaNTimrZ3J6ue3FVEdakccV2hcPXk cUCLz7imK4KmG9nIU+0B2AMynQ== X-Google-Smtp-Source: APiQypKamEmLuz1pWmrPKe03nYQbtpKARp5yKm25A3SvjGluCLrG+6Atb/fzGnCrfQBg0xpMFgTChw== X-Received: by 2002:a19:6448:: with SMTP id b8mr3378653lfj.18.1587276359665; Sat, 18 Apr 2020 23:05:59 -0700 (PDT) Received: from taos.konsulko.bg (lan.nucleusys.com. [92.247.61.126]) by smtp.gmail.com with ESMTPSA id o22sm3695002ljj.100.2020.04.18.23.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 23:05:59 -0700 (PDT) From: Matt Ranostay To: jic23@kernel.org Cc: linux-iio@vger.kernel.org, Matt Ranostay , devicetree@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: iio: chemical: add Atlas Scientific RTD-SM sensor docs Date: Sun, 19 Apr 2020 09:05:54 +0300 Message-Id: <20200419060555.14433-2-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200419060555.14433-1-matt.ranostay@konsulko.com> References: <20200419060555.14433-1-matt.ranostay@konsulko.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Matt Ranostay --- .../devicetree/bindings/iio/chemical/atlas,sensor.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml b/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml index edcd2904d50e..0e510a52920d 100644 --- a/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml +++ b/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml @@ -17,6 +17,7 @@ description: | http://www.atlas-scientific.com/_files/_datasheets/_oem/EC_oem_datasheet.pdf http://www.atlas-scientific.com/_files/_datasheets/_oem/ORP_oem_datasheet.pdf http://www.atlas-scientific.com/_files/_datasheets/_oem/pH_oem_datasheet.pdf + http://www.atlas-scientific.com/_files/_datasheets/_oem/RTD_oem_datasheet.pdf properties: compatible: @@ -25,6 +26,7 @@ properties: - atlas,ec-sm - atlas,orp-sm - atlas,ph-sm + - atlas,rtd-sm reg: maxItems: 1 From patchwork Sun Apr 19 06:05:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11497145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 965456CA for ; Sun, 19 Apr 2020 06:06:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C60E22240 for ; Sun, 19 Apr 2020 06:06:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="sCD0UZXn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725953AbgDSGGE (ORCPT ); Sun, 19 Apr 2020 02:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgDSGGD (ORCPT ); Sun, 19 Apr 2020 02:06:03 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD47C061A0F for ; Sat, 18 Apr 2020 23:06:02 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id u10so5210601lfo.8 for ; Sat, 18 Apr 2020 23:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hzGCJW6yBCbOxsB9B/8agb40s1husqLSK8c0gXR5MJQ=; b=sCD0UZXnJag9DMtG2EeWYOJ5sB96JNGDcpuKxkQ9ehvptVfOoLf8a/Kyq/TpXMdMzh oQWwAhhivzj/wgi62lz6yLQlslvCHqR/LqCHv7jUaKXNdt1QWbLOam7ltSNwUZK+WPED AeOaZv55wdlpWWz6iG4KA8wvzVn7GZkWxeSYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hzGCJW6yBCbOxsB9B/8agb40s1husqLSK8c0gXR5MJQ=; b=qqYrnDdwTaTsIhbVj2VISud9X+ApqdYePjwOwA1tuaIbxepaA3oKO0VdJQatvbn0bI 0bL4HA4UvlEzioAb2KZMl2GIAd+rYcDfjFLcePMPueekHCfBVRRbEC8LEZEYkgbBsn5j xX9CQyUNcnX4scFxcZnGAmEfXpqnYtUkUZCmI8HyxL89Cnip2GfXP5tU2hR/a8dIfdqr mqyG9/8UDPiGdz+ZsM2UHW7XRjE/EXp0XJTGoWt1k3FrD6/RFpNxvhrQIhkLD1+3SvUj Kaf/45gG3pqBxybJHO3UOXturlR4LBS9fRjSVJ6RKevC9tlq2bcPw1gwCeqiaKEeedxe f49A== X-Gm-Message-State: AGi0PuYDuO8A5nuxrDww3GUs2dX0tbFpCmELki9tjcnghPkWacCntzop ov9nfF76U7jH7uyPkARA0t7Q9KeFysAjNA== X-Google-Smtp-Source: APiQypLEd5BNcOl3IrZknwejTRCJxsX9uHuMIeTzheaUtO5wQ6TFd0SMdozldWkNaEnhpAjhKf6YnQ== X-Received: by 2002:ac2:58cb:: with SMTP id u11mr6687977lfo.185.1587276360819; Sat, 18 Apr 2020 23:06:00 -0700 (PDT) Received: from taos.konsulko.bg (lan.nucleusys.com. [92.247.61.126]) by smtp.gmail.com with ESMTPSA id o22sm3695002ljj.100.2020.04.18.23.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 23:06:00 -0700 (PDT) From: Matt Ranostay To: jic23@kernel.org Cc: linux-iio@vger.kernel.org, Matt Ranostay Subject: [PATCH v2 2/2] iio: chemical: atlas-sensor: add RTD-SM module support Date: Sun, 19 Apr 2020 09:05:55 +0300 Message-Id: <20200419060555.14433-3-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200419060555.14433-1-matt.ranostay@konsulko.com> References: <20200419060555.14433-1-matt.ranostay@konsulko.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Atlas Scientific RTD-SM OEM sensor reads temperate using resistance temperature detector technology. Signed-off-by: Matt Ranostay --- drivers/iio/chemical/atlas-sensor.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 82d470561ad3..c7ed9004cf82 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -68,16 +68,20 @@ #define ATLAS_REG_DO_TEMP_DATA 0x12 #define ATLAS_REG_DO_DATA 0x22 +#define ATLAS_REG_RTD_DATA 0x0e + #define ATLAS_PH_INT_TIME_IN_MS 450 #define ATLAS_EC_INT_TIME_IN_MS 650 #define ATLAS_ORP_INT_TIME_IN_MS 450 #define ATLAS_DO_INT_TIME_IN_MS 450 +#define ATLAS_RTD_INT_TIME_IN_MS 450 enum { ATLAS_PH_SM, ATLAS_EC_SM, ATLAS_ORP_SM, ATLAS_DO_SM, + ATLAS_RTD_SM, }; struct atlas_data { @@ -206,6 +210,22 @@ static const struct iio_chan_spec atlas_do_channels[] = { }, }; +static const struct iio_chan_spec atlas_rtd_channels[] = { + { + .type = IIO_TEMP, + .address = ATLAS_REG_RTD_DATA, + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = 32, + .storagebits = 32, + .endianness = IIO_BE, + }, + }, + IIO_CHAN_SOFT_TIMESTAMP(1), +}; + static int atlas_check_ph_calibration(struct atlas_data *data) { struct device *dev = &data->client->dev; @@ -350,6 +370,12 @@ static struct atlas_device atlas_devices[] = { .calibration = &atlas_check_do_calibration, .delay = ATLAS_DO_INT_TIME_IN_MS, }, + [ATLAS_RTD_SM] = { + .channels = atlas_rtd_channels, + .num_channels = 2, + .data_reg = ATLAS_REG_RTD_DATA, + .delay = ATLAS_RTD_INT_TIME_IN_MS, + }, }; static int atlas_set_powermode(struct atlas_data *data, int on) @@ -566,6 +592,7 @@ static const struct i2c_device_id atlas_id[] = { { "atlas-ec-sm", ATLAS_EC_SM}, { "atlas-orp-sm", ATLAS_ORP_SM}, { "atlas-do-sm", ATLAS_DO_SM}, + { "atlas-rtd-sm", ATLAS_RTD_SM}, {} }; MODULE_DEVICE_TABLE(i2c, atlas_id); @@ -575,6 +602,7 @@ static const struct of_device_id atlas_dt_ids[] = { { .compatible = "atlas,ec-sm", .data = (void *)ATLAS_EC_SM, }, { .compatible = "atlas,orp-sm", .data = (void *)ATLAS_ORP_SM, }, { .compatible = "atlas,do-sm", .data = (void *)ATLAS_DO_SM, }, + { .compatible = "atlas,rtd-sm", .data = (void *)ATLAS_RTD_SM, }, { } }; MODULE_DEVICE_TABLE(of, atlas_dt_ids);