Re: [PATCH net-next v3] net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841
From: Richard Cochran
Date: Sun Mar 12 2023 - 22:32:01 EST
On Fri, Mar 10, 2023 at 04:38:24PM -0800, Jakub Kicinski wrote:
> AFAICT enabling a new output will steal the event from the previous one.
> Is this normal / expected? Should you be checking if any output is
> active and refuse to enable another GPIO if so?
The PTP class layer takes care of enabling and switching of functions
among the pins. The functions (like periodic output) and the pins are
independent. The user may free assign functions to pins, and
re-assign them at will.
When switching, class layer ensures that the pin support the function,
and it also takes care of disabling functions to avoid weird behavior.
See ptp_disable_pinfunc and ptp_set_pinfunc in drivers/ptp/ptp_chardev.c
> Richard, does the patch look good to you?
Yes, looks reasonable, mostly hardware specific.
Thanks,
Richard