summaryrefslogtreecommitdiff
path: root/target/linux/cns3xxx/files/arch
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2012-11-08 05:42:31 +0000
committerImre Kaloz <kaloz@openwrt.org>2012-11-08 05:42:31 +0000
commit0da0dc0f2be730e95d21e024166a19e99c84a41a (patch)
treede5cfc2fa4fcc86d35b4e1925a571d995f4fe2d0 /target/linux/cns3xxx/files/arch
parentefcdc21824f04c32aa9f12fcbb18d38827d2f639 (diff)
downloadmtk-20170518-0da0dc0f2be730e95d21e024166a19e99c84a41a.zip
mtk-20170518-0da0dc0f2be730e95d21e024166a19e99c84a41a.tar.gz
mtk-20170518-0da0dc0f2be730e95d21e024166a19e99c84a41a.tar.bz2
cns3xxx: add PPS support for laguna
Many Laguna products have on-board GPS with Pulse-per-second (PPS) support. This patch adds kernel support (statically) and adds the platform data in laguna board support. Signed-off-by: Tim Harvey <tharvey@gateworks.com> SVN-Revision: 34115
Diffstat (limited to 'target/linux/cns3xxx/files/arch')
-rw-r--r--target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index 8543183..8b611c5 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -36,6 +36,7 @@
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#include <linux/if_ether.h>
+#include <linux/pps-gpio.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -581,6 +582,22 @@ static struct platform_device laguna_watchdog = {
};
/*
+ * GPS PPS
+ */
+static struct pps_gpio_platform_data laguna_pps_data = {
+ .gpio_pin = 0,
+ .gpio_label = "GPS_PPS",
+ .assert_falling_edge = 0,
+ .capture_clear = 0,
+};
+
+static struct platform_device laguna_pps_device = {
+ .name = "pps-gpio",
+ .id = -1,
+ .dev.platform_data = &laguna_pps_data,
+};
+
+/*
* GPIO
*/
@@ -869,6 +886,9 @@ static int __init laguna_model_setup(void)
(laguna_info.config_bitmap & SPI1_LOAD))
platform_device_register(&laguna_spi_controller);
+ if (laguna_info.config2_bitmap & GPS_LOAD)
+ platform_device_register(&laguna_pps_device);
+
/*
* Do any model specific setup not known by the bitmap by matching
* the first 6 characters of the model name