From patchwork Thu Dec 6 21:04:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 10716763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0D1713BF for ; Thu, 6 Dec 2018 21:05:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 919E22F23B for ; Thu, 6 Dec 2018 21:05:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 857F92F243; Thu, 6 Dec 2018 21:05:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC5DE2F23B for ; Thu, 6 Dec 2018 21:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725936AbeLFVFM (ORCPT ); Thu, 6 Dec 2018 16:05:12 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44620 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbeLFVFM (ORCPT ); Thu, 6 Dec 2018 16:05:12 -0500 Received: by mail-lj1-f196.google.com with SMTP id k19-v6so1652440lji.11; Thu, 06 Dec 2018 13:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qlckCdPuY2t2qCWWyGwxN4+a8ep4ZV8vwpKhBBe/rkY=; b=Xcd3IfUoBMIpAVpGSWJYQvadKlS8CMl0K/jA0jHms0vZUBP3RWEPw7PpDA4P0sJnBu xVJLwjj1WmKMWD7kO9Nb+g75Bity61Eg9Xg0OSz79D33oaJ2FJ98QRNpVh0JOOl3hjbe jrEFXHIe32/en+ERBAXVuDbqUiFg+egGXLc4rVyE82hUpkBys/o4W4njSiNf2gfpIjg8 9L5zMK8Rpvifi4NALWBJD2RdLLt69ux9Fa/y3boK9vlvs9zuzH3srPCA5oRi9PHPzKbn dg8iDynZtDkxKW5U2DG2uwJ+6kdhDJDgmsQvII9otMXU0yN0CqhFrFfBbK3G0krsg5VJ PeJA== 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:mime-version :content-transfer-encoding; bh=qlckCdPuY2t2qCWWyGwxN4+a8ep4ZV8vwpKhBBe/rkY=; b=Qo7xhCn7NwLmBAPP0pMCBrJizPlwYI7By5w7CVEzSYglgQqX2ttyHJEzOqJLMrLGoN xv/GzhSgJUmj/IWy5jn0GOVYgUbEwO2BVa1Ghoyb9cf9UxNWDgyBT73Z4imNW2HPtvYy +uSvanCiG7/PIapMMRzhZlsMcC+cznkDrc+tW2n/Hl2WkMaDg6UjN0qy41jzfU0a4K9L W2l0RwS8q3JoQLL7eZhG9Mrp0ay+I4I3G9f+cYgkvYtLA/YcdJIu89xQ/ZJ+Drk4Iron 3ZMr20pHQ/8BQo5HYfpvlSu73sElyOPSXbsN9wiVVoQQLKwUYXRh6lV+o8HEDJZR9Mp7 P2/w== X-Gm-Message-State: AA+aEWZ0744MN69+DkPtXZuHdLgg24C5n1CkEfg0RojZBjpOOTf3ozml r7OVKKPMSb3wH5+3HrreZaT3QUZg X-Google-Smtp-Source: AFSGD/Wp3u5+A4Cn5HOe3az/aTUCQK5egYDuOEZ3VPX8x01gYAnYnQWJf5gj60dlU2My/vT+g12Nng== X-Received: by 2002:a2e:9b84:: with SMTP id z4-v6mr8031302lji.93.1544130309269; Thu, 06 Dec 2018 13:05:09 -0800 (PST) Received: from arch.domain.name (89-70-226-70.dynamic.chello.pl. [89.70.226.70]) by smtp.gmail.com with ESMTPSA id e94sm267366lfi.23.2018.12.06.13.05.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 13:05:08 -0800 (PST) From: Tomasz Duszynski To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, jic23@jic23.retrosnub.co.uk, a.brauchli@elementarea.net, Tomasz Duszynski Subject: [PATCH v2 0/3] add support for Sensirion SPS30 PM sensor Date: Thu, 6 Dec 2018 22:04:40 +0100 Message-Id: <20181206210443.21052-1-tduszyns@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds support for Sensirion SPS30 particulate matter sensor. Along with a driver itself, new channel type and modifiers for distinguishing between coarse and fine particles measurements are introduced. Sensor datasheet can be downloaded from https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Particulate_Matter/Sensirion_PM_Sensors_SPS30_Datasheet.pdf v2: * add support for PM1 and PM4 measurements * get rid of variable length arrays * do proper cleanup via devm_add_action_or_reset() * add extra level of precision (two decimal places) while displaying measurements * improve comments a little bit * slight refactoring and general improvements here and there Tomasz Duszynski (3): iio: add IIO_MASSCONCENTRATION channel type iio: chemical: add support for Sensirion SPS30 sensor iio: chemical: sps30: add device tree support Documentation/ABI/testing/sysfs-bus-iio | 17 +- .../bindings/iio/chemical/sensirion,sps30.txt | 12 + drivers/iio/chemical/Kconfig | 11 + drivers/iio/chemical/Makefile | 1 + drivers/iio/chemical/sps30.c | 406 ++++++++++++++++++ drivers/iio/industrialio-core.c | 5 + include/uapi/linux/iio/types.h | 5 + tools/iio/iio_event_monitor.c | 10 + 8 files changed, 466 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.txt create mode 100644 drivers/iio/chemical/sps30.c --- 2.19.2