ptp: ptp_clock: Publish scaled_ppm_to_ppb
authorShalom Toledo <shalomt@mellanox.com>
Tue, 11 Jun 2019 15:45:09 +0000 (18:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jun 2019 05:34:55 +0000 (22:34 -0700)
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>
drivers/ptp/ptp_clock.c
include/linux/ptp_clock_kernel.h

index e189fa1be21e41f2431de1b20368faf1ff21f9c9..e60eab7f8a616f90a2d0c061368610ef994100c7 100644 (file)
@@ -63,7 +63,7 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
        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
@@ -82,6 +82,7 @@ static s32 scaled_ppm_to_ppb(long ppm)
        ppb >>= 13;
        return (s32) ppb;
 }
+EXPORT_SYMBOL(scaled_ppm_to_ppb);
 
 /* posix clock implementation */
 
index 28eb9c79252288e4bb76a0416f41ee958545dbca..93cc4f1d444ae86cd0b449e8b6791179cd7b35d8 100644 (file)
@@ -212,6 +212,14 @@ extern void ptp_clock_event(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
  *