From patchwork Tue Feb 18 03:42:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11387811 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 E4B68109A for ; Tue, 18 Feb 2020 03:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C55A82176D for ; Tue, 18 Feb 2020 03:42:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="K+z31Vhp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726257AbgBRDmy (ORCPT ); Mon, 17 Feb 2020 22:42:54 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40940 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbgBRDmy (ORCPT ); Mon, 17 Feb 2020 22:42:54 -0500 Received: by mail-wr1-f67.google.com with SMTP id t3so22133576wru.7 for ; Mon, 17 Feb 2020 19:42:51 -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=FAyMMJJFqtuiatOJlm6veeC6oPjCFs/ISVKyLad61wc=; b=K+z31VhpA0QTsUc1K0nGHfQ9frgbQ8Rmew8lclFozJc2qzAlcEBDuRG81lnzwaIiOb ZrfJ89vtx/BBIS+KmMbaqEk/QroyPH95D9RQlJffhXPiiA/zDYma58USNfybBiDO/tzi N5ji2KtVV1oHFakw/u2m+7YMbxkg+pDGwUFtU= 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=FAyMMJJFqtuiatOJlm6veeC6oPjCFs/ISVKyLad61wc=; b=l8WUdfnjYtX1dLtm8rShRHrTFJt6FlB7M63bxT51xLy6Wyn7Ue9XZxwPHU8h/6ZmLO VVFUYqMkeqV3/aPrUd81c5KWJ7wXmRt1UjV1modZ2NUBUx3a/A03/cXES3IuTTSuCPMz Hg0AkkhlN7NJQF7hJSZuOJB9GkA3LqPBUmFVIGBBizVuvBubfahrfHUbb/3/tfKZkicy 8FlGqB2rYozntifrH8uLE6qda5oX1ib7T+LWyYDSvokmbmQ1MzRaemai0V+vcrHJiCdS +Fkn7FiWoMwM1qRUi5qhP2yBZoXl00gHg2V52Qrdt6NuOVpJliFdTE9uVFO2NxxRbqZo uADQ== X-Gm-Message-State: APjAAAW1lr6t1oCNdK6kqPnVni+MsucMrjZd6ZUjtstmVz349j0hD+fF gy2PDgPQtHt/oFh0kpXwJgRe28wIDJCwfeVV X-Google-Smtp-Source: APXvYqyYNny/5OOKGi+IjKcMWkjetX6STt68EDMnpSFAk0bOeD5A5G+XusxHNYlLA0oF3AjqXJEuAA== X-Received: by 2002:adf:e8c9:: with SMTP id k9mr26209989wrn.168.1581997370959; Mon, 17 Feb 2020 19:42:50 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-213.vpn.ipredator.se. [46.246.49.213]) by smtp.gmail.com with ESMTPSA id s22sm1816901wmh.4.2020.02.17.19.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 19:42:50 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay Subject: [PATCH v7 1/3] iio: chemical: atlas-sensor: allow probe without interrupt line Date: Mon, 17 Feb 2020 19:42:37 -0800 Message-Id: <20200218034239.135619-2-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200218034239.135619-1-matt.ranostay@konsulko.com> References: <20200218034239.135619-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 | 33 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 2f0a6fed2589..d95818b74770 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -76,6 +76,7 @@ struct atlas_data { struct atlas_device *chip; struct regmap *regmap; struct irq_work work; + unsigned int interrupt_enabled; __be32 buffer[6]; /* 96-bit data + 32-bit pad + 64-bit timestamp */ }; @@ -304,6 +305,9 @@ static int atlas_set_powermode(struct atlas_data *data, int on) static int atlas_set_interrupt(struct atlas_data *data, bool state) { + if (!data->interrupt_enabled) + return 0; + return regmap_update_bits(data->regmap, ATLAS_REG_INT_CONTROL, ATLAS_REG_INT_CONTROL_EN, state ? ATLAS_REG_INT_CONTROL_EN : 0); @@ -572,11 +576,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 +595,20 @@ 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); + else + data->interrupt_enabled = 1; } ret = atlas_set_powermode(data, 1); From patchwork Tue Feb 18 03:42:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11387813 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 A12141395 for ; Tue, 18 Feb 2020 03:42:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81E3A20836 for ; Tue, 18 Feb 2020 03:42:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="r6cHQ/WJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbgBRDm5 (ORCPT ); Mon, 17 Feb 2020 22:42:57 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39067 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbgBRDm5 (ORCPT ); Mon, 17 Feb 2020 22:42:57 -0500 Received: by mail-wr1-f68.google.com with SMTP id y11so22121472wrt.6 for ; Mon, 17 Feb 2020 19:42:53 -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=B+r5+hfAE/Awbo6XNd+zhGvtwDw2C94kbs2Y5SVU2+8=; b=r6cHQ/WJSUUor1OynauuikEfFtk6Nm7CGvrlgeEBWcP7V/qaVklQbGFVUwyvr0Lk+V l/mihMSwCr0WtSGffzX9jxF7Hlr6VfEnysXpkNsZeDBNLAW5/rMdu8abFNl2cEXy5FHN OdcKTX0eU9s1U2Ed0kOvceQtZYVVqchOpxITc= 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=B+r5+hfAE/Awbo6XNd+zhGvtwDw2C94kbs2Y5SVU2+8=; b=HE7N15UpPavxO4l6a7l3Qs6pmHpWNX5Sa6QDuBST5UWbN1ahvQyWHFk5rpHPeKGP5f oLX3PgI443d1AL2knvijn70D2oJZKBW1pccATPaunl994jrpzctHtlY32DUIeJRk8J1A QuAYj9yYVc4+qycn5jFLPMNlXyCEw6I96+rHHzw62emBq6mtDNBhqD23l77ZOdnHWXBg KSkSYskyHUYokK7PAauE+FAYLMZujN8MW1ZXVHHVScx6ZULWfpdPRnkSDDjlfHO42Xjs EfryYTCu+i6vqnbd5ZKAJMiMnnxCH2c3ujqqNAnH81wnqdxWX5Us30YNGAPLDIQb0v1O qFog== X-Gm-Message-State: APjAAAV/RQ1FyZ894HIJgAQAqa+TJg4IFtHdMRHzCWGlRthmQLDdHrXb aYtJmkCQIeBi+YUjg/cy3WdkFHbjkwa5X+ch X-Google-Smtp-Source: APXvYqzpLS6F9fbSUbTyRC8ej9Ch3ZuVuP2mFFMYixmAKijc+bposck5rob0qaOT/G5xN8sPMeKUOw== X-Received: by 2002:adf:f54d:: with SMTP id j13mr25764403wrp.19.1581997373060; Mon, 17 Feb 2020 19:42:53 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-213.vpn.ipredator.se. [46.246.49.213]) by smtp.gmail.com with ESMTPSA id s22sm1816901wmh.4.2020.02.17.19.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 19:42:52 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay Subject: [PATCH v7 2/3] iio: chemical: atlas-sensor: add DO-SM module support Date: Mon, 17 Feb 2020 19:42:38 -0800 Message-Id: <20200218034239.135619-3-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200218034239.135619-1-matt.ranostay@konsulko.com> References: <20200218034239.135619-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 directly 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 d95818b74770..82d470561ad3 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 { @@ -122,7 +132,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, \ @@ -153,8 +163,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, @@ -183,6 +193,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; @@ -263,7 +286,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; @@ -296,6 +343,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) @@ -511,6 +565,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); @@ -519,6 +574,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 Tue Feb 18 03:42:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 11387815 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 A089E1395 for ; Tue, 18 Feb 2020 03:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7931520836 for ; Tue, 18 Feb 2020 03:43:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=konsulko.com header.i=@konsulko.com header.b="ihYdnOQT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbgBRDnA (ORCPT ); Mon, 17 Feb 2020 22:43:00 -0500 Received: from mail-wm1-f52.google.com ([209.85.128.52]:53002 "EHLO mail-wm1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbgBRDnA (ORCPT ); Mon, 17 Feb 2020 22:43:00 -0500 Received: by mail-wm1-f52.google.com with SMTP id p9so1286571wmc.2 for ; Mon, 17 Feb 2020 19:42:56 -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=yjL8iTn4/cjQGFH5hZGo9k1hNnc6kDqKI1DkYfGTOis=; b=ihYdnOQTYbfBPceQLYwzC5A3iEbPh0JGVL7RFfAHBviLXYsKpdOGXY9bUrfR659SHC gnl04lHKdo51rOs890gv4B2KVggzep+6lZ/ySGX2sfC8v7FgBoUsXaHi7uH0uDxQoUYs MDzOFuP1L4eJlBKNoBLoP3JShoUaH18vvzXxU= 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=yjL8iTn4/cjQGFH5hZGo9k1hNnc6kDqKI1DkYfGTOis=; b=WEFdsSSp24gBAo97KRFloNE0KzCkJFB7nF0xObMSgstxeevdr+ZbuJ+TgclXSwFoD/ ussj7bn3Wr+NA2ZtwOBTCN3L5midtbWbgga8LwzMSLhTUKRk5O/sXXcYhNDtjVt7SswC Q4kBigyMTdi8pOh7ty0z3OeJltHkrlxmE3kHfOwNjHJALqJxipjw5IxaCGL+giDnYx+F J1v9kIKyL7QjhxsuwciCAct196W45LSivHkJ5nFB1IzzSHyBCb0EtoaUWZ5670bsNKR0 Oj/qTx6yWU73IT5/2UzDpLwVGQBpS0Vo6TeJGfaoeazUqzqslDb7InnYYU/Y/p5gWkvS blrA== X-Gm-Message-State: APjAAAX76djHpJwanbIZMO3q9/0vBWWYohZw2eYayR4x4Agw919e3iOP fUFBXgRdm95lm10GOQS7FkbAvGetB+xrvr7B X-Google-Smtp-Source: APXvYqxQLe/PsjykvFusq0zv6XRKgmbr5YiG3Jc2a2+vQ74F1uOlM5loyptdOU9mxMGTcsRdeQwPmw== X-Received: by 2002:a1c:1dc7:: with SMTP id d190mr228168wmd.48.1581997375429; Mon, 17 Feb 2020 19:42:55 -0800 (PST) Received: from virtualbox.ipredator.se (anon-49-213.vpn.ipredator.se. [46.246.49.213]) by smtp.gmail.com with ESMTPSA id s22sm1816901wmh.4.2020.02.17.19.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 19:42:55 -0800 (PST) From: Matt Ranostay To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, Matt Ranostay , Rob Herring Subject: [PATCH v7 3/3] dt-bindings: iio: chemical: consolidate atlas-sensor docs Date: Mon, 17 Feb 2020 19:42:39 -0800 Message-Id: <20200218034239.135619-4-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200218034239.135619-1-matt.ranostay@konsulko.com> References: <20200218034239.135619-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..edcd2904d50e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/chemical/atlas,sensor.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%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>; + }; + };