]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i3c: mipi-i3c-hci: Relocate helper macros to HCI header file
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Thu, 29 Aug 2024 09:17:11 +0000 (14:47 +0530)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 5 Sep 2024 16:34:09 +0000 (18:34 +0200)
The reg_* helper macros are currently limited to core.c. Moving them to
hci.h will allow their functionality to be utilized in other files outside
of core.c.

Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Co-developed-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com>
Signed-off-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20240829091713.736217-5-Shyam-sundar.S-k@amd.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/mipi-i3c-hci/core.c
drivers/i3c/master/mipi-i3c-hci/hci.h

index 23abf91b277bee44adc9bf00a180634ae758f5d9..c03e8669007334a30a5bee1e508ccd831109fc8e 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/errno.h>
 #include <linux/i3c/master.h>
 #include <linux/interrupt.h>
-#include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
  * Host Controller Capabilities and Operation Registers
  */
 
-#define reg_read(r)            readl(hci->base_regs + (r))
-#define reg_write(r, v)                writel(v, hci->base_regs + (r))
-#define reg_set(r, v)          reg_write(r, reg_read(r) | (v))
-#define reg_clear(r, v)                reg_write(r, reg_read(r) & ~(v))
-
 #define HCI_VERSION                    0x00    /* HCI Version (in BCD) */
 
 #define HC_CONTROL                     0x04
index c56b838fb431338b20da0ee8fe5ae68679ed325a..76658789b0180c9338565f569edb8d24f4ebc27e 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef HCI_H
 #define HCI_H
 
+#include <linux/io.h>
 
 /* Handy logging macro to save on line length */
 #define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
 #define W2_BIT_(x)  BIT((x) - 64)
 #define W3_BIT_(x)  BIT((x) - 96)
 
+#define reg_read(r)            readl(hci->base_regs + (r))
+#define reg_write(r, v)                writel(v, hci->base_regs + (r))
+#define reg_set(r, v)          reg_write(r, reg_read(r) | (v))
+#define reg_clear(r, v)                reg_write(r, reg_read(r) & ~(v))
 
 struct hci_cmd_ops;