From patchwork Fri Dec 29 09:24:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petre Rodan X-Patchwork-Id: 18601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2466633dyb; Fri, 29 Dec 2023 01:28:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdMCw+rq9Gi8+0iDBUiV1f03/9jDWnP9/qccRZ9KPEg9d3U3xdEkh+wyTM1ezX9IzXZCXq X-Received: by 2002:a05:6808:3c95:b0:3bb:cc85:dfca with SMTP id gs21-20020a0568083c9500b003bbcc85dfcamr4224079oib.33.1703842087509; Fri, 29 Dec 2023 01:28:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703842087; cv=none; d=google.com; s=arc-20160816; b=dAXXv5xs89ZAoq2PviF0M1PKog8QaCG4SkXFTohzkS5RaNcJ83y08H6AmlamaF+1ZH Nx59MWTAP75RR/bm2eQeWir4hCkqF1BBGiSu28ASBUALQ8ZqBTkLxa2Qf8i6g/picJu2 NQEUnCQw+qzYaXkbRKSp4eSNraRFqLceGfeo2cQgXwtq8Abe+hs/Xorr5REtrdAY7t9E h1dDzM6x7D8Z6sO+vcz789MyeyRkunCRq3X9YFIIrVD16Y91+jrSmnwIX+zXwf+aY+h2 WNIZOR3e627lvfHTloGd+d5GIlTfwnQIRl7vz+IGN7KDdMK7mAr7kJFuDSujPZhqd6qL 4UKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=sK5vkdsq5HHFdMNCGfXNINfW50xcNW0x41ECO5RDchY=; fh=jqBctGHbf9AVU5R58vhGWQ3B4pyO5m4xQP1pFNcmSHk=; b=dwE/e5mcsY75abap9yvV78S1hIjeIDUn6DwU+vtR+JKX+X2p1fYpbB/3aoUQ3YD9bB aOr97IfMOaGEhUJ1uXEbDRYemupZrWfe8uBWcEY8vjReI7dZmqMpgp3bYkqKQIPR20Tj 4oV4BcjYr6uTdEKnEPYspnG+syrIhiVirMn4NeIGuHIkziH8C01azNn2RsrSQINPxQRZ AqVazuymQSZIO418doPOK/VZ2P1JHMvdW0x8f+2rPfE8hZ3ZTcKY2WZE2wvt45NOVcS3 bE1m8ZZCsl6I3t65A5pVpoCq5LK7D4klYyiBTnPWaUZmm6Sc3vgwocwmv5MuAc5pYBlP 75DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=fYzLmYvI; spf=pass (google.com: domain of linux-kernel+bounces-13030-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13030-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=subdimension.ro Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n26-20020a056a000d5a00b006d9af0532a0si9379730pfv.41.2023.12.29.01.28.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 01:28:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13030-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=fYzLmYvI; spf=pass (google.com: domain of linux-kernel+bounces-13030-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13030-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=subdimension.ro Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0552FB22EF2 for ; Fri, 29 Dec 2023 09:26:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5098812B60; Fri, 29 Dec 2023 09:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=subdimension.ro header.i=@subdimension.ro header.b="fYzLmYvI" X-Original-To: linux-kernel@vger.kernel.org Received: from mail.subdimension.ro (skycaves.subdimension.ro [172.104.132.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C48810A01; Fri, 29 Dec 2023 09:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=subdimension.ro Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=subdimension.ro Received: from localhost.localdomain (unknown [188.24.94.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.subdimension.ro (Postfix) with ESMTPSA id 5F8E828B50B; Fri, 29 Dec 2023 09:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdimension.ro; s=skycaves; t=1703841905; bh=Xii80BZilbcTZ+e6K1vQw1brFErvXXiWZ9Qzq2HxA+w=; h=From:To:Cc:Subject:Date; b=fYzLmYvIS4P8M71zP2/H6/5wEEy1ph5gOS2L0bmSsXeZ+Yw1fXfnCDNquRbncXpAf 21p4D1eiIWEmQpdoeY7G7N22+WWqnj3COhbncmybPl1Ab5EtVHmrFLrrurpu6IxNRc HbJrBRfOIQuPSiDmJNcjnuLwIs0Wgu3EKQiXqQg4= From: Petre Rodan To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Petre Rodan , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Andreas Klinger Subject: [PATCH v3 00/10] changes to mprls0025pa Date: Fri, 29 Dec 2023 11:24:28 +0200 Message-ID: <20231229092445.30180-1-petre.rodan@subdimension.ro> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786607920971573920 X-GMAIL-MSGID: 1786607920971573920 A number of fixes to the mprls0025pa driver: - an off-by-one initially caused by a typo in the bindings file - two error fields are never checked during sensor interaction - unsafe initialization if the driver is instantiated via sysfs and the bindings are missing Quality of life changes: - a refactor that adds a pressure-triplet property which initializes pmin-pascal and pmax-pascal just like in the hsc030pa driver. The user only needs to extract a short string from the chip name instead of looking up the chip in the datasheet, understand the nomenclature, extract the measurement range and then convert all units to pascals. New feature: - SPI compatibility for Honeywell MPR sensors that require it. Both binding and driver are backwards compatible. Tested in I2C and SPI modes with two different sensors. The refactor requires property function present in the togreg branch. Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/micropressure-mpr-series/documents/sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf Co-developed-by: Andreas Klinger Signed-off-by: Andreas Klinger Signed-off-by: Petre Rodan Petre Rodan (10): dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml improvements dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add pressure-triplet dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add spi bus iio: pressure: mprls0025pa fix off-by-one enum iio: pressure: mprls0025pa improve driver error resilience iio: pressure: mprls0025pa remove defaults iio: pressure: mprls0025pa whitespace cleanup iio: pressure: mprls0025pa refactor iio: pressure: mprls0025pa add triplet property iio: pressure: mprls0025pa add SPI driver .../iio/pressure/honeywell,mprls0025pa.yaml | 98 ++++-- MAINTAINERS | 3 +- drivers/iio/pressure/Kconfig | 14 +- drivers/iio/pressure/Makefile | 2 + drivers/iio/pressure/mprls0025pa.c | 313 +++++++++--------- drivers/iio/pressure/mprls0025pa.h | 102 ++++++ drivers/iio/pressure/mprls0025pa_i2c.c | 98 ++++++ drivers/iio/pressure/mprls0025pa_spi.c | 89 +++++ 8 files changed, 542 insertions(+), 177 deletions(-) create mode 100644 drivers/iio/pressure/mprls0025pa.h create mode 100644 drivers/iio/pressure/mprls0025pa_i2c.c create mode 100644 drivers/iio/pressure/mprls0025pa_spi.c --- 2.41.0