diff options
author | Richard Cochran <richardcochran@gmail.com> | 2014-03-20 17:21:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-21 14:21:13 -0400 |
commit | 6092315dfdec5185881605d15a0e200d6e90eb66 (patch) | |
tree | 8b018970396a2e2380fe51ed14d2f860ce6010e1 /drivers/ptp/ptp_private.h | |
parent | a85ae0e97879f51bccd8511668b07d346d98b3eb (diff) |
ptp: introduce programmable pins.
This patch adds a pair of new ioctls to the PTP Hardware Clock device
interface. Using the ioctls, user space programs can query each pin to
find out its current function and also reprogram a different function
if desired.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/ptp_private.h')
-rw-r--r-- | drivers/ptp/ptp_private.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h index df03f2e30ad9..b114a84c63c7 100644 --- a/drivers/ptp/ptp_private.h +++ b/drivers/ptp/ptp_private.h | |||
@@ -48,6 +48,7 @@ struct ptp_clock { | |||
48 | long dialed_frequency; /* remembers the frequency adjustment */ | 48 | long dialed_frequency; /* remembers the frequency adjustment */ |
49 | struct timestamp_event_queue tsevq; /* simple fifo for time stamps */ | 49 | struct timestamp_event_queue tsevq; /* simple fifo for time stamps */ |
50 | struct mutex tsevq_mux; /* one process at a time reading the fifo */ | 50 | struct mutex tsevq_mux; /* one process at a time reading the fifo */ |
51 | struct mutex pincfg_mux; /* protect concurrent info->pin_config access */ | ||
51 | wait_queue_head_t tsev_wq; | 52 | wait_queue_head_t tsev_wq; |
52 | int defunct; /* tells readers to go away when clock is being removed */ | 53 | int defunct; /* tells readers to go away when clock is being removed */ |
53 | }; | 54 | }; |
@@ -69,6 +70,10 @@ static inline int queue_cnt(struct timestamp_event_queue *q) | |||
69 | * see ptp_chardev.c | 70 | * see ptp_chardev.c |
70 | */ | 71 | */ |
71 | 72 | ||
73 | /* caller must hold pincfg_mux */ | ||
74 | int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, | ||
75 | enum ptp_pin_function func, unsigned int chan); | ||
76 | |||
72 | long ptp_ioctl(struct posix_clock *pc, | 77 | long ptp_ioctl(struct posix_clock *pc, |
73 | unsigned int cmd, unsigned long arg); | 78 | unsigned int cmd, unsigned long arg); |
74 | 79 | ||