Re: [PATCH v2 2/2] PTP: add support for one-shot output

From: Richard Cochran
Date: Sat Aug 31 2019 - 11:02:00 EST


On Fri, Aug 30, 2019 at 11:00:20AM +0300, Felipe Balbi wrote:
> seems like this should be defined together with the other flags? If
> that's the case, it seems like we would EXTTS and PEROUT masks.

Yes, let's make the meanings of the bit fields clear...

--- ptp_clock.h ---

/*
* Bits of the ptp_extts_request.flags field:
*/
#define PTP_ENABLE_FEATURE BIT(0)
#define PTP_RISING_EDGE BIT(1)
#define PTP_FALLING_EDGE BIT(2)
#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
PTP_RISING_EDGE | \
PTP_FALLING_EDGE)

/*
* Bits of the ptp_perout_request.flags field:
*/
#define PTP_PEROUT_ONE_SHOT BIT(0)
#define PTP_PEROUT_VALID_FLAGS (PTP_PEROUT_ONE_SHOT)

struct ptp_extts_request {
unsigned int flags; /* Bit field of PTP_EXTTS_VALID_FLAGS. */
};

struct ptp_perout_request {
unsigned int flags; /* Bit field of PTP_PEROUT_VALID_FLAGS. */
};


Thanks,
Richard