Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp326113rdb; Sat, 27 Jan 2024 08:04:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIkntMIVE71C4Iurfwas3G6F056Dwv/lA/ah2zSdfQXRo1V8RYnKZfFw7RuF3e1a0f7uD5 X-Received: by 2002:a17:906:134b:b0:a32:42a0:6ed with SMTP id x11-20020a170906134b00b00a3242a006edmr1132625ejb.37.1706371488706; Sat, 27 Jan 2024 08:04:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706371488; cv=pass; d=google.com; s=arc-20160816; b=L+eJPVFRMUk/NZ8wigc/fqvAVyWbU2ZIPtMYCbt0kxtEdZJxS4L6+P0OX40YBze8rT Dk1bC/Xha+28zn6E3m53G/KJKpBG0FZRrpsBlAsBvFDM/fz8zxP46lHM+lEOPD9y9SJi t9oXXlTfDQsk/hRhXSRYYcSpFTHqeCyI1Jj6WvRSRU5pQkIOSedw3E380MyA0Xy36w+b G2DGEkCbCG98eL+oaK/g0f8yL9OvdJq/U8vkbOFPZRSNMb9P5CGxTUtuoMeZLUU8qY4U UyffcxbgyO3DQqqZu0el/dMca+EneXXje2pGhjaB7JaUlF/hIJpbvUwowOpijT9vzNww PBcQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41263-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cd20-20020a170906b35400b00a2335936fc9si1769295ejb.458.2024.01.27.08.04.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:04:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41263-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41263-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7536B1F22807 for ; Sat, 27 Jan 2024 16:04:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 334AE2C6B4; Sat, 27 Jan 2024 16:04:23 +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 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 --- 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 -- 2.43.0