• Horatiu Vultur's avatar
    net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841 · e4ed8ba0
    Horatiu Vultur authored
    Lan8841 has 10 GPIOs and it has 2 events(EVENT_A and EVENT_B). It is
    possible to assigned the 2 events to any of the GPIOs, but a GPIO can
    have only 1 event at a time.
    These events are used to generate periodic signals. It is possible to
    configure the length, the start time and the period of the signal by
    configuring the event.
    Currently the SW uses only EVENT_A to generate the perout.
    
    These events are generated by comparing the target time with the PHC
    time. In case the PHC time is changed to a value bigger than the target
    time + reload time, then it would generate only 1 event and then it
    would stop because target time + reload time is small than PHC time.
    Therefore it is required to change also the target time every time when
    the PHC is changed. The same will apply also when the PHC time is
    changed to a smaller value.
    
    This was tested using:
    testptp -L 6,2
    testptp -p 1000000000 -w 200000000
    Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
    Link: https://lore.kernel.org/r/20230307214402.793057-1-horatiu.vultur@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    e4ed8ba0
micrel.c 125 KB