linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: <linux-i2c@vger.kernel.org>
Cc: Wolfram Sang <wsa@kernel.org>, Niyas Sait <niyas.sait@linaro.org>,
	Klaus Jensen <its@irrelevant.dk>,
	Andy Shevchenko <andy@kernel.org>, <linux-acpi@vger.kernel.org>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	Matt Johnston <matt@codeconstruct.com.au>,
	Shesha Bhushan Sreenivasamurthy <sheshas@marvell.com>,
	<linux-cxl@vger.kernel.org>, <linuxarm@huawei.com>,
	"Viacheslav A . Dubeyko" <viacheslav.dubeyko@bytedance.com>
Subject: [RFC PATCH v3 7/7] HACK: i2c: aspeed: Comment clock out and make reset optional
Date: Wed, 31 May 2023 11:06:00 +0100	[thread overview]
Message-ID: <20230531100600.13543-8-Jonathan.Cameron@huawei.com> (raw)
In-Reply-To: <20230531100600.13543-1-Jonathan.Cameron@huawei.com>

Needs tidying up - hopefully can do clock right
using on going work from Niyas
https://linaro.atlassian.net/wiki/spaces/CLIENTPC/pages/28832333867/ACPI+Clock+Management

ACPI does not provide an equivalent reset deassert / assert. _RST
doesn't fit that model, so for now make the reset optional.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
v3: Keeping this as an obvious hack rather than moving to something
    that works in the interest of not putting a stop gap solution in
    place.
---
 drivers/i2c/busses/i2c-aspeed.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index e262b06e224b..e29e7effd911 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -987,14 +987,14 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	if (IS_ERR(bus->base))
 		return PTR_ERR(bus->base);
 
-	parent_clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(parent_clk))
-		return PTR_ERR(parent_clk);
-	bus->parent_clk_frequency = clk_get_rate(parent_clk);
+	//	parent_clk = devm_clk_get(&pdev->dev, NULL);
+	//	if (IS_ERR(parent_clk))//
+	//		return PTR_ERR(parent_clk);
+	bus->parent_clk_frequency = 1000000;//clk_get_rate(parent_clk);
 	/* We just need the clock rate, we don't actually use the clk object. */
-	devm_clk_put(&pdev->dev, parent_clk);
+	//devm_clk_put(&pdev->dev, parent_clk);
 
-	bus->rst = devm_reset_control_get_shared(&pdev->dev, NULL);
+	bus->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL);
 	if (IS_ERR(bus->rst)) {
 		dev_err(&pdev->dev,
 			"missing or invalid reset controller device tree entry\n");
-- 
2.39.2


      parent reply	other threads:[~2023-05-31 10:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 10:05 [RFC PATCH v3 0/7] i2c: Enabling use of aspeed-i2c with ACPI Jonathan Cameron
2023-05-31 10:05 ` [RFC PATCH v3 1/7] i2c: acpi: set slave mode flag Jonathan Cameron
2023-05-31 10:05 ` [RFC PATCH v3 2/7] i2c: aspeed: Use platform_get_irq() instead of opencoding Jonathan Cameron
2023-05-31 17:41   ` Andy Shevchenko
2023-05-31 10:05 ` [RFC PATCH v3 3/7] i2c: aspeed: Don't report error when optional dt bus-frequency not supplied Jonathan Cameron
2023-05-31 10:05 ` [RFC PATCH v3 4/7] i2c: aspeed: use a function pointer type def for clk_reg_val callback Jonathan Cameron
2023-05-31 17:42   ` Andy Shevchenko
2023-06-01  9:07     ` Jonathan Cameron
2023-05-31 10:05 ` [RFC PATCH v3 5/7] i2c: aspeed: switch to generic fw properties Jonathan Cameron
2023-05-31 17:45   ` Andy Shevchenko
2023-06-01  9:08     ` Jonathan Cameron
2023-05-31 10:05 ` [RFC PATCH v3 6/7] i2c: aspeed: Set the fwnode for the adap->dev Jonathan Cameron
2023-05-31 17:46   ` Andy Shevchenko
2023-06-01  9:10     ` Jonathan Cameron
2023-05-31 10:06 ` Jonathan Cameron [this message]

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=20230531100600.13543-8-Jonathan.Cameron@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=andy@kernel.org \
    --cc=its@irrelevant.dk \
    --cc=jk@codeconstruct.com.au \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=matt@codeconstruct.com.au \
    --cc=niyas.sait@linaro.org \
    --cc=sheshas@marvell.com \
    --cc=viacheslav.dubeyko@bytedance.com \
    --cc=wsa@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;
as well as URLs for NNTP newsgroup(s).