From patchwork Fri Feb 7 05:18:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11369769 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 32046138D for ; Fri, 7 Feb 2020 05:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11A9A227BF for ; Fri, 7 Feb 2020 05:19:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="TNBgClU/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725851AbgBGFTT (ORCPT ); Fri, 7 Feb 2020 00:19:19 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42712 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgBGFTT (ORCPT ); Fri, 7 Feb 2020 00:19:19 -0500 Received: by mail-lf1-f68.google.com with SMTP id y19so661689lfl.9 for ; Thu, 06 Feb 2020 21:19:18 -0800 (PST) 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=ii4wIS6vHPPoGZVYhklzWw2qKWXLEXB4s7/of/M2k0Q=; b=TNBgClU/pqC4gO7XJFO5mndYKnDbNrDjWoMVHIM09Aq87HFynT46ofTsLPB/AL5fXC USxeJgzXLPPa3ykhpbSNtoFl3BWtIeSd/Ba4h34UtWlxS9VBWJFNUuRd2h/nUeafxo5o 9UWKYAZIfVW8C0t9HO66JBrqwlUeykwX5hS+8= 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=ii4wIS6vHPPoGZVYhklzWw2qKWXLEXB4s7/of/M2k0Q=; b=gqFMhM0A0d3+gSB3FCEuq5u+rzi3i/ztGHdD5KZyNs2tUXt90vXNcNh1b+1if+EXut D4H1iWOanMhgCS76NvK776k6NRa0+s4zSPD3wr75rtwpxmMCn9bHEKkUge19LqEHyd0X EU4tI9ABlz5C/PUVLYdZXPZ0rhjC+LxahH9V2pXNubScNAKOBNt5adkDCx4g+2Cu1L0j mOpjdKw5td/0PAwT+bNsSsDLbhcXh4HwbCXBsk5mncbHSoU0KFYFLpEejyKVORfOa5GY VOC3Q59eOIkWgX2PVyQj4aPN7NsM1MtfKaYluZqUHe3saPsL6Y96O0xtORVXGzQmpQHO Ivaw== X-Gm-Message-State: APjAAAW7I47TGrcXyzuup7cBvw3fllOIZtrlfTGUbYiXK2Q8YKd5QJ00 8q4SviRJqyxeaboI3A2u/k2sornpZxVUqRW4 X-Google-Smtp-Source: APXvYqy05vfWwAOjlOHbt19NJ0elVAt3Qyd0HHY9hxZVjcvWOu+0N+6XRguP6cNAX9I2aBKo+N0mIQ== X-Received: by 2002:ac2:5626:: with SMTP id b6mr3601792lff.134.1581052756973; Thu, 06 Feb 2020 21:19:16 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-167.vpn.ipredator.se. [46.246.49.167]) by smtp.gmail.com with ESMTPSA id y11sm622069lfc.27.2020.02.06.21.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 21:19:16 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay Subject: [PATCH v5 1/3] iio: chemical: atlas-sensor: allow probe without interrupt line Date: Thu, 6 Feb 2020 21:18:11 -0800 Message-Id: <20200207051813.9708-2-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200207051813.9708-1-matt.ranostay@konsulko.com> References: <20200207051813.9708-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 Sensors don't actually need a interrupt line to give valid readings, and can triggered with CONFIG_IIO_HRTIMER_TRIGGER as well. Remove the required check for interrupt, and continue along in the probe function. Signed-off-by: Matt Ranostay --- drivers/iio/chemical/atlas-sensor.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 2f0a6fed2589..9a1ab9f8fcc5 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -572,11 +572,6 @@ static int atlas_probe(struct i2c_client *client, if (ret) return ret; - if (client->irq <= 0) { - dev_err(&client->dev, "no valid irq defined\n"); - return -EINVAL; - } - ret = chip->calibration(data); if (ret) return ret; @@ -596,16 +591,18 @@ static int atlas_probe(struct i2c_client *client, init_irq_work(&data->work, atlas_work_handler); - /* interrupt pin toggles on new conversion */ - ret = devm_request_threaded_irq(&client->dev, client->irq, - NULL, atlas_interrupt_handler, - IRQF_TRIGGER_RISING | - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - "atlas_irq", - indio_dev); - if (ret) { - dev_err(&client->dev, "request irq (%d) failed\n", client->irq); - goto unregister_buffer; + if (client->irq > 0) { + /* interrupt pin toggles on new conversion */ + ret = devm_request_threaded_irq(&client->dev, client->irq, + NULL, atlas_interrupt_handler, + IRQF_TRIGGER_RISING | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, + "atlas_irq", + indio_dev); + + if (ret) + dev_warn(&client->dev, + "request irq (%d) failed\n", client->irq); } ret = atlas_set_powermode(data, 1); From patchwork Fri Feb 7 05:18:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11369771 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 DD32D1395 for ; Fri, 7 Feb 2020 05:19:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD5F92253D for ; Fri, 7 Feb 2020 05:19:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="cMDyQ3zq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726148AbgBGFTW (ORCPT ); Fri, 7 Feb 2020 00:19:22 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40575 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgBGFTW (ORCPT ); Fri, 7 Feb 2020 00:19:22 -0500 Received: by mail-lj1-f194.google.com with SMTP id n18so727702ljo.7 for ; Thu, 06 Feb 2020 21:19:20 -0800 (PST) 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=hYLqjqxp2WriLCHTtIInz9lfFRLbMbwUIA6ukkai2uI=; b=cMDyQ3zq3ITLKHST7m7BhtFd0+BI+6FW4ucC6/3uV8lpgNC3FEGLSQVSIB6dSvcjmA TBsQYGNlnrJaPnbV2Esvpfbfw2BICGaa1B8stfgBnXnIcwsvlaWhOSU+JlR+jdQRBgOd 7iI19GfvKoGCLZn4DwZ6jPVH6Xtqy4sr1/Nts= 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=hYLqjqxp2WriLCHTtIInz9lfFRLbMbwUIA6ukkai2uI=; b=p2TR2zbytS+SD+YNZUtu5O28rFI58D/al2Lo9J7PvVfiplwN8SLPJXeRzDyAnd44zA Md8NeRuMld/8fL79e5wPDrqlSY/AAhkZDkO9wSPv2OADpbW8ZJuINW9Iu8mgScc2sTfq a8S1mgaXHj6ntuY/6oSpwu3POqTfYStxn1p2RlZqj/t3jW94L+xW6Hj/o24TyXxrpkZg 2LW/5wABvd4jg7c+lcn6/Uf0QETvrEwkIqw+VdVFWUvTeSG+U4EW88Hk8G4AFoY3Hdb2 Lcsm5UX2Sx7xWZ/9p30qXD+PpHFYooRbPgE8hcAbtV5nm3ilLNZ5uaqnY3f9EduuAk6+ TILA== X-Gm-Message-State: APjAAAUEMEgbQeAZwH5kw0SnCrtbFby7XC7j959yTA2oKMvyagkJsibL PBUxir+9vXJhn+MrbjUOT0qGkwyBd5jcfnKm X-Google-Smtp-Source: APXvYqw4KV6U1/1jgf47JXU+LXxVVd8FBiPbygZTBbIvm/FPQKIwCN+0QZDhqD5JnrEBAdtvvUkaIA== X-Received: by 2002:a2e:9207:: with SMTP id k7mr4191997ljg.175.1581052759263; Thu, 06 Feb 2020 21:19:19 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-167.vpn.ipredator.se. [46.246.49.167]) by smtp.gmail.com with ESMTPSA id y11sm622069lfc.27.2020.02.06.21.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 21:19:18 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay Subject: [PATCH v5 2/3] iio: chemical: atlas-sensor: add DO-SM module support Date: Thu, 6 Feb 2020 21:18:12 -0800 Message-Id: <20200207051813.9708-3-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200207051813.9708-1-matt.ranostay@konsulko.com> References: <20200207051813.9708-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 DO-SM OEM sensor reads disolved oxygen in a solution. This is reported back as mg/L which maps direc to ppm and so the IIO_CONCENTRATION channel type can be used. Signed-off-by: Matt Ranostay --- drivers/iio/chemical/atlas-sensor.c | 64 +++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 9a1ab9f8fcc5..363b33f3f43b 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -48,6 +48,11 @@ #define ATLAS_REG_EC_CALIB_STATUS_LOW BIT(2) #define ATLAS_REG_EC_CALIB_STATUS_HIGH BIT(3) +#define ATLAS_REG_DO_CALIB_STATUS 0x09 +#define ATLAS_REG_DO_CALIB_STATUS_MASK 0x03 +#define ATLAS_REG_DO_CALIB_STATUS_PRESSURE BIT(0) +#define ATLAS_REG_DO_CALIB_STATUS_DO BIT(1) + #define ATLAS_REG_PH_TEMP_DATA 0x0e #define ATLAS_REG_PH_DATA 0x16 @@ -60,14 +65,19 @@ #define ATLAS_REG_ORP_CALIB_STATUS 0x0d #define ATLAS_REG_ORP_DATA 0x0e +#define ATLAS_REG_DO_TEMP_DATA 0x12 +#define ATLAS_REG_DO_DATA 0x22 + #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 enum { ATLAS_PH_SM, ATLAS_EC_SM, ATLAS_ORP_SM, + ATLAS_DO_SM, }; struct atlas_data { @@ -121,7 +131,7 @@ static const struct iio_chan_spec atlas_ph_channels[] = { }, }; -#define ATLAS_EC_CHANNEL(_idx, _addr) \ +#define ATLAS_CONCENTRATION_CHANNEL(_idx, _addr) \ {\ .type = IIO_CONCENTRATION, \ .indexed = 1, \ @@ -152,8 +162,8 @@ static const struct iio_chan_spec atlas_ec_channels[] = { .endianness = IIO_BE, }, }, - ATLAS_EC_CHANNEL(0, ATLAS_REG_TDS_DATA), - ATLAS_EC_CHANNEL(1, ATLAS_REG_PSS_DATA), + ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_TDS_DATA), + ATLAS_CONCENTRATION_CHANNEL(1, ATLAS_REG_PSS_DATA), IIO_CHAN_SOFT_TIMESTAMP(3), { .type = IIO_TEMP, @@ -182,6 +192,19 @@ static const struct iio_chan_spec atlas_orp_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(1), }; +static const struct iio_chan_spec atlas_do_channels[] = { + ATLAS_CONCENTRATION_CHANNEL(0, ATLAS_REG_DO_DATA), + IIO_CHAN_SOFT_TIMESTAMP(1), + { + .type = IIO_TEMP, + .address = ATLAS_REG_DO_TEMP_DATA, + .info_mask_separate = + BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), + .output = 1, + .scan_index = -1 + }, +}; + static int atlas_check_ph_calibration(struct atlas_data *data) { struct device *dev = &data->client->dev; @@ -262,7 +285,31 @@ static int atlas_check_orp_calibration(struct atlas_data *data) dev_warn(dev, "device has not been calibrated\n"); return 0; -}; +} + +static int atlas_check_do_calibration(struct atlas_data *data) +{ + struct device *dev = &data->client->dev; + int ret; + unsigned int val; + + ret = regmap_read(data->regmap, ATLAS_REG_DO_CALIB_STATUS, &val); + if (ret) + return ret; + + if (!(val & ATLAS_REG_DO_CALIB_STATUS_MASK)) { + dev_warn(dev, "device has not been calibrated\n"); + return 0; + } + + if (!(val & ATLAS_REG_DO_CALIB_STATUS_PRESSURE)) + dev_warn(dev, "device missing atmospheric pressure calibration\n"); + + if (!(val & ATLAS_REG_DO_CALIB_STATUS_DO)) + dev_warn(dev, "device missing dissolved oxygen calibration\n"); + + return 0; +} struct atlas_device { const struct iio_chan_spec *channels; @@ -295,6 +342,13 @@ static struct atlas_device atlas_devices[] = { .calibration = &atlas_check_orp_calibration, .delay = ATLAS_ORP_INT_TIME_IN_MS, }, + [ATLAS_DO_SM] = { + .channels = atlas_do_channels, + .num_channels = 3, + .data_reg = ATLAS_REG_DO_DATA, + .calibration = &atlas_check_do_calibration, + .delay = ATLAS_DO_INT_TIME_IN_MS, + }, }; static int atlas_set_powermode(struct atlas_data *data, int on) @@ -507,6 +561,7 @@ static const struct i2c_device_id atlas_id[] = { { "atlas-ph-sm", ATLAS_PH_SM}, { "atlas-ec-sm", ATLAS_EC_SM}, { "atlas-orp-sm", ATLAS_ORP_SM}, + { "atlas-do-sm", ATLAS_DO_SM}, {} }; MODULE_DEVICE_TABLE(i2c, atlas_id); @@ -515,6 +570,7 @@ static const struct of_device_id atlas_dt_ids[] = { { .compatible = "atlas,ph-sm", .data = (void *)ATLAS_PH_SM, }, { .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, }, { } }; MODULE_DEVICE_TABLE(of, atlas_dt_ids); From patchwork Fri Feb 7 05:18:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11369773 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 C61AB1395 for ; Fri, 7 Feb 2020 05:19:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BC8122522 for ; Fri, 7 Feb 2020 05:19:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="kR8L46Ff" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbgBGFTZ (ORCPT ); Fri, 7 Feb 2020 00:19:25 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:37398 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgBGFTZ (ORCPT ); Fri, 7 Feb 2020 00:19:25 -0500 Received: by mail-lj1-f180.google.com with SMTP id v17so741218ljg.4 for ; Thu, 06 Feb 2020 21:19:23 -0800 (PST) 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=Vo63BAjL+VzKnOnFgPIrKXrUzcWsA/h/8OtoT4tRTTg=; b=kR8L46FfIVfZSNdSuAWYKA4/QDhs0A/RCF7YETjviyVQcYs5jmu8VxCUrmwm/uw/iO YLM4aB6ZCaYGWSCLH6Gcky419yGJEN+8KVLn8T2z1YfRYcHC9aYb55DmRvDZriTc7mHa brCKEeKaUGDB1twRmsuEUzYwyCPi7VlL22DWM= 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=Vo63BAjL+VzKnOnFgPIrKXrUzcWsA/h/8OtoT4tRTTg=; b=Sk15puAlAM8QRsmepsANmZfUri/pCFGGdI+1/1x3PdGRo5m72xbaKOUfW0UgVxqBXc kh8JMtNZuVqglvpDlhdcxiQrvPEzG2CXQRGF+mig+UZaCLCq7yOmF3WM0cnEmB9C/JmK G1ts4V8hc/zsfBrnJqyAlMjBwKw4Ytgy32TWQ8zE4f3USJz8mVW2eNGQ3s0xgqtQS3DT wofHSYy/lw+LVdiaz7nCBLkVWfbDG7HLxJ+OlZobLm6vaa+fxSP/nL7yIjh6je9ROrYC aMYSoFxjMX/AnoOTKyU6EzMULxSzbqW/WMKSl09MQSW9A/fQr2fgYit2cYSegeQqpZsy 81UQ== X-Gm-Message-State: APjAAAWWh8lCIvUyeETIF7fmFtNxW11hKjI72JDA32pHj3AmEFVKQM+I h/stU0/2+f4iDZkTIlHBVmbDCv7HGINJtysW X-Google-Smtp-Source: APXvYqzNOFR3HGKSK362KiDQyNMOvNOu0pP9yFbEcI5rT7ZKZt6Gq5cc7ZhuZHxDUM8+MEvtaVOyNA== X-Received: by 2002:a2e:6f19:: with SMTP id k25mr4176626ljc.84.1581052761889; Thu, 06 Feb 2020 21:19:21 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-167.vpn.ipredator.se. [46.246.49.167]) by smtp.gmail.com with ESMTPSA id y11sm622069lfc.27.2020.02.06.21.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 21:19:21 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay , Rob Herring Subject: [PATCH v5 3/3] dt-bindings: iio: chemical: consolidate atlas-sensor docs Date: Thu, 6 Feb 2020 21:18:13 -0800 Message-Id: <20200207051813.9708-4-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200207051813.9708-1-matt.ranostay@konsulko.com> References: <20200207051813.9708-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 Since Atlas Scientific device support only varies from the compatible string is ideal all the respective docs are merged into a single doc named atlas,sensor.yaml Reviewed-by: Rob Herring Signed-off-by: Matt Ranostay --- .../bindings/iio/chemical/atlas,ec-sm.txt | 21 -------- .../bindings/iio/chemical/atlas,orp-sm.txt | 21 -------- .../bindings/iio/chemical/atlas,ph-sm.txt | 21 -------- .../bindings/iio/chemical/atlas,sensor.yaml | 53 +++++++++++++++++++ 4 files changed, 53 insertions(+), 63 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/chemical/atlas,ec-sm.txt delete mode 100644 Documentation/devicetree/bindings/iio/chemical/atlas,orp-sm.txt delete mode 100644 Documentation/devicetree/bindings/iio/chemical/atlas,ph-sm.txt create mode 100644 Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml diff --git a/Documentation/devicetree/bindings/iio/chemical/atlas,ec-sm.txt b/Documentation/devicetree/bindings/iio/chemical/atlas,ec-sm.txt deleted file mode 100644 index f4320595b851..000000000000 --- a/Documentation/devicetree/bindings/iio/chemical/atlas,ec-sm.txt +++ /dev/null @@ -1,21 +0,0 @@ -* Atlas Scientific EC-SM OEM sensor - -http://www.atlas-scientific.com/_files/_datasheets/_oem/EC_oem_datasheet.pdf - -Required properties: - - - compatible: must be "atlas,ec-sm" - - reg: the I2C address of the sensor - - interrupts: the sole interrupt generated by the device - - Refer to interrupt-controller/interrupts.txt for generic interrupt client - node bindings. - -Example: - -atlas@64 { - compatible = "atlas,ec-sm"; - reg = <0x64>; - interrupt-parent = <&gpio1>; - interrupts = <16 2>; -}; diff --git a/Documentation/devicetree/bindings/iio/chemical/atlas,orp-sm.txt b/Documentation/devicetree/bindings/iio/chemical/atlas,orp-sm.txt deleted file mode 100644 index af1f5a9aa4da..000000000000 --- a/Documentation/devicetree/bindings/iio/chemical/atlas,orp-sm.txt +++ /dev/null @@ -1,21 +0,0 @@ -* Atlas Scientific ORP-SM OEM sensor - -https://www.atlas-scientific.com/_files/_datasheets/_oem/ORP_oem_datasheet.pdf - -Required properties: - - - compatible: must be "atlas,orp-sm" - - reg: the I2C address of the sensor - - interrupts: the sole interrupt generated by the device - - Refer to interrupt-controller/interrupts.txt for generic interrupt client - node bindings. - -Example: - -atlas@66 { - compatible = "atlas,orp-sm"; - reg = <0x66>; - interrupt-parent = <&gpio1>; - interrupts = <16 2>; -}; diff --git a/Documentation/devicetree/bindings/iio/chemical/atlas,ph-sm.txt b/Documentation/devicetree/bindings/iio/chemical/atlas,ph-sm.txt deleted file mode 100644 index 79d90f060327..000000000000 --- a/Documentation/devicetree/bindings/iio/chemical/atlas,ph-sm.txt +++ /dev/null @@ -1,21 +0,0 @@ -* Atlas Scientific pH-SM OEM sensor - -http://www.atlas-scientific.com/_files/_datasheets/_oem/pH_oem_datasheet.pdf - -Required properties: - - - compatible: must be "atlas,ph-sm" - - reg: the I2C address of the sensor - - interrupts: the sole interrupt generated by the device - - Refer to interrupt-controller/interrupts.txt for generic interrupt client - node bindings. - -Example: - -atlas@65 { - compatible = "atlas,ph-sm"; - reg = <0x65>; - interrupt-parent = <&gpio1>; - interrupts = <16 2>; -}; diff --git a/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml b/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml new file mode 100644 index 000000000000..1b0c476838d1 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/chemical/atlas,sensor.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atlas Scientific OEM sensors + +maintainers: + - Matt Ranostay + +description: | + Atlas Scientific OEM sensors connected via I2C + + Datasheets: + http://www.atlas-scientific.com/_files/_datasheets/_oem/DO_oem_datasheet.pdf + 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 + +properties: + compatible: + enum: + - atlas,do-sm + - atlas,ec-sm + - atlas,orp-sm + - atlas,ph-sm + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + atlas@66 { + compatible = "atlas,orp-sm"; + reg = <0x66>; + interrupt-parent = <&gpio1>; + interrupts = <16 2>; + }; + };