23 #define PPS_GPIO_NAME "pps-gpio"
24 #define pr_fmt(fmt) PPS_GPIO_NAME ": " fmt
27 #include <linux/kernel.h>
29 #include <linux/module.h>
31 #include <linux/slab.h>
35 #include <linux/list.h>
61 if ((rising_edge && !info->
pdata->assert_falling_edge) ||
62 (!rising_edge && info->
pdata->assert_falling_edge))
64 else if (info->
pdata->capture_clear &&
65 ((rising_edge && info->
pdata->assert_falling_edge) ||
66 (!rising_edge && !info->
pdata->assert_falling_edge)))
113 int pps_default_params;
118 ret = pps_gpio_setup(pdev);
125 pr_err(
"failed to map GPIO to IRQ: %d\n", irq);
154 pr_err(
"failed to register IRQ %d as PPS source\n", irq);
164 get_irqf_trigger_flags(pdata), data->
info.name, data);
168 pr_err(
"failed to acquire IRQ %d\n", irq);
173 platform_set_drvdata(pdev, data);
174 dev_info(data->
pps->dev,
"Registered IRQ %d as PPS source\n", irq);
188 platform_set_drvdata(pdev,
NULL);
192 pr_info(
"removed IRQ %d as PPS source\n", data->
irq);
198 .probe = pps_gpio_probe,
206 static int __init pps_gpio_init(
void)
210 pr_err(
"failed to register platform driver\n");
214 static void __exit pps_gpio_exit(
void)
217 pr_debug(
"unregistered platform driver\n");