ptp: ptp_clock: Publish scaled_ppm_to_ppb

[ Upstream commit 4368dada5b37e74a13b892ca5cef8a7d558e9a5f ]

Publish scaled_ppm_to_ppb to allow drivers to use it.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Shalom Toledo
2019-06-11 18:45:09 +03:00
committed by Sasha Levin
parent f8111c0d7e
commit b5200624e6
2 changed files with 10 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
spin_unlock_irqrestore(&queue->lock, flags); spin_unlock_irqrestore(&queue->lock, flags);
} }
static s32 scaled_ppm_to_ppb(long ppm) s32 scaled_ppm_to_ppb(long ppm)
{ {
/* /*
* The 'freq' field in the 'struct timex' is in parts per * The 'freq' field in the 'struct timex' is in parts per
@@ -95,6 +95,7 @@ static s32 scaled_ppm_to_ppb(long ppm)
ppb >>= 13; ppb >>= 13;
return (s32) ppb; return (s32) ppb;
} }
EXPORT_SYMBOL(scaled_ppm_to_ppb);
/* posix clock implementation */ /* posix clock implementation */

View File

@@ -204,6 +204,14 @@ extern void ptp_clock_event(struct ptp_clock *ptp,
extern int ptp_clock_index(struct ptp_clock *ptp); extern int ptp_clock_index(struct ptp_clock *ptp);
/**
* scaled_ppm_to_ppb() - convert scaled ppm to ppb
*
* @ppm: Parts per million, but with a 16 bit binary fractional field
*/
extern s32 scaled_ppm_to_ppb(long ppm);
/** /**
* ptp_find_pin() - obtain the pin index of a given auxiliary function * ptp_find_pin() - obtain the pin index of a given auxiliary function
* *