[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2627-g6490053
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-12-08 17:38:12
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 6490053baa376252bafb805611c182d8c719f3f0 (commit)
from a4800e7355a42b054ca5d70678f01135aca74264 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6490053baa376252bafb805611c182d8c719f3f0
Author: Julien Boibessot <jul...@ar...>
Date: Thu Dec 8 18:37:28 2011 +0100
[LINUX] Add small hack driver to use APF27 TIN as counter in userspace
-----------------------------------------------------------------------
Summary of changes:
target/linux/modules/Makefile | 5 +-
target/linux/modules/imx_counter/Kconfig | 7 +
.../modules/{max1027 => imx_counter}/Makefile | 4 +-
target/linux/modules/imx_counter/gpt2_plat.c | 120 ++++++++++++++++++++
4 files changed, 131 insertions(+), 5 deletions(-)
create mode 100644 target/linux/modules/imx_counter/Kconfig
copy target/linux/modules/{max1027 => imx_counter}/Makefile (84%)
create mode 100644 target/linux/modules/imx_counter/gpt2_plat.c
diff --git a/target/linux/modules/Makefile b/target/linux/modules/Makefile
index 893d6d8..245ea86 100755
--- a/target/linux/modules/Makefile
+++ b/target/linux/modules/Makefile
@@ -5,14 +5,13 @@
#
ifneq ($(KERNELRELEASE),)
-
# Part executed when called from kernel build system:
obj-$(CONFIG_ARMADEUS_DRIVERS) += gpio/ pwm/ backlight/ isp1761/ \
- imxlkeypad/ fpga/ max1027/ max9768/ display/ as1531_platform/
+ imxlkeypad/ fpga/ max1027/ max9768/ display/ as1531_platform/ \
+ imx_counter/
else
-
# Part executed when called from standard make in this directory:
ARMADEUS_BASE_DIR=../../..
diff --git a/target/linux/modules/imx_counter/Kconfig b/target/linux/modules/imx_counter/Kconfig
new file mode 100644
index 0000000..602fae2
--- /dev/null
+++ b/target/linux/modules/imx_counter/Kconfig
@@ -0,0 +1,7 @@
+#
+#
+
+config MX27_GPT2
+ tristate "Use i.MX27 timer 2 as counter"
+ ---help---
+ TBD.
diff --git a/target/linux/modules/max1027/Makefile b/target/linux/modules/imx_counter/Makefile
similarity index 84%
copy from target/linux/modules/max1027/Makefile
copy to target/linux/modules/imx_counter/Makefile
index aef647a..a9c0ef6 100755
--- a/target/linux/modules/max1027/Makefile
+++ b/target/linux/modules/imx_counter/Makefile
@@ -1,11 +1,11 @@
#
-# Makefile for the Armadeus Max1027
+# Makefile for the ...
#
# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_ARMADEUS_MAX1027) += max1027.o
+obj-$(CONFIG_APF27_GPT2) += gpt2_plat.o
# Part executed when called from standard make in this directory:
# (preferably use Makefile in parent directory)
diff --git a/target/linux/modules/imx_counter/gpt2_plat.c b/target/linux/modules/imx_counter/gpt2_plat.c
new file mode 100644
index 0000000..74b0b05
--- /dev/null
+++ b/target/linux/modules/imx_counter/gpt2_plat.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2010 Julien Boibessot <jul...@ar...>
+ * sponsored by Armadeus Systems.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+
+#include <mach/common.h>
+#include <mach/iomux-mx1-mx2.h>
+#include <mach/gpio.h>
+
+#include <../mach-mx2/devices.h>
+
+
+struct clk *gpt2_clk;
+
+static int apf27_gpt2_pins[] = {
+ (GPIO_PORTC | GPIO_IN | GPIO_PF | 15), /* TIN */
+};
+
+static int __init gpt_plat_probe(struct platform_device *pdev)
+{
+ int ret = 0;
+
+ printk("--- %s\n", __func__);
+
+ /* Activates clock */
+ gpt2_clk = clk_get(&pdev->dev, "gpt_clk");
+
+ /* Configure TIN */
+ ret = mxc_gpio_setup_multiple_pins(apf27_gpt2_pins,
+ ARRAY_SIZE(apf27_gpt2_pins), "GPT");
+
+ return 0;
+}
+
+static int __exit gpt_plat_remove(struct platform_device *pdev)
+{
+ printk("--- %s\n", __func__);
+
+ mxc_gpio_release_multiple_pins(apf27_gpt2_pins, ARRAY_SIZE(apf27_gpt2_pins));
+
+ return 0;
+}
+
+
+MODULE_ALIAS("platform:gpt_timer");
+
+static struct platform_driver driver = {
+ .driver = {
+ .name = "imx_gpt",
+ .owner = THIS_MODULE,
+ },
+ .probe = gpt_plat_probe,
+ .remove = gpt_plat_remove,
+};
+
+static struct resource timer1_resources[] = {
+ [0] = {
+ .start = GPT2_BASE_ADDR,
+ .end = GPT2_BASE_ADDR + 0x17,
+ .flags = IORESOURCE_MEM
+ },
+ [1] = {
+ .start = MXC_INT_GPT2,
+ .end = MXC_INT_GPT2,
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+struct platform_device mxc_gpt1 = {
+ .name = "imx_gpt",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(timer1_resources),
+ .resource = timer1_resources
+};
+
+
+static int __init gpt_plat_init(void)
+{
+ printk("--- %s\n", __func__);
+
+ platform_driver_register(&driver);
+ platform_device_register(&mxc_gpt1);
+
+ return 0;
+}
+
+static void __exit gpt_plat_exit(void)
+{
+ printk("--- %s\n", __func__);
+ /* To be completed ... */
+}
+
+module_init(gpt_plat_init);
+module_exit(gpt_plat_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Julien Boibessot <jul...@ar...>");
+MODULE_DESCRIPTION("Platform data for APF27 GPT2");
+
hooks/post-receive
--
armadeus
|