[PATCH] staging: axis-fifo: fix alignment and add DT binding documentation

From: Alexandru Hossu

Date: Wed Mar 04 2026 - 06:09:11 EST


Add YAML device tree binding documentation for the Xilinx
AXI-Stream FIFO IP core and fix code alignment issue.

Signed-off-by: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>From b94514738af787173717cbfa85637c53084284da Mon Sep 17 00:00:00 2001
From: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
Date: Wed, 4 Mar 2026 12:06:49 +0100
Subject: [PATCH] staging: axis-fifo: fix alignment and add DT binding
documentation

Signed-off-by: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
---
.../bindings/misc/xlnx,axi-fifo-mm-s.yaml | 77 +++++++++++++++++++
drivers/staging/axis-fifo/axis-fifo.c | 5 +-
2 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml

diff --git a/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml b/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml
new file mode 100644
index 000000000..6d1cd651e
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,axi-fifo-mm-s.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/xlnx,axi-fifo-mm-s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx AXI-Stream FIFO
+
+description: |
+ The Xilinx AXI-Stream FIFO IP core has read and write AXI-Stream FIFOs,
+ the contents of which can be accessed from the AXI4 memory-mapped interface.
+ Currently supports only store-forward mode with a 32-bit AXI4-Lite interface.
+
+maintainers:
+ - Jolly Shah <jollys@xxxxxxxxxx>
+
+properties:
+ compatible:
+ enum:
+ - xlnx,axi-fifo-mm-s-4.1
+ - xlnx,axi-fifo-mm-s-4.2
+ - xlnx,axi-fifo-mm-s-4.3
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-names:
+ items:
+ - const: interrupt
+
+ interrupt-parent: true
+
+ xlnx,use-rx-data:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1]
+ description: Set to 1 if RX FIFO is enabled, 0 otherwise.
+
+ xlnx,use-tx-data:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1]
+ description: Set to 1 if TX FIFO is enabled, 0 otherwise.
+
+ xlnx,rx-fifo-depth:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Depth of RX FIFO in words.
+
+ xlnx,tx-fifo-depth:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Depth of TX FIFO in words.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - interrupt-parent
+ - xlnx,use-rx-data
+ - xlnx,use-tx-data
+
+additionalProperties: true
+
+examples:
+ - |
+ axi_fifo_mm_s_0: axi_fifo_mm_s@43c00000 {
+ compatible = "xlnx,axi-fifo-mm-s-4.1";
+ interrupt-names = "interrupt";
+ interrupt-parent = <&intc>;
+ interrupts = <0 29 4>;
+ reg = <0x43c00000 0x10000>;
+ xlnx,use-rx-data = <0x0>;
+ xlnx,use-tx-data = <0x1>;
+ xlnx,rx-fifo-depth = <0x200>;
+ xlnx,tx-fifo-depth = <0x8000>;
+ };
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index aa90b2719..6ca2bf4d4 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -245,8 +245,11 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
} else {
mutex_lock(&fifo->write_lock);

+ u32 free_space;
+
+ free_space = ioread32(fifo->base_addr + XLLF_TDFV_OFFSET);
ret = wait_event_interruptible(fifo->write_queue,
- ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >= words_to_write);
+ free_space >= words_to_write);
if (ret)
goto end_unlock;
}
--
2.43.0