From patchwork Sun Dec 24 14:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petre Rodan X-Patchwork-Id: 18510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp2160897dyi; Sun, 24 Dec 2023 06:36:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFirtGhqg5ZHDUuULv45ELJBUh3xcC/bjuIXkSx8hGv0JEb29Ik7Ln9w/z4CWB9zcMAyt6Q X-Received: by 2002:a05:6214:e83:b0:67a:9cd5:1178 with SMTP id hf3-20020a0562140e8300b0067a9cd51178mr8547544qvb.14.1703428564631; Sun, 24 Dec 2023 06:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703428564; cv=none; d=google.com; s=arc-20160816; b=HlLgaEJ5HMj9ru1oyZbvkWlkMhRCcC+ZML8BeO+bNB6hhb1cphH4Z7hX/TxeTRBtAn sTh1HztTFEf9bQ6yhAhhCRuCTWaqpXEhviq6lIeRRXdf2/oRywhiXLms47dNEiRTczQ/ 0j4LZLDDzFAkXJ+k31Rf+t8/gHRlEuBbUW9GEWH7bm4avQbB3K7BYwPwD8lY5HxMCUg6 Q6f3u9sqrjZoEnsCjRuvyP9azfMjF0Ht1vBUufrTiBc4ftjqBd31qRIvUGVTHKJEdqa9 HCAJ42SQr7OaHZzt9L4i2C1/ytwAWFdSnxRUmxWmo7ZKYVYScxQreoTTnY0TwnytjRsl V0+g== 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=4WVWSIYRPMLus0GM1oAnLmu/+teyQWKPUlbTxbxh7MI=; fh=auBG/XJW2lPLEoEXAXOF54MVuJG2UkDfAikGTVs8UKw=; b=HWhybgWDh29YmB5u5QyQrjBxhHxzsWWWTHdTObA9JpkkZBV85/F39MNIWdXrgTMcDj LHxrwhxdXoV2rB6DrfWxZs5hJC901la8nRGN6D26UiUJEORcyPhYzdvM/zDOFybpqPIc M5/+uqK24/Sj+p89KOdjGD/G1LaY+z0vaUS81xzlXexGXiYTypYPjvhLt47+8qooVdQX 706XXKSR8YD2eqowG/bo1Jo2V8LwDOmw2LljUHev+tlynFsEABO1uAZAH+pbFeehnl9K k94HiST3Tvi3uoNJSxVwMGXXSKJYVaTd2E4RRYbbFWPsFAh7r5LlcH6PwaUzZtr/ocd9 bJuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=CY3FYb8H; spf=pass (google.com: domain of linux-kernel+bounces-10722-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10722-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=subdimension.ro Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r19-20020a0ce293000000b0067f962d052bsi5645227qvl.28.2023.12.24.06.36.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 06:36:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10722-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=CY3FYb8H; spf=pass (google.com: domain of linux-kernel+bounces-10722-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10722-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6CF0F1C20DB3 for ; Sun, 24 Dec 2023 14:36:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03B34D507; Sun, 24 Dec 2023 14:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=subdimension.ro header.i=@subdimension.ro header.b="CY3FYb8H" 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 EADE017D4; Sun, 24 Dec 2023 14:35:17 +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 8884328B50B; Sun, 24 Dec 2023 14:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdimension.ro; s=skycaves; t=1703428509; bh=rU5rJIlWYqtR3hpWn2InZL28bds4hYMdaN1vzUK5cI4=; h=From:To:Cc:Subject:Date; b=CY3FYb8HD1l8++KedRhHcguTPCPYqNWnFxuIAwXoriaBsaiPPOyaf6KmB2hq62EUz wUaAJTfYb0gPB0/96czMT92dqGeU5vyFkX0Fxp34nqsqc68rbTRzK+4cbl/8cWzMOW 9OJrjzCjrcg1dSgXphAI+cxEZN3DzevKKkMGp3HU= From: Petre Rodan To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Petre Rodan , Andreas Klinger , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko Subject: [PATCH v2 00/10] changes to mprls0025pa Date: Sun, 24 Dec 2023 16:34:45 +0200 Message-ID: <20231224143500.10940-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: 1786174310882092421 X-GMAIL-MSGID: 1786174310882092421 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 Signed-off-by: Petre Rodan Signed-off-by: Andreas Klinger --- Petre Rodan (10): dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml fix dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add pressure-triplet dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add spi bus iio: pressure: mprls0025pa.c fix off-by-one enum iio: pressure: mprls0025pa.c fix error flag check iio: pressure: mprls0025pa.c remove dangerous defaults iio: pressure: mprls0025pa.c whitespace cleanup iio: pressure: mprls0025pa.c refactor iio: pressure: mprls0025pa.c add triplet property iio: pressure: mprls0025pa.c add SPI driver .../iio/pressure/honeywell,mprls0025pa.yaml | 97 ++++-- MAINTAINERS | 3 +- drivers/iio/pressure/Kconfig | 14 +- drivers/iio/pressure/Makefile | 2 + drivers/iio/pressure/mprls0025pa.c | 308 +++++++++--------- drivers/iio/pressure/mprls0025pa.h | 100 ++++++ drivers/iio/pressure/mprls0025pa_i2c.c | 98 ++++++ drivers/iio/pressure/mprls0025pa_spi.c | 91 ++++++ 8 files changed, 539 insertions(+), 174 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