Skip to content

Commit 216201b

Browse files
Shyam Sundar S Kalexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci: Relocate helper macros to HCI header file
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 <[email protected]> Co-developed-by: Guruvendra Punugupati <[email protected]> Signed-off-by: Guruvendra Punugupati <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 0140893 commit 216201b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/i3c/master/mipi-i3c-hci/core.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/errno.h>
1313
#include <linux/i3c/master.h>
1414
#include <linux/interrupt.h>
15-
#include <linux/io.h>
1615
#include <linux/iopoll.h>
1716
#include <linux/module.h>
1817
#include <linux/platform_device.h>
@@ -27,11 +26,6 @@
2726
* Host Controller Capabilities and Operation Registers
2827
*/
2928

30-
#define reg_read(r) readl(hci->base_regs + (r))
31-
#define reg_write(r, v) writel(v, hci->base_regs + (r))
32-
#define reg_set(r, v) reg_write(r, reg_read(r) | (v))
33-
#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v))
34-
3529
#define HCI_VERSION 0x00 /* HCI Version (in BCD) */
3630

3731
#define HC_CONTROL 0x04

drivers/i3c/master/mipi-i3c-hci/hci.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef HCI_H
1111
#define HCI_H
1212

13+
#include <linux/io.h>
1314

1415
/* Handy logging macro to save on line length */
1516
#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
@@ -26,6 +27,10 @@
2627
#define W2_BIT_(x) BIT((x) - 64)
2728
#define W3_BIT_(x) BIT((x) - 96)
2829

30+
#define reg_read(r) readl(hci->base_regs + (r))
31+
#define reg_write(r, v) writel(v, hci->base_regs + (r))
32+
#define reg_set(r, v) reg_write(r, reg_read(r) | (v))
33+
#define reg_clear(r, v) reg_write(r, reg_read(r) & ~(v))
2934

3035
struct hci_cmd_ops;
3136

0 commit comments

Comments
 (0)