Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1cbfd77 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Thomas Gleixner
Browse files

ptp_clock: Allow for it to be optional



In order to break the hard dependency between the PTP clock subsystem and
ethernet drivers capable of being clock providers, this patch provides
simple PTP stub functions to allow linkage of those drivers into the
kernel even when the PTP subsystem is configured out. Drivers must be
ready to accept NULL from ptp_clock_register() in that case.

And to make it possible for PTP to be configured out, the select statement
in those driver's Kconfig menu entries is converted to the new "imply"
statement. This way the PTP subsystem may have Kconfig dependencies of
its own, such as POSIX_TIMERS, without having to make those ethernet
drivers unavailable if POSIX timers are cconfigured out. And when support
for POSIX timers is selected again then the default config option for PTP
clock support will automatically be adjusted accordingly.

The pch_gbe driver is a bit special as it relies on extra code in
drivers/ptp/ptp_pch.c. Therefore we let the make process descend into
drivers/ptp/ even if PTP_1588_CLOCK is unselected.

Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Acked-by: default avatarEdward Cree <ecree@solarflare.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarJohn Stultz <john.stultz@linaro.org>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: linux-kbuild@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Michal Marek <mmarek@suse.com>
Link: http://lkml.kernel.org/r/1478841010-28605-4-git-send-email-nicolas.pitre@linaro.org


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 32ce5ac8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ obj-$(CONFIG_INPUT) += input/
obj-$(CONFIG_RTC_LIB)		+= rtc/
obj-y				+= i2c/ media/
obj-$(CONFIG_PPS)		+= pps/
obj-$(CONFIG_PTP_1588_CLOCK)	+= ptp/
obj-y				+= ptp/
obj-$(CONFIG_W1)		+= w1/
obj-y				+= power/
obj-$(CONFIG_HWMON)		+= hwmon/
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ config BFIN_RX_DESC_NUM
config BFIN_MAC_USE_HWSTAMP
	bool "Use IEEE 1588 hwstamp"
	depends on BFIN_MAC && BF518
	select PTP_1588_CLOCK
	imply PTP_1588_CLOCK
	default y
	---help---
	  To support the IEEE 1588 Precision Time Protocol (PTP), select y here
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ config AMD_XGBE
	depends on ARM64 || COMPILE_TEST
	select BITREVERSE
	select CRC32
	select PTP_1588_CLOCK
	imply PTP_1588_CLOCK
	---help---
	  This driver supports the AMD 10GbE Ethernet device found on an
	  AMD SoC.
+4 −2
Original line number Diff line number Diff line
@@ -773,6 +773,7 @@ static int xgbe_probe(struct platform_device *pdev)
		goto err_wq;
	}

	if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
		xgbe_ptp_register(pdata);

	xgbe_debugfs_init(pdata);
@@ -812,6 +813,7 @@ static int xgbe_remove(struct platform_device *pdev)

	xgbe_debugfs_exit(pdata);

	if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
		xgbe_ptp_unregister(pdata);

	flush_workqueue(pdata->an_workqueue);
+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ config TIGON3
	depends on PCI
	select PHYLIB
	select HWMON
	select PTP_1588_CLOCK
	imply PTP_1588_CLOCK
	---help---
	  This driver supports Broadcom Tigon3 based gigabit Ethernet cards.

@@ -120,7 +120,7 @@ config TIGON3
config BNX2X
	tristate "Broadcom NetXtremeII 10Gb support"
	depends on PCI
	select PTP_1588_CLOCK
	imply PTP_1588_CLOCK
	select FW_LOADER
	select ZLIB_INFLATE
	select LIBCRC32C
Loading