Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp519285rdb; Tue, 16 Jan 2024 07:31:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCzvIp7TQ1XU3tw3F47b5qyKBsUm8WJDjyCsPTvr/vsk5ee0dzxGU+SliKpXqukGOXhS84 X-Received: by 2002:aa7:d914:0:b0:54c:4837:7d0a with SMTP id a20-20020aa7d914000000b0054c48377d0amr2513731edr.73.1705419081644; Tue, 16 Jan 2024 07:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705419081; cv=none; d=google.com; s=arc-20160816; b=jXRnLItHj1i4/sy9Yo/8h2KKt5ee7F8+Hmz/Vx79e+7MWAPjNH32ZduteocImZVAe9 Qwgk992TGyFnVMq103WvlMMcR5rm0APZMtYD4O0jmLK59Z9sHSGKUfqUlvRU+uMjIwbU Gi1vRv5+fZMC6iZ7LUAZ0f7v0+qwsQ8syCheFKqjpKpE2uEAWNWIiQW/3vWcF4wXG9ju Ba/yJq+gzwdF4Cb5dtTI9FsvV0OsQb75CFD1673+sPOkfgf2t9f+lvICzJjXPG7WmNAG rGOyRTNx6snt2CHPpiXPvUBY1L4gR/o5j5QNjjF+qBSbw2L3/yAFt9b5bwkB0CNc7OuB 5mHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=EbzIVaYaEJ5SWavDcHCxKGfea/F5k+gN6HpNmraJ9/Y=; fh=/kFmcoaTFyqCQnXbpWYiHnYxHskkPm5fClEX18t1gzs=; b=O3z14hGE5c2j43RftJ3fgx6E7s4tX6jCy/JyYW9ARaAWnFGWB7yf1yYeq5izkBmSke 6FHiAJYiC/mbgL7H9CXRS9rJ4vJUWrH/bheXFTaoz0xe69Bh3YHBBRiry9ipP0YkTCpZ dHAOTWt+USXfn5wi5rCuHmVcmiXeQGmxBs+tU2WNJnZK3P37TaL0tBV8dDI3AMkOq1Zu HV3WzPd9iO3GbsGBkgT73Xu5glWmhPa+1oUjol1ttVbNXna99UMmdYBWfkAaViuD2rcj iEKkBPN6iee6rwmJVis9QWLGYq3xRV6FkTyMm8cquARLxGySEqvLT0mM+0RuLMnvpiES Z5pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I3nKi4lL; spf=pass (google.com: domain of linux-kernel+bounces-27522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z9-20020a50eb49000000b005590dddac24si2775050edp.658.2024.01.16.07.31.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 07:31:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I3nKi4lL; spf=pass (google.com: domain of linux-kernel+bounces-27522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 37A2D1F21A8E for ; Tue, 16 Jan 2024 15:31:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F0301C29F; Tue, 16 Jan 2024 15:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I3nKi4lL" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F8E51C6B4 for ; Tue, 16 Jan 2024 15:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a29058bb2ceso1060829466b.0 for ; Tue, 16 Jan 2024 07:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705419053; x=1706023853; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EbzIVaYaEJ5SWavDcHCxKGfea/F5k+gN6HpNmraJ9/Y=; b=I3nKi4lL2JDxmzJYxGKi6e8Z9cgcEFNbqg5vZwB76THZlMXO0UZ5dmypzcCC0eYQvj BmhaVIHx2eH5s/mhjvfzQqTLMjbUEgL/QCdy0HJCz7blSka1JTx8nymoe/po3ymlFSJB ToL0flzmqmtWSrWQTXIqDTZnquAi+FTB6K21A4rUYLC/+aRc/iCN8IqFhV57Gm7+gRtk JLq0w1KWZkfnvPSwZzNw6DF2smYaeSNnMwEIOKrrxQx/qiuDUdMA6LEjeMN049AeIShX iJiuJqlI8bYNOrZ+BRkKbblfL2QHitVF491ZQNRkJCz1ChthRIeCsZ6xpb4lmu9RDl34 oPqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705419053; x=1706023853; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EbzIVaYaEJ5SWavDcHCxKGfea/F5k+gN6HpNmraJ9/Y=; b=UtTrQdHqrhW3s4v13I9LqRAGrzzalTKNc7wc19PEbO4BMhULCpSz326+ExgfmPNMSP 0eW2xl3lTJAqw/2zjWBfhYEUHk0bjGksAcsFG7QEqzi9kr/lS6KUSCjc0XT/29ZTmaL+ WcoNbfbMPu4PvYcOQ09Yf77yMq+XiDnorTHAB8EoCdOeTBzZAWfh6M6sH8mo5dA+t176 wL1olMswW9cgFWEIure4gvqQ32Vnb1VY1aH+3BsmdsHoJ9X2EBIaoU9BijHyakIQFMJL 2pfg1rGGqkIkbdicB+JRNli/99dMlxVg39fXLQT7e4kXQykypGzaMbgZcSIu5U/IMqAY HAVg== X-Gm-Message-State: AOJu0YxDvdlJosVPz4OC1jm24Qygk0xAwcfamxrw7NSv0zKaHEXvOPVf 3aznjkwiLCSyvKZrOg8vK1DwS0AsGbM5Cw== X-Received: by 2002:a17:906:f0d3:b0:a28:d16d:5aab with SMTP id dk19-20020a170906f0d300b00a28d16d5aabmr2507615ejb.157.1705419053616; Tue, 16 Jan 2024 07:30:53 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id qo11-20020a170907874b00b00a2ce46a27besm5078908ejc.190.2024.01.16.07.30.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 07:30:53 -0800 (PST) Message-ID: Date: Tue, 16 Jan 2024 16:30:51 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] iio: pressure: Add driver for Sensirion SDP500 Content-Language: en-US To: Petar Stoykov , linux-iio@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Andy Shevchenko , Angel Iglesias , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5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UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/01/2024 16:24, Petar Stoykov wrote: > Sensirion SDP500 is a digital differential pressure sensor. The sensor is > accessed over I2C. > > tristate "STMicroelectronics pressure sensor Driver" > depends on (I2C || SPI_MASTER) && SYSFS > diff --git a/drivers/iio/pressure/Makefile b/drivers/iio/pressure/Makefile > index 436aec7e65f3..489ef7b7befa 100644 > --- a/drivers/iio/pressure/Makefile > +++ b/drivers/iio/pressure/Makefile > @@ -25,6 +25,7 @@ obj-$(CONFIG_MS5611) += ms5611_core.o > obj-$(CONFIG_MS5611_I2C) += ms5611_i2c.o > obj-$(CONFIG_MS5611_SPI) += ms5611_spi.o > obj-$(CONFIG_MS5637) += ms5637.o > +obj-$(CONFIG_SDP500) += sdp500.o > obj-$(CONFIG_IIO_ST_PRESS) += st_pressure.o > st_pressure-y := st_pressure_core.o > st_pressure-$(CONFIG_IIO_BUFFER) += st_pressure_buffer.o > diff --git a/drivers/iio/pressure/sdp500.c b/drivers/iio/pressure/sdp500.c > new file mode 100644 > index 000000000000..bc492ef3ef3e > --- /dev/null > +++ b/drivers/iio/pressure/sdp500.c > @@ -0,0 +1,201 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +#include > +#include > + > +#define SDP500_CRC8_POLYNOMIAL 0x31 // x8 + x5 + x4 + 1 (normalized to 0x31) > +#define SDP500_READ_SIZE 3 > + > +#define SDP500_SCALE_FACTOR 60 > + > +#define SDP500_I2C_START_MEAS 0xF1 > + > +#define sdp500_err(idev, fmt, ...) \ > + dev_err(idev->dev.parent, fmt "\n", ##__VA_ARGS__) Nope, drop > + > +#define sdp500_dbg(idev, fmt, ...) \ > + dev_dbg(idev->dev.parent, fmt "\n", ##__VA_ARGS__) > + > +#define sdp500_info(idev, fmt, ...) \ > + dev_info(idev->dev.parent, fmt "\n", ##__VA_ARGS__) Drop all three. > + > +struct sdp500_data { > + struct device *dev; > +}; > + > +uint8_t calculate_crc8(uint8_t *data, uint32_t len, uint8_t poly) Why this is not static? > +{ > + uint8_t count = 0; > + uint8_t value = 0; > + uint8_t temp = 0; Weird indentation. You should not implement your own CRC functions. Don't we have CRC8 in the kernel? > + > + while (len--) { > + temp = *(data); > + data++; > + value ^= temp; > + for (count = 0; count < BITS_PER_BYTE; count++) { > + if (value & 0x80) > + value = (value << 1) ^ poly; > + else > + value = value << 1; > + } > + } > + > + return value; > +} > + > +static int sdp500_xfer(struct sdp500_data *data, u8 *txbuf, size_t txsize, > + u8 *rxbuf, size_t rxsize, const struct iio_dev *indio_dev) > +{ > + struct i2c_client *client = to_i2c_client(data->dev); > + int ret; > + > + ret = i2c_master_send(client, txbuf, txsize); > + if (ret < 0) { > + sdp500_err(indio_dev, "Failed to send data"); > + return ret; > + } > + if (ret != txsize) { > + sdp500_err(indio_dev, "Data is sent wrongly"); > + return -EIO; > + } > + > + if (!rxsize) > + return 0; > + > + ret = i2c_master_recv(client, rxbuf, rxsize); > + if (ret < 0) { > + sdp500_err(indio_dev, "Failed to receive data"); > + return ret; > + } > + if (ret != rxsize) { > + sdp500_err(indio_dev, "Data is received wrongly"); > + return -EIO; > + } > + > + return 0; > +} > + > +static int sdp500_start_measurement(struct sdp500_data *data, const > struct iio_dev *indio_dev) Your patchset is corrupted. > +{ > + u8 txbuf = SDP500_I2C_START_MEAS; > + > + return sdp500_xfer(data, &txbuf, 1, NULL, 0, indio_dev); > +} > + > +static const struct iio_chan_spec sdp500_channels[] = { > + { > + .type = IIO_PRESSURE, > + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), > + }, > +}; > + > +static int sdp500_read_raw(struct iio_dev *indio_dev, > + struct iio_chan_spec const *chan, > + int *val, int *val2, long mask) > +{ > + int ret = -EINVAL; > + u8 rxbuf[SDP500_READ_SIZE]; > + u8 rec_crc, calculated_crc; > + s16 dec_value; > + struct sdp500_data *data = iio_priv(indio_dev); > + > + switch (mask) { > + case IIO_CHAN_INFO_PROCESSED: > + sdp500_xfer(data, NULL, 0, rxbuf, SDP500_READ_SIZE, indio_dev); > + rec_crc = rxbuf[2]; > + calculated_crc = calculate_crc8(rxbuf, SDP500_READ_SIZE - 1, > + SDP500_CRC8_POLYNOMIAL); > + if (rec_crc != calculated_crc) { > + sdp500_err(indio_dev, "calculated crc = 0x%.2X but > received 0x%.2X", > + calculated_crc, rec_crc); Your patchset is corrupted. > + return -EIO; > + } > + > + dec_value = ((rxbuf[0] << 8) & 0xFF00) | rxbuf[1]; > + sdp500_dbg(indio_dev, "dec value = %d", dec_value); > + > + *val = dec_value; > + *val2 = SDP500_SCALE_FACTOR; > + ret = IIO_VAL_FRACTIONAL; > + break; > + } > + return ret; > +} > + > +static const struct iio_info sdp500_info = { > + .read_raw = &sdp500_read_raw, > +}; > + > +static int sdp500_probe(struct i2c_client *client) > +{ > + struct iio_dev *indio_dev; > + struct sdp500_data *data; > + struct device *dev = &client->dev; > + int ret; > + > + indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); > + if (!indio_dev) { > + dev_err(dev->parent, "Failed to allocate iio device\n"); No printing on ENOMEM. Run coccinelle/coccicheck on your patchset. There is no code in kernel doing this, so please take existing code as base for your driver, instead of upstreaming ancient out-of-tree poor code. > + return -ENOMEM; > + } > + > + i2c_set_clientdata(client, indio_dev); > + > + data = iio_priv(indio_dev); > + data->dev = dev; > + > + indio_dev->dev.parent = dev; > + indio_dev->name = client->name; > + indio_dev->channels = sdp500_channels; > + indio_dev->info = &sdp500_info; > + indio_dev->modes = INDIO_DIRECT_MODE; > + indio_dev->num_channels = ARRAY_SIZE(sdp500_channels); > + > + ret = sdp500_start_measurement(data, indio_dev); > + if (ret) { > + sdp500_err(indio_dev, "Failed to start measurement"); You must use dev_err, not own print methods. > + return ret; > + } > + > + ret = iio_device_register(indio_dev); Why not devm? > + if (ret < 0) { > + sdp500_err(indio_dev, "Failed to register indio_dev"); dev_err > + return ret; > + } > + > + return 0; > +} > + > +static const struct i2c_device_id sdp500_id[] = { > + { "sdp500" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(i2c, sdp500_id); > + > +static void sdp500_remove(struct i2c_client *client) > +{ > + struct iio_dev *indio_dev = dev_get_drvdata(&client->dev); > + > + iio_device_unregister(indio_dev); > +} > + > +static const struct of_device_id sdp500_of_match[] = { > + { .compatible = "sensirion,sdp500" }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, sdp500_of_match); > + > +static struct i2c_driver sdp500_driver = { > + .driver = { > + .name = "sensirion,sdp500", > + .of_match_table = sdp500_of_match, > + }, > + .probe = sdp500_probe, > + .remove = sdp500_remove, Some random wrapping here.. Best regards, Krzysztof