From patchwork Wed Dec 13 20:33:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gerlach X-Patchwork-Id: 10110887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 339A460352 for ; Wed, 13 Dec 2017 20:35:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2820E2891E for ; Wed, 13 Dec 2017 20:35:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B7E128F36; Wed, 13 Dec 2017 20:35:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F7CB2891E for ; Wed, 13 Dec 2017 20:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=XHuSozaHINHPEZpYOs1B4QVCLR+Sk1iiMvVwqLEyBxQ=; b=gqqcHM2jM/Bev3 6bosM9brN6bM5GBgJ0l/Rmr/HvwUGCN8VthLtSDfSyVSka71B/6/BVKgTYOMf5jTvSl6aQkw9xJJI O4BD/96zx+fOPQNz1/E+YezoXAgkHY1eIjNh4ht8xexmQV/4OelF3ClToEiHVPeRLG4lITgoSzBpb 7iCGD8ITR7iCeomgLMZYcpamuop9aeQamVZwqbjbRM2QneSq30NFlAJaeXCckzUmW76R2EV0zjMHc 7EfmBXq78BA9XDHGchrNVQyUm8OLorJnhsHlkPB6nEyA4bWTn5TU/it6p7GpzBSfY9LlEDQezpQS5 Nw1vd1+Iir41R/10sOuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePDk4-0006Hm-U1; Wed, 13 Dec 2017 20:35:00 +0000 Received: from lelnx193.ext.ti.com ([198.47.27.77]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePDjh-0005tj-4W for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 20:34:38 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBDKY8l0021336; Wed, 13 Dec 2017 14:34:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513197248; bh=v6TI4TtsDstPhjoqtq8M0kXEP8RylYEUoZBSdthHBMg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vfUoJKQ+Qz2uhs2o6qY29jZcBgruoI2gKjpmCpnqgLPRmkz8GB9TFRT8E8xBENPyO iCJINuGtXBOi3YNnl8wL+ABWAb2Fs8cfaJaY6gqzs7p3yEZHrzzNbj2oM5v/s1uBjt +dYo9hMrkbNZoA1Img8EAHU0Q1Fn4I0WtgC/THW8= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBDKY8pd023120; Wed, 13 Dec 2017 14:34:08 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Wed, 13 Dec 2017 14:34:08 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Wed, 13 Dec 2017 14:34:08 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBDKY8cL003962; Wed, 13 Dec 2017 14:34:08 -0600 Received: from localhost (uda0274052.dhcp.ti.com [128.247.59.203]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vBDKY7x20828; Wed, 13 Dec 2017 14:34:07 -0600 (CST) From: Dave Gerlach To: Viresh Kumar , Rob Herring , "Rafael J . Wysocki" Subject: [PATCH 1/4] cpufreq: ti-cpufreq: Convert to module_platform_driver Date: Wed, 13 Dec 2017 14:33:55 -0600 Message-ID: <20171213203358.20839-2-d-gerlach@ti.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171213203358.20839-1-d-gerlach@ti.com> References: <20171213203358.20839-1-d-gerlach@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_123437_305041_CABF5454 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Tony Lindgren , Dave Gerlach , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ti-cpufreq will be responsible for calling dev_pm_opp_set_regulators on platforms that require AVS and ABB regulator support so we must be able to defer probe if regulators are not yet available, so change ti-cpufreq to be a module_platform_driver to allow for probe defer. Signed-off-by: Dave Gerlach Acked-by: Viresh Kumar --- drivers/cpufreq/ti-cpufreq.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index 923317f03b4b..b1c230a1e2aa 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -195,7 +196,7 @@ static const struct of_device_id ti_cpufreq_of_match[] = { {}, }; -static int ti_cpufreq_init(void) +static int ti_cpufreq_probe(struct platform_device *pdev) { u32 version[VERSION_COUNT]; struct device_node *np; @@ -269,4 +270,22 @@ static int ti_cpufreq_init(void) return ret; } -device_initcall(ti_cpufreq_init); + +static int ti_cpufreq_init(void) +{ + platform_device_register_simple("ti-cpufreq", -1, NULL, 0); + return 0; +} +module_init(ti_cpufreq_init); + +static struct platform_driver ti_cpufreq_driver = { + .probe = ti_cpufreq_probe, + .driver = { + .name = "ti-cpufreq", + }, +}; +module_platform_driver(ti_cpufreq_driver); + +MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver"); +MODULE_AUTHOR("Dave Gerlach "); +MODULE_LICENSE("GPL v2");