Re: [PATCH 5/8] platform: arm64: qcom-hamoa-ec: Verify required I2C adapter functionality

From: Konrad Dybcio

Date: Wed Jul 29 2026 - 07:55:35 EST


On 7/28/26 7:44 PM, Anvesh Jain P wrote:
> Check the underlying I2C adapter supports both the raw I2C transfers
> used by the fan RPM/LUT commands and the SMBus byte and block-write
> transfers used by the other EC commands, and fail probe early with a
> clear error if it doesn't.
>
> Signed-off-by: Anvesh Jain P <anvesh.p@xxxxxxxxxxxxxxxx>
> ---
> drivers/platform/arm64/qcom-hamoa-ec.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/platform/arm64/qcom-hamoa-ec.c b/drivers/platform/arm64/qcom-hamoa-ec.c
> index d0c45d9970ee..a420a180a194 100644
> --- a/drivers/platform/arm64/qcom-hamoa-ec.c
> +++ b/drivers/platform/arm64/qcom-hamoa-ec.c
> @@ -1195,6 +1195,11 @@ static int qcom_ec_probe(struct i2c_client *client)
> unsigned int i;
> int ret;
>
> + if (!i2c_check_functionality(client->adapter,
> + I2C_FUNC_I2C | I2C_FUNC_SMBUS_BYTE_DATA |
> + I2C_FUNC_SMBUS_WRITE_I2C_BLOCK))
> + return -EOPNOTSUPP;

return dev_err_probe(dev, -EOPNOTSUPP, "I2C adapter missing required functionality\n")

Konrad