[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230315002239.ticvivruobuwcvwz@skbuf>
Date: Wed, 15 Mar 2023 02:22:39 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Gregory Clement <gregory.clement@...tlin.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
John Crispin <john@...ozen.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, Lee Jones <lee@...nel.org>,
linux-leds@...r.kernel.org
Subject: Re: [net-next PATCH v3 02/14] net: dsa: qca8k: add LEDs basic support
On Tue, Mar 14, 2023 at 11:15:04AM +0100, Christian Marangi wrote:
> Add LEDs basic support for qca8k Switch Family by adding basic
> brightness_set() support.
>
> Since these LEDs refelect port status, the default label is set to
> ":port". DT binding should describe the color, function and number of
> the leds using standard LEDs api.
>
> These LEDs supports only blocking variant of the brightness_set()
> function since they can sleep during access of the switch leds to set
> the brightness.
>
> While at it add to the qca8k header file each mode defined by the Switch
> Documentation for future use.
>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
> drivers/net/dsa/qca/Kconfig | 7 ++
> drivers/net/dsa/qca/Makefile | 1 +
> drivers/net/dsa/qca/qca8k-8xxx.c | 4 +
> drivers/net/dsa/qca/qca8k-leds.c | 191 +++++++++++++++++++++++++++++++
> drivers/net/dsa/qca/qca8k.h | 69 +++++++++++
> 5 files changed, 272 insertions(+)
> create mode 100644 drivers/net/dsa/qca/qca8k-leds.c
>
> diff --git a/drivers/net/dsa/qca/Kconfig b/drivers/net/dsa/qca/Kconfig
> index ba339747362c..9ed9d9cf80eb 100644
> --- a/drivers/net/dsa/qca/Kconfig
> +++ b/drivers/net/dsa/qca/Kconfig
> @@ -15,3 +15,10 @@ config NET_DSA_QCA8K
> help
> This enables support for the Qualcomm Atheros QCA8K Ethernet
> switch chips.
> +
> +config NET_DSA_QCA8K_LEDS_SUPPORT
> + bool "Qualcomm Atheros QCA8K Ethernet switch family LEDs support"
> + depends on NET_DSA_QCA8K
> + help
> + This enabled support for LEDs present on the Qualcomm Atheros
> + QCA8K Ethernet switch chips.
> diff --git a/drivers/net/dsa/qca/Makefile b/drivers/net/dsa/qca/Makefile
> index 701f1d199e93..330ae389e489 100644
> --- a/drivers/net/dsa/qca/Makefile
> +++ b/drivers/net/dsa/qca/Makefile
> @@ -2,3 +2,4 @@
> obj-$(CONFIG_NET_DSA_AR9331) += ar9331.o
> obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o
> qca8k-y += qca8k-common.o qca8k-8xxx.o
> +obj-$(CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT) += qca8k-leds.o
Isn't this what you want instead?
ifdef CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT
qca8k-y += qca8k-leds.o
endif
you don't want to have to export the qca8k_setup_led_ctrl() symbol...
you want it to be part of the same module AFAIU.
> +/* Leds Support function */
> +#ifdef CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT
> +int qca8k_setup_led_ctrl(struct qca8k_priv *priv);
> +#else
> +static inline int qca8k_setup_led_ctrl(struct qca8k_priv *priv)
> +{
> + return 0;
> +}
> +#endif
Could there be just a qca8k-leds.h with the function prototypes exported
by qca8k-leds.c?
Powered by blists - more mailing lists