[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210506135704.GA3340759@robh.at.kernel.org>
Date: Thu, 6 May 2021 08:57:04 -0500
From: Rob Herring <robh@...nel.org>
To: Robert Marko <robert.marko@...tura.hr>
Cc: lee.jones@...aro.org, linus.walleij@...aro.org,
bgolaszewski@...libre.com, jdelvare@...e.com, linux@...ck-us.net,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-hwmon@...r.kernel.org,
luka.perkov@...tura.hr, jmp@...phyte.org, pmenzel@...gen.mpg.de,
buczek@...gen.mpg.de
Subject: Re: [PATCH 2/6] dt-bindings: gpio: Add Delta TN48M CPLD GPIO bindings
On Fri, Apr 30, 2021 at 02:35:07PM +0200, Robert Marko wrote:
> CPLD inside of the Delta TN48M does not number GPIOs
> at all, so in order to ensure numbering lets use bindigs.
Looking at the code, I'd make the gpio number something like '(offset <<
8) | bit' rather than just making up an index.
We don't normally have defines for GPIO numbers either.
>
> Signed-off-by: Robert Marko <robert.marko@...tura.hr>
> ---
> include/dt-bindings/gpio/tn48m-gpio.h | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 include/dt-bindings/gpio/tn48m-gpio.h
>
> diff --git a/include/dt-bindings/gpio/tn48m-gpio.h b/include/dt-bindings/gpio/tn48m-gpio.h
> new file mode 100644
> index 000000000000..4ece4826d746
> --- /dev/null
> +++ b/include/dt-bindings/gpio/tn48m-gpio.h
> @@ -0,0 +1,26 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * GPIO definitions for Delta TN48M CPLD GPIO driver
> + *
> + * Copyright 2020 Sartura Ltd
> + *
> + * Author: Robert Marko <robert.marko@...tura.hr>
> + */
> +
> +#ifndef _DT_BINDINGS_TN48M_GPIO_H
> +#define _DT_BINDINGS_TN48M_GPIO_H
> +
> +#define SFP_TX_DISABLE_52 0
> +#define SFP_TX_DISABLE_51 1
> +#define SFP_TX_DISABLE_50 2
> +#define SFP_TX_DISABLE_49 3
> +#define SFP_PRESENT_52 4
> +#define SFP_PRESENT_51 5
> +#define SFP_PRESENT_50 6
> +#define SFP_PRESENT_49 7
> +#define SFP_LOS_52 8
> +#define SFP_LOS_51 9
> +#define SFP_LOS_50 10
> +#define SFP_LOS_49 11
> +
> +#endif /* _DT_BINDINGS_TN48M_GPIO_H */
> --
> 2.31.1
>
Powered by blists - more mailing lists