From nobody Mon Sep 28 17:48:36 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 786C44B04AF for ; Wed, 19 Aug 2026 10:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787135491; cv=none; b=AYA6lx6BqPYcdbchrqQMMlefhAXHfAwwImvfnbaQda0dWI75Na+o6PT243yWHWqYUUP1qPBkXfjJotPoM7rS/bt0kxEG7UxQyg900OCXY6XZ5zQWNXX4fP6H4U6uUle0Omt2CNIVPFIMyZQ+qDP4EWANzBq8ZJ5zXn/0dPwAiDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787135491; c=relaxed/simple; bh=9Qkhkh8522ebnwz5H0rW3+Pio8/owpsLYVwSBfFvyCs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dAVf238971+CBkUvxWoWyT/3Axy9os8yljOn7KJct/O7X+DarRxSZ6E66JlYeN5uFF8MA4XKeSd5Ql+UWTCbSU87cUcVMJaOYYzIu1fL6x0w7H9ptUy+d5dz/N1pYRjFJSe8dwF8pmO7XrytPtMLEN2144/k/2GDbgosNLdjVSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QTb4xtr3; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QTb4xtr3" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4998e0916faso6753335e9.2 for ; Wed, 19 Aug 2026 03:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787135489; x=1787740289; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=jR2O7SPhUsucSLV7PAV/FXwdRoC1TShjM26AELxkU6Y=; b=QTb4xtr3bAsyqu00nOevvqeMc8vXgyQKive02FU6Rs1/a/QQi51vK2CnSfFE1rBsXu WqREDcNsJdIcoBa5j7v1FzmcgzGJL3VC/5NFUfiwou7aRlXqmFSGNWvLMZOlAmMj6lS2 bY9C9a4PyEIHshBRpT9draQai3Xa7sG2UuBWi22rdOACdSZKjR+rsCVySukS0Rex94Cu bR1JrkhLzlGLUrnYvjcq2wTfD8SktnJaW+L47pn0aPcAumWk/l9lb5h3oeY3hsFpyVsk C5rDYTGAPDkIkeMalo0Pk4fWR81rXJpl2qmX4QuF25Qd/dP3Fbz4qZHU8e6oD0YlJB6T m8/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787135489; x=1787740289; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jR2O7SPhUsucSLV7PAV/FXwdRoC1TShjM26AELxkU6Y=; b=bg0LZTKMVO8kI5zcVcvNTIv3xIfxd4v1Hw6x19Vgj0/IHIMPH/6NoovnJWYEn0UlOI HPxLbNYgWTC6ov7Cyi/zOZ6CHFJ+Q9B5hm+HGN6haNdgTxyFcbdGqdArO+yVin5Ge4eT DLWGvVB/iGACz/LFNnAlnnn9qL8+FCtL3BCwlVINo+9Mjcpf0VqIC41Tlvg4A37MtMD8 y3EN1OnLkU3hnhDSGPcoF+mDtRVX2jIGzbUNRaZlC1gA3oYeUFinqq9/cOIoSDltnkBd VP+ozkEDJNTUrqbdq7BIMQPE5bwobgB+PrlrL96PpsdFtI75vOXX9Axfz9Mlf1Ah9KAZ OEzw== X-Forwarded-Encrypted: i=1; AHgh+RoYAqNm9Ez4/kPZVruhFBS5BxRX7qeSM+mkXf+4pvAFJL5mwAoZ43LPbfMUuSbNZaqyy9hoD8Up6e1V96M=@vger.kernel.org X-Gm-Message-State: AOJu0YyyZzTLn+cxDO3HTcaMYJPBWgufN0LnnumZhdIOYgr+kgOyl8jC sq5LVXv4weu6GGVGV6PxNukFSLiaO8H/yy/IeJ/4mDyUOObzXE+Nr062 X-Gm-Gg: AR+sD13Y1bSyVvnu8mbZROi0QEOROU9f8/fQDvE8GQc0Vmgd/gKQKIK6KVdPX9+J2fS va7wUHyLos/qf3nYmQRDjAJVb14Bqmq90AClVgW0xDB9JC2whndo+2+AhdhlrbNCyq/FqlEqp+Z bC2miMgrsgftBut5EC1Ure5aqPWEhpTdZgBCYwpuk2opfLWWOCunvgsmerXneySIi7H6wNICLfN sXTH+5fV22m9veqIulkX9fpiuhZfN4/ic2EMh0K0Rx6+nBI6F7bYEH/cyOLed5oQ748Qw80dIM8 UbMlwgU3jR9xGxmpIq1OS+yM7U6k08ai8EDwZGQkwHgWqUzmdlXNeLV6Pa0xH7SBRMEfveb6Ab2 huGcRDUwj7cuzUrBzWakis9dkbR8qVt/YiFGF95Hew5ICiCG7WweP+m0S8hdPsmeTv1PBL+4uWg tD/3Ym8+hi7Icnejl6b6Ms8wkJWLOiR7W0WAo9zPz+i3s4sBXZa4DctDxq/IRNCX5WCBjOrnwFM tI= X-Received: by 2002:a05:600c:8b65:b0:499:a5fc:2087 with SMTP id 5b1f17b1804b1-499aa1722f5mr66480935e9.6.1787135488419; Wed, 19 Aug 2026 03:31:28 -0700 (PDT) Received: from localhost.localdomain ([165.51.108.173]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499ab2a8b34sm56446915e9.8.2026.08.19.03.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 03:31:26 -0700 (PDT) From: Salah Triki To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Stepan Ionichev Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Salah Triki Subject: [PATCH v8] iio: humidity: ens210: Extend I2C functionality check Date: Wed, 19 Aug 2026 11:31:09 +0100 Message-ID: <20260819103110.25718-1-salah.triki@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ENS210 driver uses byte data read/write, word data read, and block data read transactions. However, the probe function checks for I2C_FUNC_SMBUS_WRITE_BYTE (which is unused) and misses the check for word data reads. Update the functionality check to strictly match the transactions used by the driver by removing the unused flag and adding the missing byte and word read capabilities. Signed-off-by: Salah Triki --- Changes since v7: - Fixed functionality mask based on code analysis by Stepan Ionichev and Jonathan Cameron: - Removed unused I2C_FUNC_SMBUS_WRITE_BYTE. - Replaced I2C_FUNC_SMBUS_WRITE_BYTE_DATA with I2C_FUNC_SMBUS_BYTE_DATA. - Used I2C_FUNC_SMBUS_READ_WORD_DATA Changes since v6: - Replaced the incorrect use of I2C_FUNC_SMBUS_EMUL with an explicit list of required SMBus functionalities as requested by Jonathan Cameron. - Used combined macros (BYTE_DATA, WORD_DATA) to simplify the check. Changes since v5: - Changed patch title from "Fix missing I2C functionality checks" to "Simplify I2C functionality check" to reflect the new approach. - Dropped the Fixes tag as the change is now considered hardening rather than a bug fix. - Replaced individual functionality checks with a single check for I2C_FUNC_SMBUS_EMUL as suggested by Jonathan Cameron. Changes since v4: - Fixed the alignment and indentation of the I2C functionality check per Andy's review. Changes since v3: - Fixed the alignment and indentation of the I2C functionality check per Andy's review. Changes since v2: - Fixed the alignment and indentation of the I2C functionality check per Maxime's review. Changes since v1: - Updated the I2C functionality test to check for both required native operations and SMBus emulation (`I2C_FUNC_SMBUS_EMUL`) drivers/iio/humidity/ens210.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/humidity/ens210.c b/drivers/iio/humidity/ens210.c index 81276195152b..4bdd37e7227b 100644 --- a/drivers/iio/humidity/ens210.c +++ b/drivers/iio/humidity/ens210.c @@ -202,8 +202,8 @@ static int ens210_probe(struct i2c_client *client) int ret; =20 if (!i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_WRITE_BYTE_DATA | - I2C_FUNC_SMBUS_WRITE_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { return dev_err_probe(&client->dev, -EOPNOTSUPP, "adapter does not support some i2c transactions\n"); --=20 2.43.0