From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EA21E309F00; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=nDPVA3cBGRZGiItinISAb1PvbmUGyD81et4h7q8UVRXIRY+RIB/NvAXffjccu1Nm84TyWNPW4lSc7Y7NhGW2ZxVCnWSYW+NRru/VylEYRM4LA2Cgc5R689Mipzk/RP19Qdt/1uBTfxQ6YeUqG+XyII7mTpgdPgsQR9EwfcXsUuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=odmV5niUZmpfJnRwHXoQMD5/apRHKE+2PCyK8AQML/I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kMhElMT9INakDSSxjh6awiEB9I8XPXxTupy0gHBM75rZG22f4LWmm7FJNfkaBFyTOcqF9M30C0GeWAr9V1vdi4i+lpT2k45X/Q+jvYyS4n4QPTjpdPuuRYRfP/opS3rEuFKrBsXJAd+xoMBV5lbwqj6q/yvdsPxy/Ngxp3N+0EM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ufMULU1Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ufMULU1Q" Received: by smtp.kernel.org (Postfix) with ESMTPS id AE240C19424; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862359; bh=odmV5niUZmpfJnRwHXoQMD5/apRHKE+2PCyK8AQML/I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ufMULU1Q1nU+iY5SbLAwKRFE/BGEl+MR0c8BBk2cCaVyvdurdu0l4Ptfe3Q8epKXb WFjEuYV8rOtDy2ckKOXTWb+OD7Mxt+03pkSTbrd96EvjB0Mluhsp+7eoOllejiaqgm 1DyCeNmTXHS4FEGKBE/QFovjU1cZbV6s07jI2WPcb9NSpPIRguBf4mLtJIgzBjsRkP /pDM4gKSrmltuOIf3rl9+b9qgHUsMtEHG0STs25rOqYHkjfwdvUJNhJN90T32kqL7w AUpLe9Gw1N6+qSHVr9HzJk27ZSAF1cLvuP4JqjYpwbPYnIgk+PlFjB1U/PR/4Ugf7U LwZpLILFSh3Bw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E86CE98E1E; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:16 +0000 Subject: [PATCH v12 1/7] i2c: xiic: switch to devres managed APIs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-1-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=2992; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=xe5Qq7Si6KCzd0ih/kyZJPCw0i78NqZP8R5Fx1dBPLI=; b=dSWr0yb7yLam0ZeenJw4Q8x+zVLKvodtxjR4j7snA0Cpx8wy4SBYXzX9IU6GQ1X4EvMTyRhgM jPoKoS4tr5xD5+Hsxx0Ay32J1DWFTxS+2XlA1LfiDl0j9OdXERcht0c X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Simplify the error code paths by switching to devres managed helper functions. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 28015d77599d..65aa280f6fd9 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1423,6 +1423,7 @@ MODULE_DEVICE_TABLE(of, xiic_of_match); =20 static int xiic_i2c_probe(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct xiic_i2c *i2c; struct xiic_i2c_platform_data *pdata; const struct of_device_id *match; @@ -1461,7 +1462,10 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 - mutex_init(&i2c->lock); + ret =3D devm_mutex_init(dev, &i2c->lock); + if (ret) + return ret; + spin_lock_init(&i2c->atomic_lock); =20 i2c->clk =3D devm_clk_get_enabled(&pdev->dev, NULL); @@ -1472,8 +1476,9 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c->dev =3D &pdev->dev; pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT); pm_runtime_use_autosuspend(i2c->dev); - pm_runtime_set_active(i2c->dev); - pm_runtime_enable(i2c->dev); + ret =3D devm_pm_runtime_set_active_enabled(dev); + if (ret) + return ret; =20 /* SCL frequency configuration */ i2c->input_clk =3D clk_get_rate(i2c->clk); @@ -1489,7 +1494,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 if (ret < 0) { dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n"); - goto err_pm_disable; + return ret; } =20 i2c->singlemaster =3D @@ -1508,16 +1513,14 @@ static int xiic_i2c_probe(struct platform_device *p= dev) i2c->endianness =3D BIG; =20 ret =3D xiic_reinit(i2c); - if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n"); - goto err_pm_disable; - } + if (ret) + return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); =20 /* add i2c adapter to i2c tree */ ret =3D i2c_add_adapter(&i2c->adap); if (ret) { xiic_deinit(i2c); - goto err_pm_disable; + return ret; } =20 if (pdata) { @@ -1530,12 +1533,6 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) (unsigned long)res->start, irq, i2c->i2c_clk); =20 return 0; - -err_pm_disable: - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - - return ret; } =20 static void xiic_i2c_remove(struct platform_device *pdev) @@ -1555,9 +1552,6 @@ static void xiic_i2c_remove(struct platform_device *p= dev) xiic_deinit(i2c); =20 pm_runtime_put_sync(i2c->dev); - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - pm_runtime_dont_use_autosuspend(&pdev->dev); } =20 static const struct dev_pm_ops xiic_dev_pm_ops =3D { --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E2257309EFA; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=fy8j9324MCJ1aDOCuYQk2Z1WUdmEVumB24W0WZUuj62GMTDjCwKI0d4Vnc/LeCBQgTnC8fr4PSEJBVfrw5yqV8LMG9PGrMU7Dd1kluAhr3zymOwGMjvAsS8xDUqXdTaIwwtCBC8UXIN376ks80sZ0HM2+hUa/bmZUj1xa7tq1No= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=jRtEYRL116cS46+BRRnEAwVlx/TCGH4biEvlH/E3jhs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZJhKacgsdPOMbHiAia32Vh/Xa35/QlRRY6Z1SosqNso/Yut2f6FVU5gpJDISjn+wnavWAvWRD4wq+g1kGzVZ9OzpNOLKeX63bdouGBoNILbg0ClcC83sUkzYn2aK4ENE4rjoov+FMztkR4AQz/ZhjJz/nhQuNf0o2CJbE1ktAQQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hY8W00Hz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hY8W00Hz" Received: by smtp.kernel.org (Postfix) with ESMTPS id BD8DAC19423; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862359; bh=jRtEYRL116cS46+BRRnEAwVlx/TCGH4biEvlH/E3jhs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=hY8W00Hzl/pp0egLIG1G4hWGihy0/D3JpTJM/Hsfo9+C1w0D/XltYitv37hwekP9d +zRiZ9L5LLgVRW6nicOypqEge0cNyNKu1zZGzbkDNPRCw9uspCKq2BaCS2ERehZkyf HBpimFEbeuWhidWOva62rFKM9SUoMqVLn2nBzH5v6udcr+EeFBx60DToBoCAu84raO S0GbIrNEcB+unNERxYv8lLV3yOdJCcz8XIW8i/VhLiv8RNVfpx3SPKc+ZCn/rOZ5cN 5Bm9tXywKZL80YLwcyfIu3pua0KkoKEcE/eF+F20y8o+0l21SwV3CCfBDBw1DVXsE1 PKTFbyGmk6DjQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF79FEA4FD8; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:17 +0000 Subject: [PATCH v12 2/7] i2c: xiic: remove duplicate error message Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-2-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain , Andrew Lunn , Jonathan Cameron X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=1019; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=RRuL/bQeZiBpUR1djYETZjT+qDSOpjJwtLxb+GfrByQ=; b=VharzeRkKrxhyXE6WRZHB9DJvlK2n75eKd6wkWUB1AX6r3efg6/vudtjKSJthn0dcTNl9jog/ Yq1xUm9m4ByDTMwx3ySHPlrWQgQsjZQcLzWOTGNHsP3bFwMCsrDgk7J X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain The devm_request_threaded_irq() already prints an error message. Remove the duplicate. Reviewed-by: Andy Shevchenko Reviewed-by: Andrew Lunn Reviewed-by: Jonathan Cameron Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 65aa280f6fd9..99286af2a0d7 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1491,11 +1491,8 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, xiic_process, IRQF_ONESHOT, pdev->name, i2c); - - if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n"); + if (ret) return ret; - } =20 i2c->singlemaster =3D of_property_read_bool(pdev->dev.of_node, "single-master"); --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1832730ACE8; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=f6kKeHxZ7USvqBZ/nne8LCwQ/Cee/exin1v6mkQKlXhYoQHZ9dKM34YV8kitZ+6wfcG8d+mpBnxVCWUUikoyI50bGNRVr0yLllQNkv2p2A6u3E1TyO39jxiJT+3/PYQbeBS08rUf/0hHQSb5GHYozcmKyw2/v5vO+lrrMik+YmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=sNUMCjC/edNNrfJ9N5Yw2HyQVYhOfmsHMGbbuNPu+Fc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qnBcDV/1g5R/LpjlkTNzuWsnu4RyMMqGNBw35JlciOqiLskqWK7VfKFxY1X0aZpxjK5kBXevQD+b0sx5imWyZE6oUL0mojLwd/n5jOVCSOl8wYUFSQoWdslaSaUzDFzOQdu12UX0KOvYY5kQZBBplBLz1CAht7oGBP5wKFggB30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AkRhInjH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AkRhInjH" Received: by smtp.kernel.org (Postfix) with ESMTPS id D37ACC2BC9E; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862359; bh=sNUMCjC/edNNrfJ9N5Yw2HyQVYhOfmsHMGbbuNPu+Fc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AkRhInjH51fBhdjZ4XUT2MLA52L+TswWhdbw2ERy+PBbnlNt5YwchNJTBhZtMXpUj 6bsopWxi+Cm/vuXQtLu4abNRlOGbICevwnw/cdBbasppfXtl+NDDeod1vlismRmKuN YcyN6PaoOTqkc60dlVc5FkJrhujHh4gphUaNrVRdcqINpQNB2Je3PPM3ZZoQ+6jCi3 fDsWfCldRJfPd3onmknV74OZ3PVDQL/ysBAc6sZRmoS/pGgDoAGnMQhjZVRPYS0kkK 2x/4kMI0xMALadzjyHXkK3wOXa8+Ms61rdqj0u+KwPmT3Wp8jd9LayFXPtFAS7NiVq 2soGsDXV237Ug== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA973EF5865; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:18 +0000 Subject: [PATCH v12 3/7] i2c: xiic: switch to generic device property accessors Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-3-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=3070; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=9F2oFcqzvLc5raKmRaUuz3YdJei2/cMdcAQn1OeCoq0=; b=/W0xDE+k/+F40SNAzgQNuMFD1cDoIW54jyie115F+/LqMWFUqscX1wiXpxpOkxojbnd9YwsX9 1zoz4nlL3iGD3XtdynudSm3RVXng6/lQris26KDh1p9ToMNAgYbNzDf X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Use generic device property accessors making them work for ACPI platforms. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 99286af2a0d7..c7f641e291a2 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -1408,7 +1407,6 @@ static const struct i2c_adapter xiic_adapter =3D { .algo =3D &xiic_algorithm, }; =20 -#if defined(CONFIG_OF) static const struct xiic_version_data xiic_2_00 =3D { .quirks =3D DYNAMIC_MODE_READ_BROKEN_BIT, }; @@ -1419,14 +1417,14 @@ static const struct of_device_id xiic_of_match[] = =3D { {}, }; MODULE_DEVICE_TABLE(of, xiic_of_match); -#endif =20 static int xiic_i2c_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; + struct fwnode_handle *fwnode =3D dev_fwnode(dev); struct xiic_i2c *i2c; struct xiic_i2c_platform_data *pdata; - const struct of_device_id *match; + const struct xiic_version_data *data; struct resource *res; int ret, irq; u8 i; @@ -1436,12 +1434,9 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) if (!i2c) return -ENOMEM; =20 - match =3D of_match_node(xiic_of_match, pdev->dev.of_node); - if (match && match->data) { - const struct xiic_version_data *data =3D match->data; - + data =3D device_get_match_data(dev); + if (data) i2c->quirks =3D data->quirks; - } =20 i2c->base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(i2c->base)) @@ -1458,7 +1453,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c->adap =3D xiic_adapter; i2c_set_adapdata(&i2c->adap, i2c); i2c->adap.dev.parent =3D &pdev->dev; - i2c->adap.dev.of_node =3D pdev->dev.of_node; + device_set_node(&i2c->adap.dev, fwnode); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 @@ -1482,8 +1477,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 /* SCL frequency configuration */ i2c->input_clk =3D clk_get_rate(i2c->clk); - ret =3D of_property_read_u32(pdev->dev.of_node, "clock-frequency", - &i2c->i2c_clk); + ret =3D device_property_read_u32(dev, "clock-frequency", &i2c->i2c_clk); /* If clock-frequency not specified in DT, do not configure in SW */ if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ) i2c->i2c_clk =3D 0; @@ -1494,8 +1488,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) if (ret) return ret; =20 - i2c->singlemaster =3D - of_property_read_bool(pdev->dev.of_node, "single-master"); + i2c->singlemaster =3D device_property_read_bool(dev, "single-master"); =20 /* * Detect endianness --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 179BA30ACE6; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=BIJtTiMo1bVCapYKNtQLTTeloI6tvF6bpPmn/CDpgjhiW7fKYQUIh+VapsmyUnbLS0b1brMdHpQoBjQo0vm0CrZFSCbUOcEWmEraYUt9aZmY2hjw5evBaeks8W84NsS55Uek4VQu6bJZ0aaMAgu8ADLKVK6j+/ue8ESaWfuLJhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=BPWk7V6IosdqQatWb/+R1Zbr9KXhb6qDSmUpXNtngrc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ud8vqhAagkS8KGE5igtxqKScKSjnxtnOururjKItlT9XncfmlAH1x5n3Q0njbMGXyOgAiC1Cp6VUtbBbEOrM4SbHUu8atWeXdNa+XE8OGhhyp9aLs+D1vJ1YRRZj+U1MS7gLE3tg/xYpvVPU67IAnw9NzLxwLxnOXTptx/b6m4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LDwhHkLK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LDwhHkLK" Received: by smtp.kernel.org (Postfix) with ESMTPS id DF669C2BC87; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862359; bh=BPWk7V6IosdqQatWb/+R1Zbr9KXhb6qDSmUpXNtngrc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LDwhHkLKG9KcD8jSRzplUoYde45EYwtAlkOLDsQgJ6hFdtkNZKXyLtXklMfbiUciV XAon3Fp9dXWZ5dGid93ZWN5IGACgzCLoZhIv3euRM9glKwCvNNh295Ti5SXt2Y/p3s M0jfw39TNBVSBp2airqjJng5hOdEsLtIGbqcw+V/I5ewr+LNNyoum1i4JzgVJkkT51 /KdQtRr7v7cjvhTtGMHS+aLPioXC/zjdWM6eTNFwlOz7S3ZAdGUzdcLoPPH7S6SR2f Aa7Krl9RBLjgBwRI3LVGD/dsa61/geU/pn5jRFZQaXUKgYrioFzuTnw6QxOJ0vLRg4 UQr9gQNKaZK4w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8BA4EF5862; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:19 +0000 Subject: [PATCH v12 4/7] i2c: xiic: cosmetic cleanup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-4-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=2687; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=WKrYUysErSt8JUMYxG926hSrEQ6AQxFlt9ypfj4o7Ls=; b=0xl97kExS2O1dCFZT7JYp7TvujhDRbiZfVq2+5xolj18xlWwOIv5wHYnOdMebT/aBdAwI3c5H fcWtjcT2wxgCSclCnrPIcwIr/DjQkEj0x6YWnEFgBsxR40QYWZgG4ad X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Re-use dev pointer instead of referencing &pdev->dev everywhere. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index c7f641e291a2..463a207c6a76 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1430,7 +1430,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) u8 i; u32 sr; =20 - i2c =3D devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); + i2c =3D devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL); if (!i2c) return -ENOMEM; =20 @@ -1446,7 +1446,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) if (irq < 0) return irq; =20 - pdata =3D dev_get_platdata(&pdev->dev); + pdata =3D dev_get_platdata(dev); =20 /* hook up driver to tree */ platform_set_drvdata(pdev, i2c); @@ -1468,9 +1468,10 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), "failed to enable input clock.\n"); =20 - i2c->dev =3D &pdev->dev; - pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT); - pm_runtime_use_autosuspend(i2c->dev); + i2c->dev =3D dev; + + pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT); + pm_runtime_use_autosuspend(dev); ret =3D devm_pm_runtime_set_active_enabled(dev); if (ret) return ret; @@ -1482,9 +1483,8 @@ static int xiic_i2c_probe(struct platform_device *pde= v) if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ) i2c->i2c_clk =3D 0; =20 - ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, - xiic_process, IRQF_ONESHOT, - pdev->name, i2c); + ret =3D devm_request_threaded_irq(dev, irq, NULL, xiic_process, + IRQF_ONESHOT, pdev->name, i2c); if (ret) return ret; =20 @@ -1527,21 +1527,21 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =20 static void xiic_i2c_remove(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct xiic_i2c *i2c =3D platform_get_drvdata(pdev); int ret; =20 /* remove adapter & data */ i2c_del_adapter(&i2c->adap); =20 - ret =3D pm_runtime_get_sync(i2c->dev); - + ret =3D pm_runtime_get_sync(dev); if (ret < 0) - dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n", + dev_warn(dev, "Failed to activate device for removal (%pe)\n", ERR_PTR(ret)); else xiic_deinit(i2c); =20 - pm_runtime_put_sync(i2c->dev); + pm_runtime_put_sync(dev); } =20 static const struct dev_pm_ops xiic_dev_pm_ops =3D { --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 27E0230B50B; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=uUrfY/GohMOGdKVDmoeKkrN3eSH0/03GRPdRiBNwVThGVfPOd4oFdlNQ8Y0cBsl07X+YUVf4AEcoxLRU/eA+wasfg10BQjDkaPvLFRsZx93cB7NDLK4bpm8spugpFW9LvIWXMUPw9rfqbHgmbBdjA0RnQypL+CpETZerOcwxaKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=eDeGqWzfszSxlsa0dgDJoVbCF0RNmd/ZzVa697YK8KE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qWACghnl4fPbw62orCx4W5aEUokKsT53sYdCkSYoi6Jcj9t8b6hDfeEpjPEMPyUXt8Pm6I2HHrbBpgo6amme51YddlOdsv/sz582wHFSLh6guvCpSpAindrn4wjFeFobMiwlcMFmifnpFp6iWQ49UE+cOWteLgiO/EPucsksYwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RQ6ZeCtL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RQ6ZeCtL" Received: by smtp.kernel.org (Postfix) with ESMTPS id F0334C2BCB0; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862360; bh=eDeGqWzfszSxlsa0dgDJoVbCF0RNmd/ZzVa697YK8KE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=RQ6ZeCtL9n4bB0jdne9IogDl7WOMZu1aVge4oisE82c/ew8EiVeUL7IVZFY6idg2o ZdN0PbY3VHZa28FX8nTyXse2aOCgV4/nWbgpDO8lrm7Ovejbz9JjsHsVz2zNkUj/Op NKkcQQFSf/qk1IgkNfB0bmYRiPtmHP68k97IQscYt+pxaf6vjMLevIVr4wFJBu5wA7 PZEqF4ymhhE2dO0xPDMgmPZHwj6PyGpg2tbeRTwggePYPbxfKlmT1NQ8gnYy8DsBko MO89F1U+velR/Qf2hy1/MmsN0ESgtJQtEyb1//7ba30K+vgTHGr3heONQSkrN+3EqI BtEpmAODggjBQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E60B7E98E1E; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:20 +0000 Subject: [PATCH v12 5/7] i2c: xiic: cosmetic: use resource format specifier in debug log Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-5-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=861; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=7a+Jv/sysSvCd9GgBokRdDYOqlTm04F/cT7DP1ztyWA=; b=yUwadXileWxfaXhhsoyottKwsdmIg23ZJsFROqUlA6qIGvuEPkkkn3orZJN3IvkPzyirgjsLE MqZXzAIGXIzBhXzPkTyJQsVuGJJrH6BGWxu3m7oXuyi94i1l4xyzIAG X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Use standard resource format specifier %pR in debug log. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 463a207c6a76..80e183b6e4f1 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1519,8 +1519,8 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c_new_client_device(&i2c->adap, pdata->devices + i); } =20 - dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n", - (unsigned long)res->start, irq, i2c->i2c_clk); + dev_dbg(dev, "mmio %pR irq %d scl clock frequency %d\n", + res, irq, i2c->i2c_clk); =20 return 0; } --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4AB7930C37A; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=SrE9O4/isLnal1TJuCea7PmeBmuJVQgBWliVwtX8r5tfToytgYXeoHd0ymOZHF7bmFAPX+vB6eNzT4Q/0ahTlbEpAKhyc/K+0wXl9FUS5//eUXLBjiNVGkpM5ieCOe0dzq3Uo2JOYgS040aRbo7Jm1JwRheH98+NLLI3AJlGp9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=aS/ZRjoiK2LzRii4KCSPVSdnQuMx4YxvC8udAKmML9g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b4s4aFI1y+EeRPBpFqNuodHjbs7+8FWfbRBRx6Lmwg9+gPJ5rWWE6oqW9+3I4AoBMhE+6UTPk4MbxYM8rT8j1QO9xk/cJ3O91+Wm0qKjHRylTeQrht+nhXNUZO1h4cRrKQ6HRIdTq5jFUtQHtSy5PjWCwk2Cid6S8eUJRp0PoIg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W5U9TMfZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W5U9TMfZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 19893C116C6; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862360; bh=aS/ZRjoiK2LzRii4KCSPVSdnQuMx4YxvC8udAKmML9g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=W5U9TMfZ8C4iTzgII0YR77aGQJuM2HtuY435Wtadkk9e54++orTtoYC2nuKyOiWVm T/TzbWmn0dSA+tZjdZ3BzmbDO2ZQS0zNYUpTontpQJ3IAiN9VkGLsFTzX8vskfPYiy kwh3QmK0PwqlBcU1/CVjZGrZbGs7xESbxxV0NJf+WRm8MZGOE+MWs8uN7sIJZfLboX xnDjj8tYAkBODhm17NLSIIi6dW7DnNdk/JOoxhILc1S8oTNs26xL7p9c4h08qcvnWx NBJ2jPVhyBWQ6WmVr2WQRJoqN4YdKn1TLvPfS35N/cvSBe5GCXRxVlrnkhrQoJnze3 fkUkE8/oOFB+g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 120CEEA4FD8; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:21 +0000 Subject: [PATCH v12 6/7] i2c: xiic: use numbered adapter registration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-6-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=1439; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=eIOcBblyySq1mWQBgk0IUkRMweSQ1d65J0ODZqXKZI4=; b=8vXZvuulE0Ks2TJqBEbHU1I2pgJzSoKrG5A9J4ziNYQpK8nUXdD/nDJb++lwHJPY4QS14WxP6 xrf+lRysHq4Czbe7iFhHw55RRUixYkxmiA+Q7LmrknD47zXdjw/f4KK X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Switch from i2c_add_adapter() to i2c_add_numbered_adapter() to enable platforms to specify fixed I2C bus numbers via the platform device ID. This allows systems to maintain consistent bus numbering across reboots. On platforms where the device ID is PLATFORM_DEVID_NONE (the default), the adapter falls back to dynamic allocation, preserving backward compatibility. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 80e183b6e4f1..6eb0c6a2618a 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1451,6 +1451,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) /* hook up driver to tree */ platform_set_drvdata(pdev, i2c); i2c->adap =3D xiic_adapter; + i2c->adap.nr =3D pdev->id; i2c_set_adapdata(&i2c->adap, i2c); i2c->adap.dev.parent =3D &pdev->dev; device_set_node(&i2c->adap.dev, fwnode); @@ -1507,7 +1508,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); =20 /* add i2c adapter to i2c tree */ - ret =3D i2c_add_adapter(&i2c->adap); + ret =3D i2c_add_numbered_adapter(&i2c->adap); if (ret) { xiic_deinit(i2c); return ret; --=20 2.52.0 From nobody Thu Mar 5 14:46:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4C50630C37B; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; cv=none; b=g6zAZGpKz6W40P+BTGJZxUYndxEc5BhaWjegc8WRfqCqbzvYbZL8FVRv2btpFyu6w7hxTWHHCh3wfVMSJfPvCrOln7SlGiv3ULCHXT1SST6biNIkHm0gOoA7y1r6jNX5oTJOjIVmH8isE2tir+IC3TBrYAJ7HtM9wqaiXtVATEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=8VgLBNuTxD72+GI4e0fkK8v9sYu+VLaZ56iTicorfVQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fttUEU4kCTAsStj99StLfOQS789kifzFgH+YgZmUo2T54nnIMAsa2aIbJDEgO+z6i8clsjrdJt2YYoMJnZQWB3fmLS2WPsP0yvzTt2phRABuO2ieDbLmVKgj+dZ7PJwj8DbLwY1fwp0P1PkXqIzN/V4bHDkWw4XoR8obm84iz/k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NUXNpPay; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NUXNpPay" Received: by smtp.kernel.org (Postfix) with ESMTPS id 27EE9C116D0; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862360; bh=8VgLBNuTxD72+GI4e0fkK8v9sYu+VLaZ56iTicorfVQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NUXNpPayyGsKW9S8uDu3RI4dyDMmw9yk5MjGvGpU8WVZ+jR+qRN/wmS18qegVP6Um U0n0Nt4f1xPvKSuGcTMmcz2Xcjgw9NrbTIF/D4zSz19Zhzn0zmjnCPiind2d2aVGyE 7oO1zsUEGWJrje2+ZGsnWnxTmSPApUxGaA/0yaFY+r9/mvl7v+cRKl4SQG4QyculwA VCgQjBZTpGlE8+QPsdDiUklj2vQnIxb9xCkzKr9ii9qD/HDOu8CSP28B9geUCBw3sR 531w9w3n832apGGrB1OCMGMShZhqUyT/+oP8ot3Y1cupMxpodQht5IzInp3XadJ7kJ GzOUsFKRgUkGw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 202BDEA4FC7; Mon, 23 Feb 2026 15:59:20 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:22 +0000 Subject: [PATCH v12 7/7] i2c: xiic: skip input clock setup on non-OF systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260223-i2c-xiic-v12-7-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771862359; l=1194; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=usc1CKg+f05YBR4E4GFMUb7OKXzoYUSPfhhuE4yE/XA=; b=+y1k9kEklzjax8kw0/GxG/XFD+YRKhH4DvYmswPoEay7CKIIqzhSrJB5CtDpA1+ol87X1I/6o wBmNI3aTuLmDsP7/x9j7bzPOs5MdZ3A0bhlLvxYUcuC5Ia6PtpP5mJV X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Currently Linux does not implement ACPI ClockInput() resource to describe clocks, unlike DT. However the xiic driver is happy if something magically enables the clock before the driver probes, and does not turn it off again. The clock should always be considered optional for ACPI. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 6eb0c6a2618a..3e7735e1dae0 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1464,10 +1464,12 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =20 spin_lock_init(&i2c->atomic_lock); =20 - i2c->clk =3D devm_clk_get_enabled(&pdev->dev, NULL); - if (IS_ERR(i2c->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), - "failed to enable input clock.\n"); + if (is_of_node(fwnode)) { + i2c->clk =3D devm_clk_get_enabled(dev, NULL); + if (IS_ERR(i2c->clk)) + return dev_err_probe(dev, PTR_ERR(i2c->clk), + "failed to enable input clock.\n"); + } =20 i2c->dev =3D dev; =20 --=20 2.52.0