summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-11-08 05:42:31 +0000
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-11-08 05:42:31 +0000
commit42954b7559ad1301f19bbca26cfe3d04143a21be (patch)
tree565693728f7071be6c93ce4abb591fff7b07d5cf /target
parent909210ca4eb86201e93513eff58e5ec59ff02a67 (diff)
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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34115 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/cns3xxx/config-3.37
-rw-r--r--target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c20
2 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/cns3xxx/config-3.3 b/target/linux/cns3xxx/config-3.3
index 6963747887..4090b31103 100644
--- a/target/linux/cns3xxx/config-3.3
+++ b/target/linux/cns3xxx/config-3.3
@@ -131,6 +131,7 @@ CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_VENDOR_CAVIUM=y
CONFIG_NLS=y
CONFIG_NR_CPUS=2
+CONFIG_NTP_PPS=y
CONFIG_OUTER_CACHE=y
CONFIG_OUTER_CACHE_SYNC=y
CONFIG_PAGEFLAGS_EXTENDED=y
@@ -143,7 +144,13 @@ CONFIG_PHYLIB=y
CONFIG_PL310_ERRATA_588369=y
CONFIG_PL310_ERRATA_727915=y
CONFIG_PL310_ERRATA_769419=y
+CONFIG_PPS=y
+CONFIG_PPS_CLIENT_GPIO=y
+# CONFIG_PPS_CLIENT_KTIMER is not set
+# CONFIG_PPS_CLIENT_LDISC is not set
+# CONFIG_PPS_DEBUG is not set
# CONFIG_PREEMPT_RCU is not set
+# CONFIG_PTP_1588_CLOCK is not set
CONFIG_RAID_ATTRS=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
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 854318355e..8b611c5582 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