From patchwork Tue May 30 14:56:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 687058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D209FC77B73 for ; Tue, 30 May 2023 14:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjE3O7g (ORCPT ); Tue, 30 May 2023 10:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232505AbjE3O72 (ORCPT ); Tue, 30 May 2023 10:59:28 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA57114; Tue, 30 May 2023 07:59:05 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QVwQS2KXmz6J7S1; Tue, 30 May 2023 22:54:08 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 30 May 2023 15:59:02 +0100 From: Jonathan Cameron To: CC: Wolfram Sang , Niyas Sait , Klaus Jensen , Andy Shevchenko , , Jeremy Kerr , Matt Johnston , Shesha Bhushan Sreenivasamurthy , , , "Viacheslav A . Dubeyko" Subject: [RFC PATCH v2 6/6] HACK: i2c: aspeed: Comment clock out and make reset optional Date: Tue, 30 May 2023 15:56:01 +0100 Message-ID: <20230530145601.2592-7-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230530145601.2592-1-Jonathan.Cameron@huawei.com> References: <20230530145601.2592-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Needs tidying up - hopefully can do clock right using ongoing 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 --- v2: - Use optional variant for the reset. - Left the clock with the hideous hack to keep it obvious that it is a hack given no way for us to get the clk rate on ACPI firmware yet and I don't want to pretend there is. --- 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 ae8e187f2233..f0b5789aee21 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -986,14 +986,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");