From patchwork Mon Feb 20 15:00:47 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: 59513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1355179wrn; Mon, 20 Feb 2023 07:05:28 -0800 (PST) X-Google-Smtp-Source: AK7set/jRYnVze40kmANAoCW4VvSeNWKKrxa1Al8axnP6hSDouD7ZF4u0FbtXA6AK4xh5gwHuonB X-Received: by 2002:a17:903:1250:b0:19a:b59c:cd4e with SMTP id u16-20020a170903125000b0019ab59ccd4emr1834192plh.40.1676905528459; Mon, 20 Feb 2023 07:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676905528; cv=none; d=google.com; s=arc-20160816; b=WSx8mWuvIUZPBD8HRFv38iDeSAQp8iSmDQPy0y3r7ntFuXRHyrMwdEql3baJIOtZNw /Gy1pa4354f0/s0dCbrGfHGS3ye/fxknYzmQ0hbBQCR+SOriFLz8xiyypA9lM3/CmOzX yVyylqRryFojZ1qf2aC/pLtwxK9ANsS2+wuDb730AyY/hmsFKkpRY423BD7HcjwxNpdm dDXKdOZimq3wQtXJ9zLgupSpMh4ebKtrrUbT7hiXiDvhCSftNUGsRUf8pHoYNF6Ffpgb UNoc3JSq2b8xISbBRZ05729VebjJ0b8qFKiTNcJsQ5uGzJZC+KHm6/ytn4jBoxJcRleA ik0g== 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=oG2odSgD/IIZfJukt8IL0cPhHJ061lOLrthjgl99LzQ=; b=Jr2rvLQhtzf7zPciHoTXXWKTuNPCRaPKtbcLdpd7h6rEJ55O/tamWEaNbzsr8j1FUl DIhJTCWDzrjPtuLW+xBEBGDE7eD7O9NvzF7F2enSDcfVkETjW6qDf9whGFzlSchl2+OV eOvru0F2HNeH9MZtc+oh8ia8PuxFDvYRekFpQ06J1tyGvyytEdZBH9P2/fZwWjsGH38i PeNCJ8BasLQGiDlbUTlaQP07zXz+triU4lgk7S8D8AijKn263zAWDE/zjJS0EkT/SnYI LkuUeQvmarYr7RaciBPwuliQWIvCDM7LqjoDdPkq636P642ILtFmLghI+rgdWUI53jq/ v1Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=gNja5X8I; 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 g12-20020a170902c38c00b0019a72178acdsi9620370plg.380.2023.02.20.07.05.15; Mon, 20 Feb 2023 07:05:28 -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=gNja5X8I; 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 S232817AbjBTPEj (ORCPT + 99 others); Mon, 20 Feb 2023 10:04:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbjBTPDz (ORCPT ); Mon, 20 Feb 2023 10:03:55 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9871F91D; Mon, 20 Feb 2023 07:02:31 -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 848276602168; Mon, 20 Feb 2023 15:01:58 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1676905319; bh=ZplN2YRj3Q1FQDaVBRSPFITk+c8951vtcnNlTkqRLoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNja5X8I2Xa0vjCsknaEVkaWxsXlak9965fMGPxempAmDxaNRS6NW5+art/yCM4Gx LstgMSiIfJUReqFl4TeFXFdfgZg+TPBQgsi+XDr6J1P66A0w2XSl1+F0srPj/B/iA+ awn/0cZ4VEXdCZwRVtuXz7Ju0Zg477OcLxHhxkvV9sLZ31vZIcMmyXENpsLbAUtVtv n7Z4jNadSjXKM+VSHMqMHA4QsBtus4SGaRMVkBjAbPoc5kvKyiucMhKWxaiAVih1d1 TllgIVd+Ak8iavgXkq1YIJqq13RDV+a8itDi3bV7JmFbPkFXeDl5nyJdZdaRvzTo5u S3gxaTYfo7YAg== 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 v3 31/55] clk: mediatek: Propagate struct device with mtk_clk_register_dividers() Date: Mon, 20 Feb 2023 16:00:47 +0100 Message-Id: <20230220150111.77897-32-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220150111.77897-1-angelogioacchino.delregno@collabora.com> References: <20230220150111.77897-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?1758362891649022166?= X-GMAIL-MSGID: =?utf-8?q?1758362891649022166?= 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 Reviewed-by: Chen-Yu Tsai --- 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 dfe328f7a44b..e9c27b1364b6 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -681,7 +681,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,