Skip to contentSkip to conversation

include: dt-bindings: mfd: add atmel flexcom include file

PATCH In review Eugen Hristev 1 participant 3 messages Aug 27, 2021 – Sep 20, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 include: dt-bindings: mfd: add atmel flexcom include file

Add dt-bindings include file for Atmel Flexcom hardware block. This file is copied from Linux kernel.
It is used in devicetrees from Linux.

---
 MAINTAINERS                             |  1 +
 include/dt-bindings/mfd/atmel-flexcom.h | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 include/dt-bindings/mfd/atmel-flexcom.h
MAINTAINERS +1 -0
index 776ff703b9..f4059c1cf4 100644
@@ -312,6 +312,7 @@ F:	arch/arm/mach-at91/
 F:	board/atmel/
 F:	drivers/cpu/at91_cpu.c
 F:	drivers/misc/microchip_flexcom.c
+F:	include/dt-bindings/mfd/atmel-flexcom.h
 F:	drivers/timer/mchp-pit64b-timer.c
 
 ARM NEXELL S5P4418
include/dt-bindings/mfd/atmel-flexcom.h new file +15 -0
new file mode 100644
index 0000000000..4e2fc32363
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * This header provides macros for Atmel Flexcom DT bindings.
+ *
+ * Copyright (C) 2015 Cyrille Pitchen <[email protected]>
+ */
+
+#ifndef __DT_BINDINGS_ATMEL_FLEXCOM_H__
+#define __DT_BINDINGS_ATMEL_FLEXCOM_H__
+
+#define ATMEL_FLEXCOM_MODE_USART	1
+#define ATMEL_FLEXCOM_MODE_SPI		2
+#define ATMEL_FLEXCOM_MODE_TWI		3
+
+#endif /* __DT_BINDINGS_ATMEL_FLEXCOM_H__ */
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 ARM: dts: at91: update flexcom defines using include file

Replace the number in the flexcom-mode property with the define from the include file.
This corresponds to the approach in Linux kernel.

---
 arch/arm/dts/sam9x60ek.dts | 3 ++-
 arch/arm/dts/sama7g5ek.dts | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/dts/sam9x60ek.dts +2 -1
index 77edd593b4..32ffe93b4d 100644
@@ -7,6 +7,7 @@
  * Author: Sandeep Sheriker M <[email protected]>
  */
 /dts-v1/;
+#include <dt-bindings/mfd/atmel-flexcom.h>
 #include "sam9x60.dtsi"
 
 / {
@@ -57,7 +58,7 @@
 			};
 
 			flx0: flexcom@f801c600 {
-				atmel,flexcom-mode = <3>;
+				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
 				i2c@600 {
arch/arm/dts/sama7g5ek.dts +2 -1
index 3a4fdd38a5..1c59a8aaf8 100644
@@ -8,6 +8,7 @@
  *		  2020, Claudiu Beznea <[email protected]>
  */
 /dts-v1/;
+#include <dt-bindings/mfd/atmel-flexcom.h>
 #include "sama7g5.dtsi"
 #include "sama7g5-pinfunc.h"
 
@@ -64,7 +65,7 @@
 };
 
 &flx1 {
-	atmel,flexcom-mode = <3>;
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 };
 
Signature · 1 line
2.25.1