staging: fsl-dpaa2/rtc: support phc_index of ethtool_ts_info
authorYangbo Lu <yangbo.lu@nxp.com>
Thu, 26 Apr 2018 10:23:49 +0000 (18:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 13:25:08 +0000 (15:25 +0200)
This patch is to support phc_index of ethtool_ts_info.
Also make the rtc drvier depend on FSL_DPAA2_ETH because
this driver is only useful when PTP programs are getting
hardware time stamps on the PTP Ethernet packets using the
SO_TIMESTAMPING API.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-dpaa2/Kconfig
drivers/staging/fsl-dpaa2/rtc/rtc.c
drivers/staging/fsl-dpaa2/rtc/rtc.h [new file with mode: 0644]

index ea2d4aa109b0277926ed56c7e12abf599207a64d..cad016aee3b5e2b73e96ebd0f8c793e3bd85cd81 100644 (file)
@@ -27,7 +27,7 @@ config FSL_DPAA2_ETHSW
 
 config FSL_DPAA2_PTP_CLOCK
        tristate "Freescale DPAA2 PTP Clock"
-       depends on FSL_DPAA2
+       depends on FSL_DPAA2_ETH
        select PTP_1588_CLOCK
        help
          This driver adds support for using the DPAA2 1588 timer module
index 1d6405b8b5c82cff51558ad5b579b4f334bb5135..0d52cb85441f051cc1d1a072591052a1e37b7502 100644 (file)
@@ -9,14 +9,12 @@
 #include <linux/ptp_clock_kernel.h>
 #include <linux/fsl/mc.h>
 
-#include "dprtc.h"
-#include "dprtc-cmd.h"
+#include "rtc.h"
 
 struct ptp_dpaa2_priv {
        struct fsl_mc_device *rtc_mc_dev;
        struct ptp_clock *clock;
        struct ptp_clock_info caps;
-       int phc_index;
        u32 freq_comp;
 };
 
@@ -173,7 +171,7 @@ static int rtc_probe(struct fsl_mc_device *mc_dev)
                goto err_close;
        }
 
-       ptp_dpaa2->phc_index = ptp_clock_index(ptp_dpaa2->clock);
+       dpaa2_phc_index = ptp_clock_index(ptp_dpaa2->clock);
 
        dev_set_drvdata(dev, ptp_dpaa2);
 
diff --git a/drivers/staging/fsl-dpaa2/rtc/rtc.h b/drivers/staging/fsl-dpaa2/rtc/rtc.h
new file mode 100644 (file)
index 0000000..ff2e177
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __RTC_H
+#define __RTC_H
+
+#include "dprtc.h"
+#include "dprtc-cmd.h"
+
+extern int dpaa2_phc_index;
+
+#endif