Hello,
I tried to use the pps kernel driver with pps-gpio client in a verdin imx8mm module. I did the following additions in the dts files:
In the {/ section:
*pps: pps {
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio8>;
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
status = "okay";
};*
In the kernel boot the driver failed to load with this message:
“failed to request PPS GPIO”
I did some debugging and the devm_gpiod_get function call in the pps-gpio.c file returned with this error:
“No GPIO consumer found”
I modified the pps_gpio_probe function in the pps-gpio.c like this:
/* GPIO setup */
if (pdata) {
data->gpio_pin = pdata->gpio_pin;
data->echo_pin = pdata->echo_pin;
data->assert_falling_edge = pdata->assert_falling_edge;
data->capture_clear = pdata->capture_clear;
data->echo_active_ms = pdata->echo_active_ms;
} else {
struct device_node *np = pdev->dev.of_node;
ret = of_get_gpio(np, 0);
if (ret < 0) {
dev_err(&pdev->dev, "failed to get GPIO from device tree\n");
return ret;
}
data->gpio_pin = gpio_to_desc(ret);
if (of_get_property(np, "assert-falling-edge", NULL))
data->assert_falling_edge = true;
// ret = pps_gpio_setup(pdev);
// if (ret)
// return -EINVAL;
}
and now the pps-gpio is working.
It seems that the driver does not work with the kernel’s gpiolib framework.
Is this true, or am I missing something in the pps configuration? The gpiolib is enabled in the kernel configuration.
Best Regards,
Giannis