From patchwork Thu Sep 26 16:15:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2949551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5FC24BFF0B for ; Thu, 26 Sep 2013 16:16:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 448BB202D1 for ; Thu, 26 Sep 2013 16:16:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D57120219 for ; Thu, 26 Sep 2013 16:16:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPEEd-0002ZI-Rg; Thu, 26 Sep 2013 16:16:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPEEb-0003pl-DC; Thu, 26 Sep 2013 16:16:09 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPEEZ-0003pH-Fp for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2013 16:16:08 +0000 Received: by mail-wi0-f178.google.com with SMTP id hn9so1505077wib.5 for ; Thu, 26 Sep 2013 09:15:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sl7+PqyJwmZ5O4Ae6YvakytAtKPVig2NErkNxyjZFlU=; b=cWROGipVU2pDdAFzlFRc+6+bW3xWQ9db5Y4dzA+bCKEIl4xdpxi3Hxm2utAvn6pbMt jlpKEoEHLNolGfFrrwolgjeWXHbUqWDXCqXgdYMPnyyKh8XSiRFORyw5O+Jh796zuaa4 1Hhf5/Zywt3FVs03hmJLYNHH8XE/EQ6iLJN2fK4FgqyEM2N6HxfN/GNP2WPQmUMlLlNO xqcRszveNzGMV88VFdQ/AARmnsj54qvO3fK2NNdnDLOIBhNr91IpHJ1hFc5a5RrF9eNB 0Z1pfIlI7iqo3i0Sj+f4Uj3pHPn1QL4xhMWwBFZMmGh/cmU+xsSwJQ55hwrcnHFDCHv1 3CHQ== X-Gm-Message-State: ALoCoQnl4hv5+VgPlAcIHIu0WSEqQWjrCKX/qBVqPHiMn0NoLjTbsDLOySCuPOsCmxf82Uo9hztj X-Received: by 10.194.71.72 with SMTP id s8mr1678907wju.52.1380212145815; Thu, 26 Sep 2013 09:15:45 -0700 (PDT) Received: from mai.home (AToulouse-654-1-326-179.w86-199.abo.wanadoo.fr. [86.199.213.179]) by mx.google.com with ESMTPSA id e5sm29553562wiy.2.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 09:15:42 -0700 (PDT) From: Daniel Lezcano To: michal.simek@xilinx.com Subject: [RFC PATCH] ARM: zynq: cpuidle: convert to platform driver Date: Thu, 26 Sep 2013 18:15:38 +0200 Message-Id: <1380212138-4020-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130926_121607_669134_6E8F041C X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.6 (--) Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the ux500 and the kirkwood driver, make the zynq driver a platform driver Signed-off-by: Daniel Lezcano --- arch/arm/mach-zynq/common.c | 7 +++++++ drivers/cpuidle/cpuidle-zynq.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 5f25256..0f0d88f 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -44,6 +44,10 @@ static struct of_device_id zynq_of_bus_ids[] __initdata = { {} }; +static struct platform_device zynq_cpuidle_device = { + .name = "cpuidle-zynq", +}; + /** * zynq_init_machine - System specific initialization, intended to be * called from board specific initialization. @@ -56,6 +60,9 @@ static void __init zynq_init_machine(void) l2x0_of_init(0x02060000, 0xF0F0FFFF); of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); + + if (of_machine_is_compatible("xlnx,zynq-7000")) + platform_device_register(&zynq_cpuidle_device); } static void __init zynq_timer_init(void) diff --git a/drivers/cpuidle/cpuidle-zynq.c b/drivers/cpuidle/cpuidle-zynq.c index 38e03a1..c8bd261 100644 --- a/drivers/cpuidle/cpuidle-zynq.c +++ b/drivers/cpuidle/cpuidle-zynq.c @@ -70,14 +70,19 @@ static struct cpuidle_driver zynq_idle_driver = { }; /* Initialize CPU idle by registering the idle states */ -static int __init zynq_cpuidle_init(void) +static int __init zynq_cpuidle_probe(void) { - if (!of_machine_is_compatible("xlnx,zynq-7000")) - return -ENODEV; - pr_info("Xilinx Zynq CpuIdle Driver started\n"); return cpuidle_register(&zynq_idle_driver, NULL); } -device_initcall(zynq_cpuidle_init); +static struct platform_driver zynq_cpuidle_driver = { + .driver = { + .name = "cpuidle-zynq", + .owner = THIS_MODULE, + }, + .probe = zynq_cpuidle_probe, +}; + +module_platform_driver(zynq_cpuidle_driver);