|
33 | 33 | #include <linux/module.h>
|
34 | 34 | #include <linux/spi/spi.h>
|
35 | 35 | #include <linux/w1-gpio.h>
|
| 36 | +#include <linux/pps-gpio.h> |
36 | 37 |
|
37 | 38 | #include <linux/version.h>
|
38 | 39 | #include <linux/clkdev.h>
|
@@ -90,6 +91,7 @@ static unsigned disk_led_active_low = 1;
|
90 | 91 | static unsigned reboot_part = 0;
|
91 | 92 | static unsigned w1_gpio_pin = W1_GPIO;
|
92 | 93 | static unsigned w1_gpio_pullup = W1_PULLUP;
|
| 94 | +static int pps_gpio_pin = -1; |
93 | 95 | static unsigned bcm2835_mmc = 1;
|
94 | 96 | static bool vc_i2c_override = false;
|
95 | 97 |
|
@@ -282,6 +284,19 @@ static struct platform_device w1_device = {
|
282 | 284 | };
|
283 | 285 | #endif
|
284 | 286 |
|
| 287 | +static struct pps_gpio_platform_data pps_gpio_info = { |
| 288 | + .assert_falling_edge = false, |
| 289 | + .capture_clear = false, |
| 290 | + .gpio_pin = -1, |
| 291 | + .gpio_label = "PPS", |
| 292 | +}; |
| 293 | + |
| 294 | +static struct platform_device pps_gpio_device = { |
| 295 | + .name = "pps-gpio", |
| 296 | + .id = PLATFORM_DEVID_NONE, |
| 297 | + .dev.platform_data = &pps_gpio_info, |
| 298 | +}; |
| 299 | + |
285 | 300 | static u64 fb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
|
286 | 301 |
|
287 | 302 | static struct platform_device bcm2708_fb_device = {
|
@@ -851,6 +866,12 @@ void __init bcm2708_init(void)
|
851 | 866 | bcm_register_device(&bcm2708_vcio_device);
|
852 | 867 | #ifdef CONFIG_BCM2708_GPIO
|
853 | 868 | bcm_register_device(&bcm2708_gpio_device);
|
| 869 | + if (pps_gpio_pin >= 0) { |
| 870 | + pr_info("bcm2708: GPIO %d setup as pps-gpio device\n", pps_gpio_pin); |
| 871 | + pps_gpio_info.gpio_pin = pps_gpio_pin; |
| 872 | + pps_gpio_device.id = pps_gpio_pin; |
| 873 | + bcm_register_device(&pps_gpio_device); |
| 874 | + } |
854 | 875 | #endif
|
855 | 876 | #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
|
856 | 877 | w1_gpio_pdata.pin = w1_gpio_pin;
|
@@ -1111,6 +1132,8 @@ module_param(disk_led_active_low, uint, 0644);
|
1111 | 1132 | module_param(reboot_part, uint, 0644);
|
1112 | 1133 | module_param(w1_gpio_pin, uint, 0644);
|
1113 | 1134 | module_param(w1_gpio_pullup, uint, 0644);
|
| 1135 | +module_param(pps_gpio_pin, int, 0644); |
| 1136 | +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); |
1114 | 1137 | module_param(bcm2835_mmc, uint, 0644);
|
1115 | 1138 | module_param(vc_i2c_override, bool, 0644);
|
1116 | 1139 | MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral.");
|
0 commit comments