linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tg3: Add the ability to conditionally build w/ HWMON
@ 2017-03-06 20:56 Florian Fainelli
  2017-03-09 21:04 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2017-03-06 20:56 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Siva Reddy Kallam, Prashant Sreedharan,
	Michael Chan, David S. Miller, Alexander Duyck, Thomas Gleixner,
	Nicolas Pitre, Jon Mason, open list

Introduce a Kconfig option: CONFIG_TIGON3_HWMON which allows to build
in/out support for thermal sensors reported by Tigon3 NICs.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/Kconfig | 8 +++++++-
 drivers/net/ethernet/broadcom/tg3.c   | 7 +++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index 940fb24bba21..96413808c726 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -109,7 +109,6 @@ config TIGON3
 	tristate "Broadcom Tigon3 support"
 	depends on PCI
 	select PHYLIB
-	select HWMON
 	imply PTP_1588_CLOCK
 	---help---
 	  This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
@@ -117,6 +116,13 @@ config TIGON3
 	  To compile this driver as a module, choose M here: the module
 	  will be called tg3.  This is recommended.
 
+config TIGON3_HWMON
+	bool "Broadcom Tigon3 HWMON support"
+	default y
+	depends on TIGON3 && HWMON && !(TIGON3=y && HWMON=m)
+	---help---
+	  Say Y if you want to expose the thermal sensor on Tigon3 devices.
+
 config BNX2X
 	tristate "Broadcom NetXtremeII 10Gb support"
 	depends on PCI
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 30d1eb9ebec9..f395b951f5e7 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -825,6 +825,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us)
 	return timeout_us ? 0 : -EBUSY;
 }
 
+#ifdef CONFIG_TIGON3_HWMON
 static int tg3_ape_wait_for_event(struct tg3 *tp, u32 timeout_us)
 {
 	u32 i, apedata;
@@ -904,6 +905,7 @@ static int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off,
 
 	return 0;
 }
+#endif
 
 static int tg3_ape_send_event(struct tg3 *tp, u32 event)
 {
@@ -10744,6 +10746,7 @@ static int tg3_init_hw(struct tg3 *tp, bool reset_phy)
 	return tg3_reset_hw(tp, reset_phy);
 }
 
+#ifdef CONFIG_TIGON3_HWMON
 static void tg3_sd_scan_scratchpad(struct tg3 *tp, struct tg3_ocir *ocir)
 {
 	int i;
@@ -10826,6 +10829,10 @@ static void tg3_hwmon_open(struct tg3 *tp)
 		dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n");
 	}
 }
+#else
+static inline void tg3_hwmon_close(struct tg3 *tp) { }
+static inline void tg3_hwmon_open(struct tg3 *tp) { }
+#endif /* CONFIG_TIGON3_HWMON */
 
 
 #define TG3_STAT_ADD32(PSTAT, REG) \
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tg3: Add the ability to conditionally build w/ HWMON
  2017-03-06 20:56 [PATCH net-next] tg3: Add the ability to conditionally build w/ HWMON Florian Fainelli
@ 2017-03-09 21:04 ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2017-03-09 21:04 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, siva.kallam, prashant, mchan, aduyck, tglx,
	nicolas.pitre, jon.mason, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon,  6 Mar 2017 12:56:02 -0800

> Introduce a Kconfig option: CONFIG_TIGON3_HWMON which allows to build
> in/out support for thermal sensors reported by Tigon3 NICs.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks Florian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tg3: Add the ability to conditionally build w/ HWMON
@ 2017-03-07 16:02 Siva Reddy Kallam
  0 siblings, 0 replies; 3+ messages in thread
From: Siva Reddy Kallam @ 2017-03-07 16:02 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux Netdev List, Prashant Sreedharan, Michael Chan,
	David S. Miller, Alexander Duyck, Thomas Gleixner, Nicolas Pitre,
	Jon Mason, open list

On Tue, Mar 7, 2017 at 2:26 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> Introduce a Kconfig option: CONFIG_TIGON3_HWMON which allows to build
> in/out support for thermal sensors reported by Tigon3 NICs.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
> ---
>  drivers/net/ethernet/broadcom/Kconfig | 8 +++++++-
>  drivers/net/ethernet/broadcom/tg3.c   | 7 +++++++
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
> index 940fb24bba21..96413808c726 100644
> --- a/drivers/net/ethernet/broadcom/Kconfig
> +++ b/drivers/net/ethernet/broadcom/Kconfig
> @@ -109,7 +109,6 @@ config TIGON3
>         tristate "Broadcom Tigon3 support"
>         depends on PCI
>         select PHYLIB
> -       select HWMON
>         imply PTP_1588_CLOCK
>         ---help---
>           This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
> @@ -117,6 +116,13 @@ config TIGON3
>           To compile this driver as a module, choose M here: the module
>           will be called tg3.  This is recommended.
>
> +config TIGON3_HWMON
> +       bool "Broadcom Tigon3 HWMON support"
> +       default y
> +       depends on TIGON3 && HWMON && !(TIGON3=y && HWMON=m)
> +       ---help---
> +         Say Y if you want to expose the thermal sensor on Tigon3 devices.
> +
>  config BNX2X
>         tristate "Broadcom NetXtremeII 10Gb support"
>         depends on PCI
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 30d1eb9ebec9..f395b951f5e7 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -825,6 +825,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us)
>         return timeout_us ? 0 : -EBUSY;
>  }
>
> +#ifdef CONFIG_TIGON3_HWMON
>  static int tg3_ape_wait_for_event(struct tg3 *tp, u32 timeout_us)
>  {
>         u32 i, apedata;
> @@ -904,6 +905,7 @@ static int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off,
>
>         return 0;
>  }
> +#endif
>
>  static int tg3_ape_send_event(struct tg3 *tp, u32 event)
>  {
> @@ -10744,6 +10746,7 @@ static int tg3_init_hw(struct tg3 *tp, bool reset_phy)
>         return tg3_reset_hw(tp, reset_phy);
>  }
>
> +#ifdef CONFIG_TIGON3_HWMON
>  static void tg3_sd_scan_scratchpad(struct tg3 *tp, struct tg3_ocir *ocir)
>  {
>         int i;
> @@ -10826,6 +10829,10 @@ static void tg3_hwmon_open(struct tg3 *tp)
>                 dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n");
>         }
>  }
> +#else
> +static inline void tg3_hwmon_close(struct tg3 *tp) { }
> +static inline void tg3_hwmon_open(struct tg3 *tp) { }
> +#endif /* CONFIG_TIGON3_HWMON */
>
>
>  #define TG3_STAT_ADD32(PSTAT, REG) \
> --
> 2.9.3
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-09 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 20:56 [PATCH net-next] tg3: Add the ability to conditionally build w/ HWMON Florian Fainelli
2017-03-09 21:04 ` David Miller
2017-03-07 16:02 Siva Reddy Kallam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).