From nobody Mon Feb 9 14:02:21 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 43F3422CBD9; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=NCWcuEwD91+p3SEVIT1/+0Z6rGUOr8dQmaytrrtfAWqlKPdBaoG7qQ50ac0p7g5IbWc702YNMz3ORl7PBHR+FisxGiABbW+XwofaXyGUwInT28JxIlDuqcVZd/Jl+TLiVkHnB4USHCKYFCAeTYBI5kE7zjCfyLTBx1RTqneQsI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=wzyK5C+7gEBOnnJZjSZxVGWBnuD0tO8LwZHYRLn2itQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AmeGVKVeJ9cXdkCfBqCCKva7fCx5FTyFP4mw6RTtw2iXhn5ZvNzxiYm2HVV3djadAbCRT2SXofhNNjlo3Ge5yyOBxfZdhDgn9c6SCTvtO9My4ZqhtZLt3y7xLJCT0u1bc2DmPhfuzrV5XDGxGG/fM/Z80ztIXZCvNTmPRmTI5f8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sCKvXOY1; 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="sCKvXOY1" Received: by smtp.kernel.org (Postfix) with ESMTPS id DA190C4AF09; Wed, 4 Feb 2026 07:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188525; bh=wzyK5C+7gEBOnnJZjSZxVGWBnuD0tO8LwZHYRLn2itQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sCKvXOY1jv1KOe7xm2SVSKAfqB0F+wGYxNkM9pzhvifTwHscORG1GbPl0UiN285lX aA8fyBBckb1o71ZvKhvt1V208qf4NMrgUCUHZ5E/F4hCQi44aG+g/jVmboD7O1vk0N 7QwVGwC9CFhRQrirhm2k9UZuCaytYtXAPsNKxIsm6OhGw8F74b0gWrKXW7PjtMm6kv jIA0jkn6beXcYohQYdkqjcyDc4/j8e25358l5Qk811JrjVgC+WbvMVWesAw8USEc3B kOI5VWY+epJqa0Fy8mDbdHXxO6cPKmrZ/OQj6zwPx6PU7s361bfbmI4sxcjqGP8zoq lwxXhL8RAPqMg== 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 CA2E3E83045; Wed, 4 Feb 2026 07:02:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:01:58 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-1-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=2947; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=W8zDDZw4EUzfrNuEoTOo05XNo8J4+DIsLswOSdxs308=; b=aGhVC49StH6HFYGOKzGU8CFQNZJCGmd0NWIkD2KRvAMq8zoXduVw9n+v7ZJDNpFDL5T6Zq5ef x06aqucwIQCAeH/51LY1AaKa6jwhGuXCmL/KXIEDAzMNV4H4aQYJQ7m 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 | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 28015d77599d..16ff83fe280b 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) { @@ -1529,12 +1532,6 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n", (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 @@ -1555,8 +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 --=20 2.52.0 From nobody Mon Feb 9 14:02:21 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 43ED5214A64; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=EJB1zkuYqgv6SOr/th/4NtkBiCk2BWZ5Y8/FsVFD4KiOEMBzpq1cOC+YOfHx3qWApptE0vOTAnY4l+f0A0g49eoeWIRaCrVuHEnMuTNNWoK53CcyrXMT9zDtzNNw2yqsILENxGqctmkL+IxRITdaNlAoG4jWgnvi7LM+BmNXOpE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=9NOBASfi7anGmRe6t5aBWM/Ma9uXjL5J+KNCF/CduQY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QKR0qz4fW5aI2Uvunr4jiOVGX2mPqX8Uo/azG24LJFZU/hD1sBCPGteUszOMQ11+/AfpJvW6EzVQW68S2kjTp1NR/OS9QCo7wTLOzG2Wgtrrl9kYLfx+ZX9wWrH2/rc7S+Gxvrx2E7aSMd72DJiD22ZngQ3dZIBdpPyvb1DUfjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jsWNPmDR; 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="jsWNPmDR" Received: by smtp.kernel.org (Postfix) with ESMTPS id 082DCC4CEF7; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=9NOBASfi7anGmRe6t5aBWM/Ma9uXjL5J+KNCF/CduQY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jsWNPmDRZ85oWbZXtLagXOGu5HAkQ6Mgvjg3HHv++seCo5dJYY7KZnH3CEj6jW0FZ HEn25k25i7sOZHP2ZJi6ABrnxhUIix2n+75cQwnRQRWFGNpmZQSLQaYj2qNz/bbMTX EZs4G58Gu7wGKeShyDnE0/mwnlk/e8jN1wrhqmSuqZL+nl9k5ZLG1MCf/HLagsRIIX PiwQs7xwz0YQFIGg9ihXaFR5e6pqiWpYCA1ICsyG2iguhUL7AY85d3n9tFawo2OMpd 8eqg2RJWlhWwhXM7cJU3U4ckTYx+dxyVNt3btBjhnnimMUjl2VyJgLCxTpBd5t21CM Uu2ohpTShJA6A== 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 E8560E83046; Wed, 4 Feb 2026 07:02:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:01:59 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-2-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770188524; l=958; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=KsvKdIRhjvHhQgBTA+p4IEJ0A4qmuGyZ80lYOv0Q75M=; b=ufqp1GSog2x+XC55gJykBp5HNgxRWON+z4LqmAJybnGnJH1/Q/fAsVXn5SVvn5oIVCBZZnKrN jkxUwQ/API9Cw4Bxm9qLa1wSdiieH3WbQyY+EABioxMiTEYwy/ikiTR 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 Signed-off-by: Abdurrahman Hussain Reviewed-by: Jonathan Cameron --- 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 16ff83fe280b..4cb7c40fb565 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 Mon Feb 9 14:02:21 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 55789261B96; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=jh+i5X+033b2KXNDdgTPi6aEFCPrA0HDcqiFT0CY+yoUaUWevvxYfEuqJrssUEy9lqBq7ffILeMU6XWRgrRsJxxSG1y8t4OHxIXN+XMtEeCPmAwg4QHnOUWxxiE/9JCTo8sguUeIh1lZSuJAyTBVQJbOCXp4cwfNQqIrEZ5kIKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=DPRlDntlu0iKeJf/CMopdHlJpBQ0BaeVB92s+jp4gPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U7SgXy2Rapiq37qKv261Mt4XUKb9AzEPTe20OskhDk0I7LU1mL6hnLaFE1Fh3PZuIELXXZwjX1H25QDUshmkUxcpRRbKrNBUAjvi8YKHYwA7PEgSwZDZE7fo56ROPP27G3a0XJApx/JNZSJA5hUmWLNymqcvVeDjZp9pdxa9XTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nF+ZS9qP; 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="nF+ZS9qP" Received: by smtp.kernel.org (Postfix) with ESMTPS id 33FD5C2BC87; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=DPRlDntlu0iKeJf/CMopdHlJpBQ0BaeVB92s+jp4gPI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nF+ZS9qPwTJ5H26J+elkSzW+G0Dba8Hov7dKIVBDV2bm2TZwoHDmHZYkiTb/qPqJp fo/5THFxpDHL0JKnTGwefKbjPZwh1Thp/YvKCoH7Jw1s/Pb9hzUOG85QCJYbfj5Psx kNeWvje5SXoGM1WCFz8WY+laj6anc5jgHahSPDwcmNoHvjkW/nJkJZj0GHrEkjoHRI ZaUpbqx8v/uD32qu290cOYRyiiC9uRU5VppNOr1l2plnMu4TCj4u5swU+BaCYsl4Ok Ihq9upqLcIHKD5AiJgAnL2weoXirAR1LmzeWo2tSod4BrfqeuqEu9Ts608+V4T6apw TjnQrquHkdfyg== 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 26A2EE83041; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:02:00 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-3-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=2990; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=k0KDwbzoPFBnih9Js9Y0osMzTW9DrweWovD0ZQMqow4=; b=UGg6s3GVWItBMEb8A2iHPTZbMwa5XEZyXRL5nZYANVQluKIS0FuXYPGC7iW9yUf0FoLAU0WDW 6A05pVL50L1CFBglSrooA3X6dlmtPo0O334gPrK9272HX8mvFikkV1a 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. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 4cb7c40fb565..60d417a2266e 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,13 @@ 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 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 +1433,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 +1452,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, dev_fwnode(dev)); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 @@ -1482,8 +1476,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 +1487,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 Mon Feb 9 14:02:21 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 7788A38945C; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=LPKi1dmNXJj2rTXQY0vYNB/CLJXFCW6bGksOMK28NnS8RT06QY/4UfhkVU0kVnxbVLDIhoC4m0anWq2kuLXaNOhru5wXsil7qvuvsWmeWQTTY2kNY7bM4Zi2ORq+8GqMqlihlEAPnPIZChMkc4E/o9tfo+8xSTEl9fw5KXTHRGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=60EH9iP9HmNzp18ZUEFLtUf3H/EFKdrPbYu5yzJu8k8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h7PBqxtSOsYblXfNgbmIdhnaXDwx2YIEs3n/IRtv5mq0IZWjvYDIAK0Pn07qbFhJcqsXqVh8Ek2ggASem0FUjTbtEb8S19VpRG+lAGuOS3+ySiUtt93d4x5a4N5eTmZFlGQIikMY6w41bCvjWmqZOrjwXthLuGNpKBS8ddVkyjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ldNFtRcR; 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="ldNFtRcR" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5670AC2BC9E; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=60EH9iP9HmNzp18ZUEFLtUf3H/EFKdrPbYu5yzJu8k8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ldNFtRcRhtO5pOA4OsvNIf8mOe7bRJ0iN0awlzumvXinxp8p9jYC+3kMkSDN9kvaw NTwpQ5cgEIxshtkK2nP3esefXDrC8Do78lTfS8CF541EA86ve1ZgJ61dWOknvo+3mF 4E/p9TcM4CrD1vUe8xMIi62NGAmv7gAW/pz66uDH66nEnBaYBR667/1boOdck7/ZL1 RYFgJcJWEZodkwchYFjMqpUrV2hzrtAce1qkFm3BB/fA6CqaIJqu9Q2U7RyEFfwVoH AkqsstQZvCo6HNX508CpyzO5OvlrdkGLfzwOcc6tp9L8EA7Z3yucAxDM4t38erChPn UOpu40+bI7Ugg== 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 4ED6BE83041; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:02:01 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-4-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=3060; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=YTki9xJTvSuVF5CD1T42EpCfReuFINOTgQnJur8AZtU=; b=uolx5i1qh66Da4dUoabX5Pe0Iljywu203XugLtXhEWjVL6AhbwCtnQQZ28/fVfeErDNpnP2na XmJbdQVUEmsB7wKb7X2ndsrCM66/NCIsfuV4jEuLfYZaIuTdJ8IquBq 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 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 60d417a2266e..bee663f91f10 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1429,7 +1429,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 @@ -1445,13 +1445,13 @@ static int xiic_i2c_probe(struct platform_device *p= dev) 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); i2c->adap =3D xiic_adapter; i2c_set_adapdata(&i2c->adap, i2c); - i2c->adap.dev.parent =3D &pdev->dev; + i2c->adap.dev.parent =3D dev; device_set_node(&i2c->adap.dev, dev_fwnode(dev)); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); @@ -1467,9 +1467,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; @@ -1481,9 +1482,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 @@ -1526,22 +1526,22 @@ 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_dont_use_autosuspend(&pdev->dev); + pm_runtime_put_sync(dev); + pm_runtime_dont_use_autosuspend(dev); } =20 static const struct dev_pm_ops xiic_dev_pm_ops =3D { --=20 2.52.0 From nobody Mon Feb 9 14:02:21 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 B0CB538B7B0; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=hB1gv/6xMTx5bfALYQBQhYkrQTded+vUrGhPMLzwlTEG9SUmZoO7UN9CMDyBu4zYSra19M+ZAQTJUThuW1rwlWAqHs5VF713ifPpW/Qfitbnd0KtXBw1IRKrmBhDjZu/balhgP1+rHd3y4HDpovM2qyQntAogWbsHlVGkYAetdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=LxoVmxDXXmBVVhAwbDaeJQFyxYsskpuHqN1apdaJrQA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TAXrwOGvZeTsDrK1MGSl88uPfDuo1WlWOZVqCLY6N2ooPCThIIp3gkQ70mn3KxhnTb2oWE+RsJcnf1t068NSlMv/TqdDXYFnVvz1Y7wRCQwU/KtCuHzQ9wYvT9Vntb25QsL7HWnifJvfcPUKjqCsqxc+QlpzroPNS/PM1kgGhZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qvOsPjvl; 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="qvOsPjvl" Received: by smtp.kernel.org (Postfix) with ESMTPS id 808DFC4CEF7; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=LxoVmxDXXmBVVhAwbDaeJQFyxYsskpuHqN1apdaJrQA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=qvOsPjvlRvEeB863eDniO9/cNx7xpbkYJ9PJs/VbIhCsGngxfWlzo4lOlhI/pu9ag zZROTKOdwP31rUV9F7m9GTvhGzE5fCKFRKoeuPcR/tGDAIxkRE3p01Va5LO+0mu20h T92AsDvX7iG4LGarkrbNIcmASwodrhrQhLEDijLL2jrfr6/rP+mPILmoLttAwY0qjz RG9bzhBjUT/6x9a58ZagjIwejDimtSrsMGARyt1hLuq0T3KMqy7AXbKkKB8I3gjkvP wxvBFuLMNHQmviO8rq5v3ndrIfEyj1gltGLVgP3Dllk/+QelAOT30cVhLXXCTy7Vyg iEJacJnlPRJOg== 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 76DEBE83046; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:02:02 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-5-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=863; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=GiIahtjK7bofJukLRpl9r+0ubtXiljSfc9Z/DVdZ0TM=; b=72tWL1XIDqJBVGstyFSC+vlQjYPs0Sjvsxzk1Ub8ypO9jg+iDiKrYc6LfJ3ZUZlGO7gBgoIr5 drnWtMdenUhCSAMUvkhIIcVBdRzS60KY3L5S2CcYi69rBSj0iG2aAiV 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 bee663f91f10..eeb8ba8e131e 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1518,8 +1518,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 ret; } --=20 2.52.0 From nobody Mon Feb 9 14:02:21 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 D9A6338B988; Wed, 4 Feb 2026 07:02:06 +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=1770188526; cv=none; b=oaUd0aMiBwFKxnMhv2nAHZI3+bFzxBLYpLxYRvabwRkLZL6q6wHG/mRTYifG15Ctu6HAXAmHnvuio5ZeK2xVOMetqPChJ6GvZlcqrCjEn0LzxYmNO1gK4j1cvi9T0/ukZAqml/p2AaQriN/3mLOASUBcSqZWL++UlHz+rbAgpx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188526; c=relaxed/simple; bh=SgLmwwZ152akW02BJtaThcmesIM6AsNkaiZ4XeQDmjY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DJW3StPzjlBxG+tfLTpMgNzQSmlztVlBDXCCPMrHr2v0D0ENTWsV6h11s0dNWwMlsB77emYCRk5L8G9RyE9yDjYFyLhABL4rIWx0NJ2/g/b6F3rl809sC9FYhc4MwqVODC2jkmRP6rC9/mcE7ozl6rqiQQ0nzJD3cBCUJK5k0yU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rgcNqFB2; 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="rgcNqFB2" Received: by smtp.kernel.org (Postfix) with ESMTPS id A2580C4AF0B; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=SgLmwwZ152akW02BJtaThcmesIM6AsNkaiZ4XeQDmjY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rgcNqFB2cQy9YhQbk9Hb6ubSDMHG9QsSC786tuid0J4sImjgh2In9a1qBiRj4w5GK hFxUoGz6gDOzYuwsQVPt+OEv1TS8ZmIFxAKd3HFsTNCK5eZD6jeoTyMGRZzKg1nTJr JZRLB2brY1f1ohbN1yBDf+hOG67D6ButbqjjXLSs3uPzYlgVNaPG1pryQO4LdpaUrq qEkUWJJ6l118K71ilJxqpUEn8JKSBNu98vGtyqA3+B2Zkd99gHBHMhQcc7dlTBnnkB gpcKui7F48oM3rpWf2dDuyqaPcypAu5d8ONvjopJy40gsdUXC7naJYftnKfmXFX4fT zABvi/SL+chHw== 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 8FA83E83045; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:02:03 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-6-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=1381; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=xL4GGvzfnOUyOBc311DCeHt6htrYyvg0WAmQadldh3s=; b=nvaPtX2WYKN5A3mJFxAnwPiuL2SSR134HGJkyiILe/FgenSTGKQb4DjMLd+niIVWcaCeyd3yP dzeDfcjeizUAzFaYnYmR9yFPCbzCnNYOBUIWbjMLg3plWekhMc906Pc 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. 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 eeb8ba8e131e..2c0470452221 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1450,6 +1450,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 dev; device_set_node(&i2c->adap.dev, dev_fwnode(dev)); @@ -1506,7 +1507,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 Mon Feb 9 14:02:21 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 1219E38B9A4; Wed, 4 Feb 2026 07:02:07 +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=1770188527; cv=none; b=vDOfzMqIleuRvrZaXTKhKGv9jUkdYAiI0RPnQ67DwOQ7z7TnLRx9VtCQVT/87JRanVs3Ra+G8Ab6d+THkmnTPubM8TDH1Hc+Rd07Rs1mBoPkDRF3CmLt0kEpICGN5/mowmnO81GBNovlatR3brV6r72qaPf9b/3QdFLyxGDE3Hk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770188527; c=relaxed/simple; bh=4+G4utc/06tDm3FrxJFapDNzuA7QGnO1MVuLuQtaqfE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ThBKLFbN72GyCD/n3cL3BngSZ8aJ0z8+RfpnP4ww47EaaFe+jlSli71OA5QIXR/umuDE1rqhvHIu/k5kU9hU0mDjJNKukgq2DkZiiJ4MjaYY6uzthf97c7ZsdoZDwRG0UhP0UC8SOZQsunX8MJLf2VdxiybpbUvtCe2BcLPw+xQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PDh/nPqy; 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="PDh/nPqy" Received: by smtp.kernel.org (Postfix) with ESMTPS id C0906C4AF1D; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770188526; bh=4+G4utc/06tDm3FrxJFapDNzuA7QGnO1MVuLuQtaqfE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PDh/nPqyJLw/v8SJSfIPqaysVcTa4uLnhPgy3O95qxubpfSA3abPS3dj9hFmEw+f9 oiBB/EEizPG3hjTco3msTreR2KCNkVLlzdEy61bp0CpgY2h9HzAx4Rs7+FGVC1lqmx RJ5Cm39irNfTfEAUM/UdYmPDFTEurfOAnkAHg6wQ10kb3iYTGhbWp9VoXTX75cFe0U C6S/mXyiR8GzRyWxEfAWDT/qE0oOmZ6Vh401FeTPZZqGXfggMGeqaJK9MkBwwqS2oJ 9PtHmdPLkL53UExBPsf0rMfEuhy7L2CLcY9I78BqqXA6xIuAm8nRDMrCUjb9PGwvWi fgtVXKitv5emw== 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 A6CD7E83041; Wed, 4 Feb 2026 07:02:06 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Wed, 04 Feb 2026 07:02:04 +0000 Subject: [PATCH v10 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: <20260204-i2c-xiic-v10-7-c2b996425235@nexthop.ai> References: <20260204-i2c-xiic-v10-0-c2b996425235@nexthop.ai> In-Reply-To: <20260204-i2c-xiic-v10-0-c2b996425235@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=1770188524; l=1203; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=tYS/VjjyJSR7laAGSOlbLWbUAEEO7GSJdraxofdKYu8=; b=reH74jvc9iL/OqdvmPi42fqas2VeKfyY9DxbAVuLmBwi3xnNMpx8UHSJJ9L5TMMcgviHbDYj8 0aU2eko7nQnDAICiEOQKoTKw5iHIV/jk8V9JygEwS98ZQ8s3sFNcHeX 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 2c0470452221..223074e263ee 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1463,10 +1463,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(dev_fwnode(dev))) { + 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