Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1435734ybg; Tue, 2 Jun 2020 09:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlrqhsldqLAiSZhwFo3y94mzDqT+plmUZIxxIZeP6Mt7l0uOYj64Pg2WT1B7tTPRAyzEG8 X-Received: by 2002:a05:6402:417:: with SMTP id q23mr27671825edv.139.1591116731713; Tue, 02 Jun 2020 09:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591116731; cv=none; d=google.com; s=arc-20160816; b=OZ0x1sCEh2Qn6SaFSUN7MGbPNbp6vwkQztYX0iduakphwraKEa69bVAA/3pdvXufn3 swMCK4Vsu9T52bFWzoHqqqlnk7gBBoio4UZCiqQQ02IS3GuR6ISH9MohljedrW+SPq3t vDk5c5NDRgLaDBlcs+huyK7nYPylO8VJbAG50dOHHT3AdX+WRmWiOZsVpW6tAEoaF7rt SK36BkTLb3Qf3YFz36Nws1I/+hjw1SrPNbePjqT05/gIWtLCbl9o1o3wkLwXHpi63s6c T+9j1IZiQloReTrnfNvFHhT5FStGqieW5sdziSZuiGJQ2mxG03zxiVRtfz9s1S47s2Ju M+MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LFVhTES65cWTjny9rjGslq15OqgBxVYI4/YTWlGiOdk=; b=QkFKP192XNvfovhvgGXHQ+avLELtsNcCF6LmYLWGwyUu2lrH/VOpO3cUsqVqKOdv0X KeAXIrjmwH18ieCDUr3cbZ3S2sVSzl/X2jRClIaFeFLCOSGFLm3dUBBm8D42Y4WBE0YW 8WaOUffI8+cOtRC5O9DGN2Z4wi1vAL/fwn0JIwUufVnnkp2ZwOB7a4BhPAOtiQ7qgvfn 8/TCA/yVeV6tRpPFVyOiSzrAQSwjK4SB9YX7dT5GZjU2NqRNbeY8Dkp1AKNDGdUtsTz+ iPF7kdskX6LPEz1ZNYVmgWnSp8pvtE0YpL1m+VLR+MU2nvHfd4iFfaM5md8bmZsvb9NJ ii4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si796696edw.46.2020.06.02.09.51.48; Tue, 02 Jun 2020 09:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbgFBQt4 (ORCPT + 99 others); Tue, 2 Jun 2020 12:49:56 -0400 Received: from smtpout1.mo528.mail-out.ovh.net ([46.105.34.251]:39171 "EHLO smtpout1.mo528.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgFBQt4 (ORCPT ); Tue, 2 Jun 2020 12:49:56 -0400 Received: from pro2.mail.ovh.net (unknown [10.109.156.120]) by mo528.mail-out.ovh.net (Postfix) with ESMTPS id 27740607D9B2; Tue, 2 Jun 2020 18:49:53 +0200 (CEST) Received: from localhost.localdomain (34.103.240.103) by DAG2EX1.emp2.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1847.3; Tue, 2 Jun 2020 18:49:52 +0200 From: Tomasz Duszynski To: CC: , , , , , , Tomasz Duszynski Subject: [PATCH v3 0/4] Add support for SCD30 sensor Date: Tue, 2 Jun 2020 18:47:19 +0200 Message-ID: <20200602164723.28858-1-tomasz.duszynski@octakon.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [34.103.240.103] X-ClientProxiedBy: DAG1EX1.emp2.local (172.16.2.1) To DAG2EX1.emp2.local (172.16.2.11) X-Ovh-Tracer-Id: 9453337095702141975 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrudefjedgjeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkofgggfgtihesthekredtredttdenucfhrhhomhepvfhomhgrshiiucffuhhsiiihnhhskhhiuceothhomhgrshiirdguuhhsiiihnhhskhhisehotghtrghkohhnrdgtohhmqeenucggtffrrghtthgvrhhnpeehtdeggfekuddvkeehgeeggffhhfetkeeltedvkedvtdevuedtteeufeeuheeiteenucfkpheptddrtddrtddrtddpfeegrddutdefrddvgedtrddutdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhrohdvrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepthhomhgrshiirdguuhhsiiihnhhskhhisehotghtrghkohhnrdgtohhmpdhrtghpthhtohepphhmvggvrhifsehpmhgvvghrfidrnhgvth Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following series adds support for Sensirion SCD30 sensor module capable of measuring carbon dioxide, temperature and relative humidity. CO2 measurements base on NDIR principle while temperature and relative humidity are measured by the on board SHT31. As for sensor communication, both I2C and serial interfaces are supported. v3: * simplify code by scaling temperature & humidity in _read_meas() * update realbits in scan types * s/adjecent/adjacent * drop IIO_CHAN_INFO_RAW from _write_raw_get_fmt because there's no raw output channel * rework locking in _read_raw * fix endianess problem on BE machine * align timestamp properly before pushing to buffers * explain why interrupt gets disabled after registration * add trigger validation * drop SCALE for temperature and humidity channel as they are processed * register action which stops measuring after starting measurements * spit generic calibration attr into two doing specific things * add comment explaining why priv in struct scd30_state is for * rename node in binding example to co2-sensor v2: * move asm/byteorder.h towards the bottom of include list * make channel address names in enum more specific * add postfixes to defines and extra comments * drop unneeded i2c include from scd30 header * break generic command sending function into specialized options * expose automatic calibration and forced calibration via the same attr * use SAMP_FREQ to set frequency instead of meas_interval attr * use CALISCALE to set pressure compensation instead of pressure_comp attr * use CALIBBIAS to set temperature offset instead of temp_offset attr * fix order in MAINTAINERS * drop attribute allowing one to reset sensor * as we have dt probing drop board file based probing (i2c_device_id) * merge patches touching related files * use fwnode API to retrieve interrupt from dt * fix interrupt-parent spelling * change binding license * drop supply from required property Tomasz Duszynski (4): iio: chemical: scd30: add core driver iio: chemical: scd30: add I2C interface driver iio: chemical: scd30: add serial interface driver dt-bindings: iio: scd30: add device binding file Documentation/ABI/testing/sysfs-bus-iio-scd30 | 34 + .../iio/chemical/sensirion,scd30.yaml | 68 ++ MAINTAINERS | 9 + drivers/iio/chemical/Kconfig | 33 + drivers/iio/chemical/Makefile | 3 + drivers/iio/chemical/scd30.h | 80 ++ drivers/iio/chemical/scd30_core.c | 783 ++++++++++++++++++ drivers/iio/chemical/scd30_i2c.c | 134 +++ drivers/iio/chemical/scd30_serial.c | 266 ++++++ 9 files changed, 1410 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-scd30 create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml create mode 100644 drivers/iio/chemical/scd30.h create mode 100644 drivers/iio/chemical/scd30_core.c create mode 100644 drivers/iio/chemical/scd30_i2c.c create mode 100644 drivers/iio/chemical/scd30_serial.c -- 2.26.2