From patchwork Mon Jul 15 23:25:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 18368 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9536825E13 for ; Mon, 15 Jul 2013 23:25:31 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q4sf35214yen.0 for ; Mon, 15 Jul 2013 16:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=cupGQ4YFciyHQyrcIVqb5p+ydPV6gg4B6lwF0HejoIY=; b=ZlyM7JS1xdnixgDQT3/mmyeOpAQfC0ss86HfwYYPnG/enDa0G0e4xzrEYljJGV5BUv gdNoR883gOe17mIkutgcIsNzrm38wcb89nZv4WzQLTX0IwnkI5pNc9xatL30DF27euKR smfQmrniMRXyfhGuyxMkzRqKlMqhrZptt6f0hXue0qgsxqkXh5bNhrOKr81JX3y+iJf6 6pxR+TwC4ZDnJ4uWJpoqidL3xPy7Wz8rDOf95bgmKWER+hSrhsUedEfyu9jB/kZQdWJC SkKLu4ks5VDjTX2AIVmYGZZzecr9Jk7oY3pfbKPi1t3rMuHKr6GvqxZkCRXM2SWMdeMb CgMA== X-Received: by 10.236.170.41 with SMTP id o29mr29180502yhl.53.1373930731070; Mon, 15 Jul 2013 16:25:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.236 with SMTP id 12ls40093qeh.36.gmail; Mon, 15 Jul 2013 16:25:30 -0700 (PDT) X-Received: by 10.52.92.16 with SMTP id ci16mr23614799vdb.88.1373930730845; Mon, 15 Jul 2013 16:25:30 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id q9si15252215vcm.40.2013.07.15.16.25.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 16:25:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id m17so19094vca.9 for ; Mon, 15 Jul 2013 16:25:30 -0700 (PDT) X-Received: by 10.52.178.227 with SMTP id db3mr19755807vdc.20.1373930730751; Mon, 15 Jul 2013 16:25:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp92367vcv; Mon, 15 Jul 2013 16:25:30 -0700 (PDT) X-Received: by 10.194.58.11 with SMTP id m11mr33657934wjq.45.1373930729760; Mon, 15 Jul 2013 16:25:29 -0700 (PDT) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx.google.com with ESMTPS id b10si18272933wje.126.2013.07.15.16.25.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 16:25:29 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.177 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.177; Received: by mail-we0-f177.google.com with SMTP id m19so21795wev.22 for ; Mon, 15 Jul 2013 16:25:29 -0700 (PDT) X-Received: by 10.180.14.105 with SMTP id o9mr4121592wic.30.1373930729136; Mon, 15 Jul 2013 16:25:29 -0700 (PDT) Received: from mai.home (AToulouse-654-1-413-126.w82-125.abo.wanadoo.fr. [82.125.160.126]) by mx.google.com with ESMTPSA id fs8sm24135384wib.0.2013.07.15.16.25.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 16:25:28 -0700 (PDT) From: Daniel Lezcano To: linux-pm@vger.kernel.org Cc: linus.walleij@linaro.org, patches@linaro.org Subject: [PATCH 1/3] ARM: ux500: cpuidle: Instantiate the driver from platform device Date: Tue, 16 Jul 2013 01:25:24 +0200 Message-Id: <1373930726-15475-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmTIxscMx1XFeiKVWVTWt+lxws7S+xpdGlGtSTYAr0xCEDk38WT7oloV3YVyNPxpnGdloRM X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij To break the dependency on the "id.h" file we move the cpuidle driver to a platform device. Now we only call the probe() on this driver if we find a corresponding platform device (which is spawned from the PRCMU MFD driver). Signed-off-by: Linus Walleij Signed-off-by: Daniel Lezcano --- arch/arm/mach-ux500/cpuidle.c | 17 +++++++++++------ drivers/mfd/db8500-prcmu.c | 4 ++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c index a45dd09..c0cb37c 100644 --- a/arch/arm/mach-ux500/cpuidle.c +++ b/arch/arm/mach-ux500/cpuidle.c @@ -16,12 +16,12 @@ #include #include #include +#include #include #include #include "db8500-regs.h" -#include "id.h" static atomic_t master = ATOMIC_INIT(0); static DEFINE_SPINLOCK(master_lock); @@ -113,11 +113,8 @@ static struct cpuidle_driver ux500_idle_driver = { .state_count = 2, }; -int __init ux500_idle_init(void) +static int __init dbx500_cpuidle_probe(struct platform_device *pdev) { - if (!(cpu_is_u8500_family() || cpu_is_ux540_family())) - return -ENODEV; - /* Configure wake up reasons */ prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | PRCMU_WAKEUP(ABB)); @@ -125,4 +122,12 @@ int __init ux500_idle_init(void) return cpuidle_register(&ux500_idle_driver, NULL); } -device_initcall(ux500_idle_init); +static struct platform_driver dbx500_cpuidle_plat_driver = { + .driver = { + .name = "cpuidle-dbx500", + .owner = THIS_MODULE, + }, + .probe = dbx500_cpuidle_probe, +}; + +module_platform_driver(dbx500_cpuidle_plat_driver); diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 3c157fa..0d68eb1 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -3094,6 +3094,10 @@ static struct mfd_cell db8500_prcmu_devs[] = { .pdata_size = sizeof(db8500_cpufreq_table), }, { + .name = "cpuidle-dbx500", + .of_compatible = "stericsson,cpuidle-dbx500", + }, + { .name = "db8500-thermal", .num_resources = ARRAY_SIZE(db8500_thsens_resources), .resources = db8500_thsens_resources,