Ajay Singh Parmar | 158103d | 2016-05-16 16:36:59 -0700 | [diff] [blame] | 1 | /* |
Clarence Ip | 9de0bbc | 2017-03-02 09:56:06 -0500 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. |
Ajay Singh Parmar | 158103d | 2016-05-16 16:36:59 -0700 | [diff] [blame] | 3 | * |
| 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 Ip | 9de0bbc | 2017-03-02 09:56:06 -0500 | [diff] [blame] | 23 | (dsi_hw)->index, #off, (uint32_t)(val)); \ |
Ajay Singh Parmar | 158103d | 2016-05-16 16:36:59 -0700 | [diff] [blame] | 24 | 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 Venkata | afef820 | 2017-04-21 13:49:56 -0700 | [diff] [blame] | 36 | #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 Parmar | 158103d | 2016-05-16 16:36:59 -0700 | [diff] [blame] | 45 | #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_ */ |