diff mbox series

[RESEND,1/5] dt-bindings: net: add bitfield defines for Ethernet speeds

Message ID 20220505135512.3486-2-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: support Ethernet devices as LED triggers | expand

Commit Message

Rafał Miłecki May 5, 2022, 1:55 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

This allows specifying multiple Ethernet speeds in a single DT uint32
value.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 include/dt-bindings/net/eth.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 include/dt-bindings/net/eth.h

Comments

Rob Herring May 17, 2022, 8:35 p.m. UTC | #1
On Thu, May 05, 2022 at 03:55:08PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> This allows specifying multiple Ethernet speeds in a single DT uint32
> value.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  include/dt-bindings/net/eth.h | 27 +++++++++++++++++++++++++++

ethernet.h

>  1 file changed, 27 insertions(+)
>  create mode 100644 include/dt-bindings/net/eth.h
> 
> diff --git a/include/dt-bindings/net/eth.h b/include/dt-bindings/net/eth.h
> new file mode 100644
> index 000000000000..89caff09179b
> --- /dev/null
> +++ b/include/dt-bindings/net/eth.h
> @@ -0,0 +1,27 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */

Dual license

> +/*
> + * Device Tree constants for the Ethernet
> + */
> +
> +#ifndef _DT_BINDINGS_ETH_H
> +#define _DT_BINDINGS_ETH_H
> +
> +#define SPEED_UNSPEC		0
> +#define SPEED_10		(1 << 0)
> +#define SPEED_100		(1 << 1)
> +#define SPEED_1000		(1 << 2)
> +#define SPEED_2000		(1 << 3)
> +#define SPEED_2500		(1 << 4)
> +#define SPEED_5000		(1 << 5)
> +#define SPEED_10000		(1 << 6)
> +#define SPEED_14000		(1 << 7)
> +#define SPEED_20000		(1 << 8)
> +#define SPEED_25000		(1 << 9)
> +#define SPEED_40000		(1 << 10)
> +#define SPEED_50000		(1 << 11)
> +#define SPEED_56000		(1 << 12)
> +#define SPEED_100000		(1 << 13)
> +#define SPEED_200000		(1 << 14)
> +#define SPEED_400000		(1 << 15)

These should probably have some namespace. ETH_*?
> +
> +#endif
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/include/dt-bindings/net/eth.h b/include/dt-bindings/net/eth.h
new file mode 100644
index 000000000000..89caff09179b
--- /dev/null
+++ b/include/dt-bindings/net/eth.h
@@ -0,0 +1,27 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Device Tree constants for the Ethernet
+ */
+
+#ifndef _DT_BINDINGS_ETH_H
+#define _DT_BINDINGS_ETH_H
+
+#define SPEED_UNSPEC		0
+#define SPEED_10		(1 << 0)
+#define SPEED_100		(1 << 1)
+#define SPEED_1000		(1 << 2)
+#define SPEED_2000		(1 << 3)
+#define SPEED_2500		(1 << 4)
+#define SPEED_5000		(1 << 5)
+#define SPEED_10000		(1 << 6)
+#define SPEED_14000		(1 << 7)
+#define SPEED_20000		(1 << 8)
+#define SPEED_25000		(1 << 9)
+#define SPEED_40000		(1 << 10)
+#define SPEED_50000		(1 << 11)
+#define SPEED_56000		(1 << 12)
+#define SPEED_100000		(1 << 13)
+#define SPEED_200000		(1 << 14)
+#define SPEED_400000		(1 << 15)
+
+#endif