From patchwork Wed Oct 10 11:42:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12094 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CE0EA1A55A1 for ; Wed, 10 Oct 2012 11:43:09 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4F6D4A19065 for ; Wed, 10 Oct 2012 11:43:09 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so635489iej.11 for ; Wed, 10 Oct 2012 04:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=lZ0Jwil8GDSrfZ1Z7PH9i92YiGXUhcKUIDfZB1EG1p0=; b=duGp3ekokGIpUI2SqNfHskOtYOyEZU4AJBGGFk0JiOctrfeNMJ6Kxi7LqpHHpow/0m ip6Ii3YrytcGRdmkuh6CCMmAfptfUTgpJcJ/rn6zAGg5R2Ti+wyxIGaQWQGjdYBrdHC2 EEqVCEHoLPDRYZjQl+wWfQUZrXX4GFqwGw2h1jtrwiRbMU0E5dVOGaGYM3XRHU0U0YwW tqa9TLc9HwpqkohHIg3tS4idS7nCjQmJ/BZVdyhQgkNoCG0GyyMJYMp9ryc8HqP6r3QM 2arL0/DhduqmxE/M+T073iZyLt2efe7UTqzJDAtHJ5N6lI5ETde7/tFxsZius15QV+D2 /DBA== Received: by 10.43.7.132 with SMTP id oo4mr18229420icb.6.1349869388494; Wed, 10 Oct 2012 04:43:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp209112igt; Wed, 10 Oct 2012 04:43:07 -0700 (PDT) Received: by 10.14.220.134 with SMTP id o6mr32328491eep.35.1349869386939; Wed, 10 Oct 2012 04:43:06 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id z46si643243eeo.16.2012.10.10.04.42.49 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 04:43:06 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUHVfOfmFI9u8j/SY+9n3+tsNGKMMHHjZ@postini.com; Wed, 10 Oct 2012 11:43:06 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id EDCC5B1; Wed, 10 Oct 2012 11:34:28 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id D93C2E8D; Wed, 10 Oct 2012 11:42:41 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id B5F0024C080; Wed, 10 Oct 2012 13:42:34 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Oct 2012 13:42:40 +0200 From: Ulf Hansson To: , Mike Turquette , Mike Turquette , Samuel Ortiz , "Rafael J. Wysocki" Cc: , , Linus Walleij , Lee Jones , Philippe Begnic , Rickard Andersson , Jonas Aberg , Vincent Guittot , Ulf Hansson Subject: [PATCH 2/8] mfd: db8500: Provide cpufreq table as platform data Date: Wed, 10 Oct 2012 13:42:23 +0200 Message-ID: <1349869349-8070-3-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349869349-8070-1-git-send-email-ulf.hansson@stericsson.com> References: <1349869349-8070-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnNUpv66VfzdfeCwR8fzWq9Lhtl+e/o01RSmupvhffT7vir+sVdK56C2Y8X4perGtlSxOWG From: Ulf Hansson The cpufreq table needs dynamically update due to what the PRCMU firmware is supporting. The table is then provided through to the mfd child device as platform data. Signed-off-by: Ulf Hansson Reviewed-by: Linus Walleij Acked-by: Jonas Aaberg Cc: Samuel Ortiz --- drivers/mfd/db8500-prcmu.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 00b8b0f..53c24c4 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -3002,6 +3003,15 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = { }, }; +/* CPU FREQ table, may be changed due to if MAX_OPP is supported. */ +static struct cpufreq_frequency_table db8500_cpufreq_table[] = { + { .frequency = 200000, .index = ARM_EXTCLK,}, + { .frequency = 400000, .index = ARM_50_OPP,}, + { .frequency = 800000, .index = ARM_100_OPP,}, + { .frequency = CPUFREQ_TABLE_END,}, /* To be used for MAX_OPP. */ + { .frequency = CPUFREQ_TABLE_END,}, +}; + static struct resource ab8500_resources[] = { [0] = { .start = IRQ_DB8500_AB8500, @@ -3020,6 +3030,8 @@ static struct mfd_cell db8500_prcmu_devs[] = { { .name = "cpufreq-u8500", .of_compatible = "stericsson,cpufreq-u8500", + .platform_data = &db8500_cpufreq_table, + .pdata_size = sizeof(db8500_cpufreq_table), }, { .name = "ab8500-core", @@ -3030,6 +3042,14 @@ static struct mfd_cell db8500_prcmu_devs[] = { }, }; +static void db8500_prcmu_update_cpufreq(void) +{ + if (prcmu_has_arm_maxopp()) { + db8500_cpufreq_table[3].frequency = 1000000; + db8500_cpufreq_table[3].index = ARM_MAX_OPP; + } +} + /** * prcmu_fw_init - arch init call for the Linux PRCMU fw init logic * @@ -3074,6 +3094,8 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev) if (cpu_is_u8500v20_or_later()) prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); + db8500_prcmu_update_cpufreq(); + err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); if (err) {