Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1128897rdd; Wed, 10 Jan 2024 09:23:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlwl8g72lerFqyH517lpEVOMFADJsONcY3B7Tu0bZJO360w2mngXCm2ktULi11RwC6jd/J X-Received: by 2002:a05:6830:2044:b0:6db:bd47:9881 with SMTP id f4-20020a056830204400b006dbbd479881mr1201897otp.0.1704907415133; Wed, 10 Jan 2024 09:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704907415; cv=none; d=google.com; s=arc-20160816; b=RK3+d/L1W/H8ML+ZuncrqB5dky16dCcUxYvUXQmUkuqTdPZIUV6jm0QvSX9iXlLgIV paPSC+hT/RqJELPP84mrALX4DdkpVWN7FkRBit23yTsTelGSRClH3w8rWzz68glMqaMM HIdvQ+V5Mw6wbNI3sxiynnzvZE3g8W+XFpRf51CXXRXQzciDcw+f02nLIghbFxYz7ldx exq8+JK5JYgyXrljc6sLl/MQEh8wFH3dhRJwdGjfIKEMEhl/TQ2PzzEbq+5NPH2b9Hrz t4IL0xpmQ9819ueVkak3Hhdh/PhZY0L/ULLa4uZzFNsJGnb2uoSOSi3rj+YMhsOLBXpU 8M2Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yJ4L7DIDo5l8F6M5ECy3IgIJ/rr20wjKxds3USWhRi4=; fh=RpJjGiuDlOjmyoLhPwSzjbPbeK51vYo3I0V3BuRLNmU=; b=RsupCUh8YE8pnxqc7cU/gpCrsw7OAr6hy2CjE9t9aGebLF9KHHnGPmvXNcaui3nbbU DXRj6lhgL8z0L4dnjGh2u5YpEz+7yPBnLx47Lw0LxMvXwhH6iqm0UM/v1I9ndLSvpDvm J46WPD4V/1SElKdCOfZNMbykOAzzCzZrEgYbbovAUDaCsQesZ+JCyplhtj+zJm07wl+b kYDXMJS+jwqxvnOPpKzc1udND5W6nicrOAp6MgaobmCDYm3syXgBV3cNpvPYZ2CLEZYb H3r4u8Ty6NCz+V2OlW6guC7SGRhnjb3EL2Z4Pv8J3vhiEYL+IJ16YLJS7HGzojGRzBNg FYew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=QXRUqKUM; spf=pass (google.com: domain of linux-kernel+bounces-22523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22523-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d188-20020a6336c5000000b005ce014d78a3si4081900pga.366.2024.01.10.09.23.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 09:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=QXRUqKUM; spf=pass (google.com: domain of linux-kernel+bounces-22523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22523-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 74560283BBB for ; Wed, 10 Jan 2024 17:23:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E37F74D10D; Wed, 10 Jan 2024 17:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=subdimension.ro header.i=@subdimension.ro header.b="QXRUqKUM" 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 78A6E4D100; Wed, 10 Jan 2024 17:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (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 73A052997CD; Wed, 10 Jan 2024 17:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdimension.ro; s=skycaves; t=1704907393; bh=zZSi6xnStqinb9unKQaoLA9OH8LjSeJ51f1fcYz+zOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QXRUqKUMozz/FzNQ318X/xtt3o3MhygrvIzU4myhRfdf/Hj71wKILBz3s+lldDybh Tk3Gc2TWNVezvEzvaeFVIuuPKMjMiapP+IkZ/c20Ou/3Zr6YrSaFLYGDLguZm0QPV6 accir+3Ryq41R3RPYy/5ttjrZYNgT7AhKq9raZWQ= From: Petre Rodan To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Petre Rodan , Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH 3/6] iio: pressure: hsc030pa cleanup Date: Wed, 10 Jan 2024 19:22:38 +0200 Message-ID: <20240110172306.31273-4-petre.rodan@subdimension.ro> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240110172306.31273-1-petre.rodan@subdimension.ro> References: <20240110172306.31273-1-petre.rodan@subdimension.ro> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use signed type to variable holding the result given by div_s64(). Add includes based on prior reviews from Andy. Provide bus-specific technical datasheet in the _i2c.c _spi.c headers instead of the generic one. Signed-off-by: Petre Rodan --- drivers/iio/pressure/hsc030pa.c | 2 +- drivers/iio/pressure/hsc030pa.h | 2 ++ drivers/iio/pressure/hsc030pa_i2c.c | 6 ++++-- drivers/iio/pressure/hsc030pa_spi.c | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/iio/pressure/hsc030pa.c b/drivers/iio/pressure/hsc030pa.c index d6a51f0c335f..7e3f74d53b47 100644 --- a/drivers/iio/pressure/hsc030pa.c +++ b/drivers/iio/pressure/hsc030pa.c @@ -406,7 +406,7 @@ int hsc_common_probe(struct device *dev, hsc_recv_fn recv) struct hsc_data *hsc; struct iio_dev *indio_dev; const char *triplet; - u64 tmp; + s64 tmp; int ret; indio_dev = devm_iio_device_alloc(dev, sizeof(*hsc)); diff --git a/drivers/iio/pressure/hsc030pa.h b/drivers/iio/pressure/hsc030pa.h index d20420dba4f6..f1079a70799f 100644 --- a/drivers/iio/pressure/hsc030pa.h +++ b/drivers/iio/pressure/hsc030pa.h @@ -10,6 +10,8 @@ #include +#include + #define HSC_REG_MEASUREMENT_RD_SIZE 4 struct device; diff --git a/drivers/iio/pressure/hsc030pa_i2c.c b/drivers/iio/pressure/hsc030pa_i2c.c index e2b524b36417..b5810bafef40 100644 --- a/drivers/iio/pressure/hsc030pa_i2c.c +++ b/drivers/iio/pressure/hsc030pa_i2c.c @@ -4,14 +4,16 @@ * * Copyright (c) 2023 Petre Rodan * - * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/trustability-hsc-series/documents/sps-siot-trustability-hsc-series-high-accuracy-board-mount-pressure-sensors-50099148-a-en-ciid-151133.pdf [hsc] - * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/common/documents/sps-siot-i2c-comms-digital-output-pressure-sensors-tn-008201-3-en-ciid-45841.pdf [i2c related] + * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/common/documents/sps-siot-i2c-comms-digital-output-pressure-sensors-tn-008201-3-en-ciid-45841.pdf + * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/common/documents/sps-siot-sleep-mode-technical-note-008286-1-en-ciid-155793.pdf */ +#include #include #include #include #include +#include #include diff --git a/drivers/iio/pressure/hsc030pa_spi.c b/drivers/iio/pressure/hsc030pa_spi.c index a719bade8326..8d3441f1dcf9 100644 --- a/drivers/iio/pressure/hsc030pa_spi.c +++ b/drivers/iio/pressure/hsc030pa_spi.c @@ -4,13 +4,16 @@ * * Copyright (c) 2023 Petre Rodan * - * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/trustability-hsc-series/documents/sps-siot-trustability-hsc-series-high-accuracy-board-mount-pressure-sensors-50099148-a-en-ciid-151133.pdf + * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/common/documents/sps-siot-spi-comms-digital-ouptu-pressure-sensors-tn-008202-3-en-ciid-45843.pdf + * Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/common/documents/sps-siot-sleep-mode-technical-note-008286-1-en-ciid-155793.pdf */ +#include #include #include #include #include +#include #include -- 2.41.0