From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1F4AC43461 for ; Sun, 6 Sep 2020 22:49:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C385F2145D for ; Sun, 6 Sep 2020 22:49:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JLn3Lkfj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C385F2145D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KcQVlmsd1KzGJ0E6vLqQPygF3IM802lcvzJ2zfmpGTU=; b=JLn3LkfjZqYiOLUPIF4Teh4mz BCOyedhbezNY/FUpWUmhJPU09MbIQN2cCVOGPE85eGnHBLVYwOTLNtClQainchJ5RzCWRcrH3RPP0 uMpTY6dZ5v5KttRsCfs+mw0MnILPv1QDFJsXfgArpKWHDTd8P5qX3nWS3k6dV9EkSHi/T4M8KqfiK 12LW6386raB1tBRR4kMVUfeYJywSemGpu6An5ViMzNtfl4kmcaw94pbzstXSJP7UEpSmbs+PhAh7A O/UcmzHCMBy623JeEtH0tnFySvH2GnCiCijxxlAl/gjwov91WWVUp/qX96b/dIClCdd8+5XMzi8Hv pjDWb1g1Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kF3TY-0002Lx-Gx; Sun, 06 Sep 2020 22:49:32 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kF3TV-0002Le-OT for linux-rockchip@lists.infradead.org; Sun, 06 Sep 2020 22:49:30 +0000 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF3TU-0002fd-Ag; Mon, 07 Sep 2020 00:49:28 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Elaine Zhang Subject: Re: [PATCH v3 6/6] clk: rockchip: rk3399: Support module build Date: Mon, 07 Sep 2020 00:49:27 +0200 Message-ID: <3524790.GmC4BGDxql@diego> In-Reply-To: <20200904074505.24917-1-zhangqing@rock-chips.com> References: <20200904074405.24439-1-zhangqing@rock-chips.com> <20200904074505.24917-1-zhangqing@rock-chips.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200906_184929_956213_76CED703 X-CRM114-Status: GOOD ( 18.87 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, xf@rock-chips.com, sboyd@kernel.org, mturquette@baylibre.com, Elaine Zhang , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, kever.yang@rock-chips.com, linux-rockchip@lists.infradead.org, xxx@rock-chips.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Am Freitag, 4. September 2020, 09:45:05 CEST schrieb Elaine Zhang: > support CLK_OF_DECLARE and builtin_platform_driver_probe > double clk init method. > add module author, description and license to support building > Soc Rk3399 clock driver as module. > > Signed-off-by: Elaine Zhang > Reviewed-by: Kever Yang > --- > drivers/clk/rockchip/clk-rk3399.c | 55 +++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c > index ce1d2446f142..40ff17aee5b6 100644 > --- a/drivers/clk/rockchip/clk-rk3399.c > +++ b/drivers/clk/rockchip/clk-rk3399.c > @@ -5,9 +5,11 @@ > */ > > #include > +#include > #include > #include > #include > +#include > #include > #include > #include > @@ -1600,3 +1602,56 @@ static void __init rk3399_pmu_clk_init(struct device_node *np) > rockchip_clk_of_add_provider(np, ctx); > } > CLK_OF_DECLARE(rk3399_cru_pmu, "rockchip,rk3399-pmucru", rk3399_pmu_clk_init); > + > +struct clk_rk3399_inits { > + void (*inits)(struct device_node *np); > +}; > + > +static const struct clk_rk3399_inits clk_rk3399_pmucru_init = { > + .inits = rk3399_pmu_clk_init, > +}; > + > +static const struct clk_rk3399_inits clk_rk3399_cru_init = { > + .inits = rk3399_clk_init, > +}; > + > +static const struct of_device_id clk_rk3399_match_table[] = { > + { > + .compatible = "rockchip,rk3399-cru", > + .data = &clk_rk3399_cru_init, > + }, { > + .compatible = "rockchip,rk3399-pmucru", > + .data = &clk_rk3399_pmucru_init, > + }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, clk_rk3399_match_table); > + > +static int __init clk_rk3399_probe(struct platform_device *pdev) > +{ > + struct device_node *np = pdev->dev.of_node; > + const struct of_device_id *match; > + const struct clk_rk3399_inits *init_data; > + > + match = of_match_device(clk_rk3399_match_table, &pdev->dev); > + if (!match || !match->data) > + return -EINVAL; > + > + init_data = match->data; > + if (init_data->inits) > + init_data->inits(np); > + > + return 0; > +} > + > +static struct platform_driver clk_rk3399_driver = { > + .driver = { > + .name = "clk-rk3399", > + .of_match_table = clk_rk3399_match_table, I guess we probably want .suppress_bind_attrs = true, here, because there is no unloading. Also what happens when you try to rmmod the module? Heiko _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip