From patchwork Thu Nov 22 10:35:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13068 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 83D2D23FC9 for ; Thu, 22 Nov 2012 10:36:37 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3A810A19705 for ; Thu, 22 Nov 2012 10:36:37 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3095157iag.11 for ; Thu, 22 Nov 2012 02:36:37 -0800 (PST) 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=zMfbLKpy3c6EtYGTvOHtTdTPhx/2B7tqjFpmCe8BDfk=; b=Nk+c5GHvobl/f0+oSaWLJ6nOJxfhDtD7+2lnyK1bQ9Y4ih7nJtKRYHbKuise9m7P/z WhNja6+su20qqR4PCobEuIGLVou/65RB0Ug21C2ubBOQeR3ahnJ5udlSxqPZvzjuI6q3 OqvJjfSwRrjZYeubxQ9vUwpEWuV7MAWum9cXQ6Com1OGfmUyafJKyFaVKfjMBfeR7hKU YaKEcXEa550r6r/crlx97epLKd/HbENWVr66hNsy+2LTQdBZK0erNfike5wMB2RNvlVp lDHR95xkVEfZ5iBNT3HvolOTY7D0rPdYP9x0YBkZcfO+/YGoFVMslSVjxX3NNELCmOM1 i8iA== Received: by 10.50.186.199 with SMTP id fm7mr30212igc.62.1353580596892; Thu, 22 Nov 2012 02:36:36 -0800 (PST) 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 n20csp188428igt; Thu, 22 Nov 2012 02:36:36 -0800 (PST) Received: by 10.14.203.132 with SMTP id f4mr436099eeo.11.1353580595845; Thu, 22 Nov 2012 02:36:35 -0800 (PST) Received: from eu1sys200aog107.obsmtp.com (eu1sys200aog107.obsmtp.com [207.126.144.123]) by mx.google.com with SMTP id g47si754910eep.123.2012.11.22.02.36.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 02:36:35 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.123; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.123 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-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob107.postini.com ([207.126.147.11]) with SMTP ID DSNKUK4AJjNb5BX7Z4Vx7L7Up0u8GnqtMVTf@postini.com; Thu, 22 Nov 2012 10:36:34 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 602A158; Thu, 22 Nov 2012 10:35:12 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 1F07D50; Thu, 22 Nov 2012 05:41:21 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 45C6D24C391; Thu, 22 Nov 2012 11:35:42 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 22 Nov 2012 11:35:46 +0100 From: Ulf Hansson To: , Mike Turquette , Mike Turquette Cc: Linus Walleij , Lee Jones , Philippe Begnic , Samuel Ortiz , Ulf Hansson Subject: [PATCH 1/2] clk: ux500: Initial support for abx500 clock driver Date: Thu, 22 Nov 2012 11:35:39 +0100 Message-ID: <1353580540-3774-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1353580540-3774-1-git-send-email-ulf.hansson@stericsson.com> References: <1353580540-3774-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlxai2AlRdebzJjtxUxKQ/VLGoOI7sqd9X3mnDYJkgvPSe8xqqLMj71DwQRNDLxqZzn69Fx From: Ulf Hansson The abx500 clock driver is a platform driver which will be initialized during arch init. The platform device shall be added from the ab-core driver as a mfd child device to maintain correct boot sequence. Depending on what ab version we use, different clock definitions will be added. Signed-off-by: Ulf Hansson --- drivers/clk/ux500/Makefile | 3 ++ drivers/clk/ux500/abx500-clk.c | 73 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 drivers/clk/ux500/abx500-clk.c diff --git a/drivers/clk/ux500/Makefile b/drivers/clk/ux500/Makefile index 858fbfe..bcc0c11 100644 --- a/drivers/clk/ux500/Makefile +++ b/drivers/clk/ux500/Makefile @@ -10,3 +10,6 @@ obj-y += clk-prcmu.o obj-y += u8500_clk.o obj-y += u9540_clk.o obj-y += u8540_clk.o + +# ABX500 clock driver +obj-y += abx500-clk.o diff --git a/drivers/clk/ux500/abx500-clk.c b/drivers/clk/ux500/abx500-clk.c new file mode 100644 index 0000000..e27c523 --- /dev/null +++ b/drivers/clk/ux500/abx500-clk.c @@ -0,0 +1,73 @@ +/* + * abx500 clock implementation for ux500 platform. + * + * Copyright (C) 2012 ST-Ericsson SA + * Author: Ulf Hansson + * + * License terms: GNU General Public License (GPL) version 2 + */ + +#include +#include +#include +#include +#include + +/* TODO: Add clock implementations here */ + + +/* Clock definitions for ab8500 */ +static int ab8500_reg_clks(struct device *dev) +{ + return 0; +} + +/* Clock definitions for ab8540 */ +static int ab8540_reg_clks(struct device *dev) +{ + return 0; +} + +/* Clock definitions for ab9540 */ +static int ab9540_reg_clks(struct device *dev) +{ + return 0; +} + +static int __devinit abx500_clk_probe(struct platform_device *pdev) +{ + struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent); + int ret; + + if (is_ab8500(parent) || is_ab8505(parent)) { + ret = ab8500_reg_clks(&pdev->dev); + } else if (is_ab8540(parent)) { + ret = ab8540_reg_clks(&pdev->dev); + } else if (is_ab9540(parent)) { + ret = ab9540_reg_clks(&pdev->dev); + } else { + dev_err(&pdev->dev, "non supported plf id\n"); + return -ENODEV; + } + + return ret; +} + +static struct platform_driver abx500_clk_driver = { + .driver = { + .name = "abx500-clk", + .owner = THIS_MODULE, + }, + .probe = abx500_clk_probe, +}; + +static int __init abx500_clk_init(void) +{ + return platform_driver_register(&abx500_clk_driver); +} + +arch_initcall(abx500_clk_init); + +MODULE_AUTHOR("Ulf Hansson