blob: 8250da3af0e41ab4830f6f269bf93e8617737a83 [file] [log] [blame]
Ajay Singh Parmar158103d2016-05-16 16:36:59 -07001/*
Clarence Ip9de0bbc2017-03-02 09:56:06 -05002 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
Ajay Singh Parmar158103d2016-05-16 16:36:59 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef _DSI_HW_H_
16#define _DSI_HW_H_
17#include <linux/io.h>
18
19#define DSI_R32(dsi_hw, off) readl_relaxed((dsi_hw)->base + (off))
20#define DSI_W32(dsi_hw, off, val) \
21 do {\
22 pr_debug("[DSI_%d][%s] - [0x%08x]\n", \
Clarence Ip9de0bbc2017-03-02 09:56:06 -050023 (dsi_hw)->index, #off, (uint32_t)(val)); \
Ajay Singh Parmar158103d2016-05-16 16:36:59 -070024 writel_relaxed((val), (dsi_hw)->base + (off)); \
25 } while (0)
26
27#define DSI_MMSS_MISC_R32(dsi_hw, off) \
28 readl_relaxed((dsi_hw)->mmss_misc_base + (off))
29#define DSI_MMSS_MISC_W32(dsi_hw, off, val) \
30 do {\
31 pr_debug("[DSI_%d][%s] - [0x%08x]\n", \
32 (dsi_hw)->index, #off, val); \
33 writel_relaxed((val), (dsi_hw)->mmss_misc_base + (off)); \
34 } while (0)
35
Shashank Babu Chinta Venkataafef8202017-04-21 13:49:56 -070036#define DSI_DISP_CC_R32(dsi_hw, off) \
37 readl_relaxed((dsi_hw)->disp_cc_base + (off))
38#define DSI_DISP_CC_W32(dsi_hw, off, val) \
39 do {\
40 pr_err("[DSI_%d][%s] - [0x%08x]\n", \
41 (dsi_hw)->index, #off, val); \
42 writel_relaxed((val), (dsi_hw)->disp_cc_base + (off)); \
43 } while (0)
44
Ajay Singh Parmar158103d2016-05-16 16:36:59 -070045#define DSI_R64(dsi_hw, off) readq_relaxed((dsi_hw)->base + (off))
46#define DSI_W64(dsi_hw, off, val) writeq_relaxed((val), (dsi_hw)->base + (off))
47
48#endif /* _DSI_HW_H_ */