From patchwork Mon Feb 6 15:29:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 53369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2299683wrn; Mon, 6 Feb 2023 07:33:17 -0800 (PST) X-Google-Smtp-Source: AK7set/czHIitvLlo/L+pnYhpp1Nk7ngMN541TXg5/Tj05Jo03H6pE3Bevs2DMTDGdeps0c2PE3L X-Received: by 2002:a17:902:d14c:b0:199:1804:248a with SMTP id t12-20020a170902d14c00b001991804248amr78243plt.5.1675697597035; Mon, 06 Feb 2023 07:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675697597; cv=none; d=google.com; s=arc-20160816; b=XaLt931E9/bA4iHEZRpSqJs66794ZRQB2CCrkgYHfXgtslpTvxwnSeLCKOzBUtw5h7 MI+Of64/suUS4JGRYKMMsPH9t86XgYn3mxNuTsbZESsPdmEFLuEHHYaNnbqSk9V25eKt 5yk8UbCp00ie0y6tIgv+pMPtBuxaGRMEU4e6OEwzxfd3bGljNeQEUCgcC/bVKPXzfeb0 voUQJ5JcBqzwsX6J9yEjvHd7v82RU4qIizW5xqLCcLLcN79dm9CnIdRVPmSUAfR7ZzAH uFaOTSmE3JqY7/6R7wIVmaa7gx8G0emecQtft13dxlX1uIr+J8P1jjQAIZ8OXY5JH+ar o43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1GMwnTz31dwY5w4/UujnlmRLnK9RsxnZQnd9JSmeCV0=; b=HpIakRAO4VwQ/DZdGrIp2ri+/Rgph6R9CWartqgGftGAepEVRPLT7ZWOSKldEE206Y Jt2flNl68EZh+OlxMkiE9hH92BgE6LxL2e2wmBxb8V7J9R5dM6AB/d8WPnoKNYUIcYGu K8Ts4Qw/pSeOFaGu4JBZzlW3xxzTYQuXsPnmzoFILBtA8ss83a5MFujmPp08HZnNsX0T 3uIOY1ItRsqQcUDeIAcOPOpKsdD4ClEn2W0JjUxBWEJcL3g6ytr50OfBSf3Q8Y3IXjFm +YMNQf8g4Ji6MNIDI0tJm0+6pWAEncifAT+LCN1J+q3wRPsjTc3zNMeWQM39gPTNb0WX gpLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=J4Y6OFmW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a170902a61000b00199200945a3si1650055plq.74.2023.02.06.07.33.04; Mon, 06 Feb 2023 07:33:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=J4Y6OFmW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbjBFPcV (ORCPT + 99 others); Mon, 6 Feb 2023 10:32:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjBFPbh (ORCPT ); Mon, 6 Feb 2023 10:31:37 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0386229E34; Mon, 6 Feb 2023 07:30:30 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 341AD6602EC7; Mon, 6 Feb 2023 15:30:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675697425; bh=0kWW04N0/BjvEpixwEIQgKBSxcuMk9Mof2jf7jkgf4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4Y6OFmWs6jhdoG/T/7zmdpgRedHriLd7u4V9yyqtLxB6WtA5yDV8LO1IcM5kzVV5 fgov52D7Y8Fz3sM99970F5qyVFecwRN5ZRd1xQ+iFOhrpEUt0MeX3mFcU0mypUJJSC OkosYrT2kfG178ka6NRz/W85M+/+FEVWCevCwPliKtPlQazjPuY1tK7ogzAvwt3L8F 0wmqIxLD31J8ScXIIbkT97LyuWCJ98n3M99zBOY1qh8RmTQMoLwG534COW8ZXY3aaO +wWvRx3g5EQlrgF12NJX2ed5MHutkw3oNL4ee/pYz5KnayHBffiPiEDgnzQSbfDUEc 45tOsTZnL/UWA== From: AngeloGioacchino Del Regno To: mturquette@baylibre.com Cc: sboyd@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, johnson.wang@mediatek.com, miles.chen@mediatek.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, fparent@baylibre.com, msp@baylibre.com, nfraprado@collabora.com, rex-bc.chen@mediatek.com, zhaojh329@gmail.com, sam.shih@mediatek.com, edward-jw.yang@mediatek.com, yangyingliang@huawei.com, granquet@baylibre.com, pablo.sun@mediatek.com, sean.wang@mediatek.com, chen.zhong@mediatek.com, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v1 28/45] clk: mediatek: Propagate struct device with mtk_clk_register_dividers() Date: Mon, 6 Feb 2023 16:29:11 +0100 Message-Id: <20230206152928.918562-29-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206152928.918562-1-angelogioacchino.delregno@collabora.com> References: <20230206152928.918562-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757096283631155662?= X-GMAIL-MSGID: =?utf-8?q?1757096283631155662?= Propagate struct device for divider clocks registered through clk-mtk helpers to be able to get runtime PM support for MTK clocks. Signed-off-by: AngeloGioacchino Del Regno --- drivers/clk/mediatek/clk-mt2701.c | 2 +- drivers/clk/mediatek/clk-mt8167-apmixedsys.c | 2 +- drivers/clk/mediatek/clk-mtk.c | 8 +++++--- drivers/clk/mediatek/clk-mtk.h | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c index cf74d4bdb75e..d175fa4390e6 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -682,7 +682,7 @@ static int mtk_topckgen_init(struct platform_device *pdev) ARRAY_SIZE(top_muxes), base, &mt2701_clk_lock, clk_data); - mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), + mtk_clk_register_dividers(&pdev->dev, top_adj_divs, ARRAY_SIZE(top_adj_divs), base, &mt2701_clk_lock, clk_data); mtk_clk_register_gates(&pdev->dev, node, top_clks, diff --git a/drivers/clk/mediatek/clk-mt8167-apmixedsys.c b/drivers/clk/mediatek/clk-mt8167-apmixedsys.c index ebd90365be5f..27597fdeb6e9 100644 --- a/drivers/clk/mediatek/clk-mt8167-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8167-apmixedsys.c @@ -109,7 +109,7 @@ static int clk_mt8167_apmixed_probe(struct platform_device *pdev) if (ret) return ret; - ret = mtk_clk_register_dividers(adj_divs, ARRAY_SIZE(adj_divs), base, + ret = mtk_clk_register_dividers(dev, adj_divs, ARRAY_SIZE(adj_divs), base, &mt8167_apmixed_clk_lock, clk_data); if (ret) goto unregister_plls; diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 39bd360aa0c9..7013340e116e 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -393,7 +393,8 @@ void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num, } EXPORT_SYMBOL_GPL(mtk_clk_unregister_composites); -int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, +int mtk_clk_register_dividers(struct device *dev, + const struct mtk_clk_divider *mcds, int num, void __iomem *base, spinlock_t *lock, struct clk_hw_onecell_data *clk_data) { @@ -412,7 +413,7 @@ int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, continue; } - hw = clk_hw_register_divider(NULL, mcd->name, mcd->parent_name, + hw = clk_hw_register_divider(dev, mcd->name, mcd->parent_name, mcd->flags, base + mcd->div_reg, mcd->div_shift, mcd->div_width, mcd->clk_divider_flags, lock); @@ -535,7 +536,8 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev, } if (mcd->divider_clks) { - r = mtk_clk_register_dividers(mcd->divider_clks, + r = mtk_clk_register_dividers(&pdev->dev, + mcd->divider_clks, mcd->num_divider_clks, base, mcd->clk_lock, clk_data); if (r) diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h index 554aecdc1015..b7a751861fce 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -202,7 +202,8 @@ struct mtk_clk_divider { .div_width = _width, \ } -int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, +int mtk_clk_register_dividers(struct device *dev, + const struct mtk_clk_divider *mcds, int num, void __iomem *base, spinlock_t *lock, struct clk_hw_onecell_data *clk_data); void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,