mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@kernel.org>
To: Michal Simek <michal.simek@amd.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	info@mocean-labs.com
Cc: Andy Shevchenko <andriy.shevchenko@intel.com>,
	 linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	 linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	 Abdurrahman Hussain <abdurrahman@nexthop.ai>
Subject: [PATCH v6 2/7] i2c: xiic: make the clock optional
Date: Tue, 27 Jan 2026 21:03:56 +0000	[thread overview]
Message-ID: <20260127-i2c-xiic-v6-2-e82e2f6f657c@nexthop.ai> (raw)
In-Reply-To: <20260127-i2c-xiic-v6-0-e82e2f6f657c@nexthop.ai>

From: Abdurrahman Hussain <abdurrahman@nexthop.ai>

The xiic driver is designed to operate without explicit clock configuration
when clocks are not specified in the firmware. This functionality is
already implemented in xiic_setclk(), which performs an early return when
either i2c_clk or input_clk are zero:

This condition is satisfied when clocks are missing, as clk_get_rate(NULL)
returns zero, allowing the driver to rely on hardware-configured timing.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
 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 28015d77599d..16202fb89271 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);
 
 static int xiic_i2c_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	struct xiic_i2c *i2c;
 	struct xiic_i2c_platform_data *pdata;
 	const struct of_device_id *match;
@@ -1464,7 +1465,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
 	mutex_init(&i2c->lock);
 	spin_lock_init(&i2c->atomic_lock);
 
-	i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
+	i2c->clk = devm_clk_get_optional_enabled(dev, NULL);
 	if (IS_ERR(i2c->clk))
 		return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
 				     "failed to enable input clock.\n");

-- 
2.52.0



  parent reply	other threads:[~2026-01-27 21:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 21:03 [PATCH v6 0/7] i2c: xiic: use generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-27 21:03 ` [PATCH v6 1/7] dt-bindings: i2c: xiic: make clocks optional Abdurrahman Hussain via B4 Relay
2026-01-28 10:37   ` Krzysztof Kozlowski
2026-01-28 11:21     ` Michal Simek
2026-01-28 14:34       ` Andrew Lunn
2026-01-28 14:38         ` Michal Simek
2026-01-28 14:40         ` Conor Dooley
2026-01-28 14:45         ` Andy Shevchenko
2026-01-28 15:00           ` Michal Simek
2026-01-28 15:43             ` Andy Shevchenko
2026-01-28 16:40               ` Abdurrahman Hussain
2026-01-29 16:14           ` Rob Herring
2026-01-30  5:33             ` Andy Shevchenko
2026-01-27 21:03 ` Abdurrahman Hussain via B4 Relay [this message]
2026-01-27 21:03 ` [PATCH v6 3/7] i2c: xiic: switch to devres managed APIs Abdurrahman Hussain via B4 Relay
2026-01-27 21:24   ` Andy Shevchenko
2026-01-27 21:03 ` [PATCH v6 4/7] i2c: xiic: remove duplicate error message Abdurrahman Hussain via B4 Relay
2026-01-27 21:03 ` [PATCH v6 5/7] i2c: xiic: switch to generic device property accessors Abdurrahman Hussain via B4 Relay
2026-01-27 21:04 ` [PATCH v6 6/7] i2c: xiic: cosmetic cleanup Abdurrahman Hussain via B4 Relay
2026-01-27 21:04 ` [PATCH v6 7/7] i2c xiic: cosmetic: use resource format specifier in debug log Abdurrahman Hussain via B4 Relay
2026-01-27 21:23 ` [PATCH v6 0/7] i2c: xiic: use generic device property accessors Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260127-i2c-xiic-v6-2-e82e2f6f657c@nexthop.ai \
    --to=devnull+abdurrahman.nexthop.ai@kernel.org \
    --cc=abdurrahman@nexthop.ai \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=info@mocean-labs.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®