mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pps: clients: pps-gpio: fix echo pin configuration
@ 2026-02-27 15:45 Dylan Laduranty via B4 Relay
  2026-03-02  8:11 ` Rodolfo Giometti
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Laduranty via B4 Relay @ 2026-02-27 15:45 UTC (permalink / raw)
  To: Rodolfo Giometti; +Cc: linux-kernel, Dylan Laduranty

From: Dylan Laduranty <dylan.laduranty@mesotic.com>

This patch adds PPS_ECHOASSERT and PPS_ECHOCLEAR to pps_default_params
when needed.

The pps_gpio_echo() function will check if these flags are set inside
params.mode to update the echo pin state.

However, these flags need to be set during probe sequence otherwise
pps_gpio_echo() function will never update the pin's state.

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
---
 drivers/pps/clients/pps-gpio.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index 935da68610c701e6d9de53c667237f77438d7107..83ca24118eccfdb9eebe272023ef4980c9d54cf2 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -200,8 +200,13 @@ static int pps_gpio_probe(struct platform_device *pdev)
 
 	/* register PPS source */
 	pps_default_params = PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
-	if (data->capture_clear)
+	if (data->echo_pin)
+		pps_default_params |= PPS_ECHOASSERT;
+	if (data->capture_clear) {
 		pps_default_params |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR;
+		if (data->echo_pin)
+			pps_default_params |= PPS_ECHOCLEAR;
+	}
 	data->pps = pps_register_source(&data->info, pps_default_params);
 	if (IS_ERR(data->pps)) {
 		dev_err(dev, "failed to register IRQ %d as PPS source\n",

---
base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
change-id: 20260227-drivers-pps-clients-fix-echo-pin-setup-fe52d3b8596f

Best regards,
-- 
Dylan Laduranty <dylan.laduranty@mesotic.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pps: clients: pps-gpio: fix echo pin configuration
  2026-02-27 15:45 [PATCH] pps: clients: pps-gpio: fix echo pin configuration Dylan Laduranty via B4 Relay
@ 2026-03-02  8:11 ` Rodolfo Giometti
  0 siblings, 0 replies; 2+ messages in thread
From: Rodolfo Giometti @ 2026-03-02  8:11 UTC (permalink / raw)
  To: dylan.laduranty; +Cc: linux-kernel, Greg Kroah-Hartman, Andrew Morton

On 2/27/26 16:45, Dylan Laduranty via B4 Relay wrote:
> From: Dylan Laduranty <dylan.laduranty@mesotic.com>
> 
> This patch adds PPS_ECHOASSERT and PPS_ECHOCLEAR to pps_default_params
> when needed.
> 
> The pps_gpio_echo() function will check if these flags are set inside
> params.mode to update the echo pin state.
> 
> However, these flags need to be set during probe sequence otherwise
> pps_gpio_echo() function will never update the pin's state.
> 
> Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>

Acked-by: Rodolfo Giometti <giometti@enneenne.com>

> ---
>   drivers/pps/clients/pps-gpio.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
> index 935da68610c701e6d9de53c667237f77438d7107..83ca24118eccfdb9eebe272023ef4980c9d54cf2 100644
> --- a/drivers/pps/clients/pps-gpio.c
> +++ b/drivers/pps/clients/pps-gpio.c
> @@ -200,8 +200,13 @@ static int pps_gpio_probe(struct platform_device *pdev)
>   
>   	/* register PPS source */
>   	pps_default_params = PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
> -	if (data->capture_clear)
> +	if (data->echo_pin)
> +		pps_default_params |= PPS_ECHOASSERT;
> +	if (data->capture_clear) {
>   		pps_default_params |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR;
> +		if (data->echo_pin)
> +			pps_default_params |= PPS_ECHOCLEAR;
> +	}
>   	data->pps = pps_register_source(&data->info, pps_default_params);
>   	if (IS_ERR(data->pps)) {
>   		dev_err(dev, "failed to register IRQ %d as PPS source\n",
> 
> ---
> base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
> change-id: 20260227-drivers-pps-clients-fix-echo-pin-setup-fe52d3b8596f
> 
> Best regards,


-- 
GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-27 15:45 [PATCH] pps: clients: pps-gpio: fix echo pin configuration Dylan Laduranty via B4 Relay
2026-03-02  8:11 ` Rodolfo Giometti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®