From patchwork Mon Sep 20 07:41:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugumar Natarajan X-Patchwork-Id: 194422 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8K8GrJs004359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Sep 2010 08:17:34 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8K8GrKo032499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Sep 2010 03:16:53 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o8K8GqGA008360 for ; Mon, 20 Sep 2010 03:16:52 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id DAB0D80641 for ; Mon, 20 Sep 2010 03:16:50 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 6328380626 for ; Mon, 20 Sep 2010 03:16:44 -0500 (CDT) Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id o8K8GgjA007967 for ; Mon, 20 Sep 2010 03:16:43 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id 5E3233887A for ; Mon, 20 Sep 2010 13:46:38 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id o8K89dbs021861; Mon, 20 Sep 2010 13:39:39 +0530 From: Sugumar Natarajan To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 3/4] davinci: da850/omap-l138: Add platform specific support for eCAP driver Date: Mon, 20 Sep 2010 13:11:54 +0530 Message-Id: <1284968514-17065-1-git-send-email-sugumar@ti.com> X-Mailer: git-send-email 1.5.6 X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Sep 2010 08:17:34 +0000 (UTC) diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index c9634c7..8192866 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -40,6 +40,7 @@ config ARCH_DAVINCI_DA850 select CP_INTC select ARCH_DAVINCI_DA8XX select ARCH_HAS_CPUFREQ + select HAVE_PWM config ARCH_DAVINCI_DA8XX select CPU_ARM926T diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 63916b9..7bc51f1 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -345,6 +345,13 @@ static struct clk aemif_clk = { .flags = ALWAYS_ENABLED, }; +static struct clk ecap_clk = { + .name = "ecap", + .parent = &pll0_sysclk2, + .lpsc = DA8XX_LPSC1_ECAP, + .gpsc = 1, +}; + static struct clk_lookup da850_clks[] = { CLK(NULL, "ref", &ref_clk), CLK(NULL, "pll0", &pll0_clk), @@ -387,6 +394,7 @@ static struct clk_lookup da850_clks[] = { CLK("davinci_mmc.0", NULL, &mmcsd0_clk), CLK("davinci_mmc.1", NULL, &mmcsd1_clk), CLK(NULL, "aemif", &aemif_clk), + CLK(NULL, "ecap", &ecap_clk), CLK(NULL, NULL, NULL), }; @@ -549,6 +557,7 @@ static const struct mux_config da850_pins[] = { MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false) + MUX_CFG(DA850, ECAP2_APWM2, 1, 0, 15, 4, false) #endif }; @@ -1006,6 +1015,29 @@ static int da850_round_armrate(struct clk *clk, unsigned long rate) } #endif + +#define DA8XX_ECAP2_BASE 0x01F08000 + +static struct resource da850_ecap_resource[] = { + { + .start = DA8XX_ECAP2_BASE, + .end = DA8XX_ECAP2_BASE + 0xfff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device da850_ecap_dev = { + .name = "ecap", + .id = 0, + .resource = da850_ecap_resource, + .num_resources = ARRAY_SIZE(da850_ecap_resource), +}; + +int __init da850_register_ecap(void) +{ + return platform_device_register(&da850_ecap_dev); +} + int da850_register_pm(struct platform_device *pdev) { int ret; diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 4247b3f..3b6e399 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -83,6 +83,7 @@ int da850_register_cpufreq(char *async_clk); int da8xx_register_cpuidle(void); void __iomem * __init da8xx_get_mem_ctlr(void); int da850_register_pm(struct platform_device *pdev); +int __init da850_register_ecap(void); extern struct platform_device da8xx_serial_device; extern struct emac_platform_data da8xx_emac_pdata; diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index de11aac..b3c23ee 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -914,6 +914,9 @@ enum davinci_da850_index { DA850_GPIO4_0, DA850_GPIO4_1, DA850_RTC_ALARM, + + /* eCAP Module */ + DA850_ECAP2_APWM2, }; enum davinci_tnetv107x_index {