From patchwork Sat Jan 27 16:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petre Rodan X-Patchwork-Id: 193032 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp558133dyb; Sat, 27 Jan 2024 08:05:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUqLrxV6N4ylYnyBAtn5TCf9e6Q6p2HWJpjgXPaHx4NROrGxrmBfseCD65E0+r2qtC+9dP X-Received: by 2002:a17:906:5ac8:b0:a35:40ca:c8df with SMTP id x8-20020a1709065ac800b00a3540cac8dfmr1039556ejs.7.1706371527146; Sat, 27 Jan 2024 08:05:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706371527; cv=pass; d=google.com; s=arc-20160816; b=EyVuocbT51CTkJ2+7epcYYkwA2S1o6hLBDkQz9muD2x81i/rRTRwVB2EPEOcaj850W YlomcKg4RRYjB/d21/OBLAZpmlT/cDKqB8q3mRp468dwhM0/dHL/vO7/eIuVUjlFGguc v+5buZK2OKBgvx9IHoWxoPRh5Nt/xKfzkbp9cnBGiiSXtTmLOaJ76OeG/VQTULXLaJ36 fOg2jxERCM2w/zMGMaSYP7pD9gjwEZNROXOhl4k4RiK/BT03ieoOlLjt1UHfOUyM9Ahq Nfq7kP3pcrLylrp1/1vigU2Uls4GO0zS8RnGkQNIW72eJL29YfUhu/t/3pkOyLPR+VcX 0QNg== ARC-Message-Signature: i=2; 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=uw8PQzj7YWNzG2x9VLeGQFqm6Ktk4Fl72vt8ODvTQNE=; fh=RpJjGiuDlOjmyoLhPwSzjbPbeK51vYo3I0V3BuRLNmU=; b=0B1IQj4vtpeBVKz/FRLiK7WzlHIjNcd+xzZYIEoHDeNWG38THf3Uactqq4RLxyGik5 K0HgN5Fk0xQzMzyNvofwxC3IGOsbxT0jnNNsP8fZx3ql/28uJnioULYzaHuG4c0rXVCS dN4+/b+87tBGAAno1pa1dn7XTXnMa/07ILEX5IDdU9q5bfE+DPirstSgYaa051hO5Lcr 4xHD7cPycwfPzBIDmxzbXsr2SfEJXtJBDr527Kb8VR7L22j+aNkH9OBc7oe5d6v6E8mJ avvcX8AagIFwLZZpF3UkxzuIZnJ6p/H/PEx86kzk4gtG1r2XW2OKLRaxyO9K7MqICCsg xbng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=qK4V5e6B; arc=pass (i=1 spf=pass spfdomain=subdimension.ro dkim=pass dkdomain=subdimension.ro); spf=pass (google.com: domain of linux-kernel+bounces-41263-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41263-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fy5-20020a170906b7c500b00a341e30b00asi1753211ejb.926.2024.01.27.08.05.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:05:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41263-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@subdimension.ro header.s=skycaves header.b=qK4V5e6B; arc=pass (i=1 spf=pass spfdomain=subdimension.ro dkim=pass dkdomain=subdimension.ro); spf=pass (google.com: domain of linux-kernel+bounces-41263-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41263-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 943D41F22A13 for ; Sat, 27 Jan 2024 16:05:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3657B2E40A; Sat, 27 Jan 2024 16:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=subdimension.ro header.i=@subdimension.ro header.b="qK4V5e6B" 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 8F87E2942A; Sat, 27 Jan 2024 16:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=172.104.132.142 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706371462; cv=none; b=rbkr5JiLyN58PSWfhQgl7WvJ3QXZSPl5Gcih+PFIUFH0mGRj8lXEcnR428OUZSBHs4UUPfHcT4St9TtcyLlb1S3Mzt2N1z/zMQBCEYbsIWh4WE/pxa0r/0LltAbO9uYWh6+AZjmMEKezqRB05H7fy+7SEw5/dwnEcblQNrqmIL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706371462; c=relaxed/simple; bh=NgaXfya/JmF4HV+b44clhdfGVtTwdg0qDzOTzyoDzpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KWPznftksGL0frf2NhcgG0Y9zl2MJggCZBVYmCSjixe/v+5BBIMRsD8AdPsHcDmhQZxor9Xr0yII6iTNbHWu42ElmNThYh8RLsHY0NsFGAc/94BxgALhLoo1Hil64PwIsuP9ThshgbxNZq9l8kLLiIRRIXiBpwdlEUPRyS0y8z4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=subdimension.ro; spf=pass smtp.mailfrom=subdimension.ro; dkim=pass (1024-bit key) header.d=subdimension.ro header.i=@subdimension.ro header.b=qK4V5e6B; arc=none smtp.client-ip=172.104.132.142 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.80.170]) (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 8319E293A95; Sat, 27 Jan 2024 16:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdimension.ro; s=skycaves; t=1706371452; bh=NgaXfya/JmF4HV+b44clhdfGVtTwdg0qDzOTzyoDzpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qK4V5e6B1GzGIg/zRvhY19ikQPVxBJL0Otg8VOdr6xnv1x8p4NDwqa8UruJGQtHKv Tc/8elnxNODXzvWqqzofpsHYskEO4pFj5aSZWdyXXnBj2caqMUK4GZYK8V0OKEqeSZ yweUdNwIOhWvvac2mLoGtca13e8hE5iv3EnFO0+E= From: Petre Rodan To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Petre Rodan , Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v2 2/4] iio: pressure: hsc030pa cleanup Date: Sat, 27 Jan 2024 18:03:56 +0200 Message-ID: <20240127160405.19696-3-petre.rodan@subdimension.ro> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240127160405.19696-1-petre.rodan@subdimension.ro> References: <20240127160405.19696-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789260230136819799 X-GMAIL-MSGID: 1789260230136819799 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 --- v1 -> v2 no change 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