From patchwork Wed Jun 19 13:18:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 2749411 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 240E3C0AB1 for ; Wed, 19 Jun 2013 13:24:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5CB62028A for ; Wed, 19 Jun 2013 13:24: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 3D0672026D for ; Wed, 19 Jun 2013 13:24:18 +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 1UpIKV-0007cf-EY; Wed, 19 Jun 2013 13:21:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpIJp-0002si-0Q; Wed, 19 Jun 2013 13:21:01 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpIIX-0002hr-12 for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2013 13:19:44 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5JDJIbe010968; Wed, 19 Jun 2013 08:19:18 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5JDJIAl026249; Wed, 19 Jun 2013 08:19:18 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Wed, 19 Jun 2013 08:19:18 -0500 Received: from sokoban.tieu.ti.com (h79-27.vpn.ti.com [172.24.79.27]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5JDJ40Z024678; Wed, 19 Jun 2013 08:19:16 -0500 From: Tero Kristo To: , , , , , Subject: [PATCHv2 04/11] clk: omap: introduce clock driver Date: Wed, 19 Jun 2013 16:18:55 +0300 Message-ID: <1371647942-4811-5-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371647942-4811-1-git-send-email-t-kristo@ti.com> References: <1371647942-4811-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130619_091941_210458_8A3104D5 X-CRM114-Status: GOOD ( 16.10 ) X-Spam-Score: -8.2 (--------) Cc: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 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 Parses OMAP clock data from DT and registers those clocks with the clock framework. dt_omap_clk_init must be called early during boot for timer initialization so it is exported and called from the existing clock code instead of probing like a real driver. Based on initial work done by Mike Turquette. Signed-off-by: Tero Kristo Cc: Mike Turquette --- drivers/clk/Makefile | 1 + drivers/clk/omap/Makefile | 1 + drivers/clk/omap/clk.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/omap.h | 24 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 drivers/clk/omap/Makefile create mode 100644 drivers/clk/omap/clk.c create mode 100644 include/linux/clk/omap.h diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 137d3e7..1d5a2ec 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/ +obj-$(CONFIG_ARCH_OMAP) += omap/ obj-$(CONFIG_X86) += x86/ diff --git a/drivers/clk/omap/Makefile b/drivers/clk/omap/Makefile new file mode 100644 index 0000000..8195931 --- /dev/null +++ b/drivers/clk/omap/Makefile @@ -0,0 +1 @@ +obj-y += clk.o diff --git a/drivers/clk/omap/clk.c b/drivers/clk/omap/clk.c new file mode 100644 index 0000000..b4533ed --- /dev/null +++ b/drivers/clk/omap/clk.c @@ -0,0 +1,44 @@ +/* + * OMAP PRCM clock driver + * + * Copyright (C) 2013 Texas Instruments, Inc. + * Tero Kristo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +/* FIXME - should the OMAP PRCM clock driver match generic types? */ +static const struct of_device_id clk_match[] = { + {.compatible = "fixed-clock", .data = of_fixed_clk_setup, }, + {.compatible = "mux-clock", .data = of_mux_clk_setup, }, + {.compatible = "fixed-factor-clock", + .data = of_fixed_factor_clk_setup, }, + {.compatible = "divider-clock", .data = of_divider_clk_setup, }, + {.compatible = "gate-clock", .data = of_gate_clk_setup, }, + {}, +}; + +/* FIXME - need to initialize early; skip real driver registration & probe */ +int __init dt_omap_clk_init(void) +{ + of_clk_init(clk_match); + return 0; +} + +MODULE_DESCRIPTION("OMAP Clock driver"); +MODULE_AUTHOR("Texas Instruments Inc."); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/clk/omap.h b/include/linux/clk/omap.h new file mode 100644 index 0000000..504e838 --- /dev/null +++ b/include/linux/clk/omap.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2010 Broadcom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LINUX_CLK_OMAP_H_ +#define __LINUX_CLK_OMAP_H_ + +int __init dt_omap_clk_init(void); + +#endif