1 /* SPDX-License-Identifier: GPL-2.0 or MIT */
3 /* Copyright 2019 Collabora ltd. */
5 #ifndef __PANTHOR_GPU_H__
6 #define __PANTHOR_GPU_H__
10 int panthor_gpu_init(struct panthor_device *ptdev);
11 void panthor_gpu_unplug(struct panthor_device *ptdev);
12 void panthor_gpu_suspend(struct panthor_device *ptdev);
13 void panthor_gpu_resume(struct panthor_device *ptdev);
15 int panthor_gpu_block_power_on(struct panthor_device *ptdev,
17 u32 pwron_reg, u32 pwrtrans_reg,
18 u32 rdy_reg, u64 mask, u32 timeout_us);
19 int panthor_gpu_block_power_off(struct panthor_device *ptdev,
21 u32 pwroff_reg, u32 pwrtrans_reg,
22 u64 mask, u32 timeout_us);
25 * panthor_gpu_power_on() - Power on the GPU block.
27 * Return: 0 on success, a negative error code otherwise.
29 #define panthor_gpu_power_on(ptdev, type, mask, timeout_us) \
30 panthor_gpu_block_power_on(ptdev, #type, \
32 type ## _PWRTRANS_LO, \
37 * panthor_gpu_power_off() - Power off the GPU block.
39 * Return: 0 on success, a negative error code otherwise.
41 #define panthor_gpu_power_off(ptdev, type, mask, timeout_us) \
42 panthor_gpu_block_power_off(ptdev, #type, \
44 type ## _PWRTRANS_LO, \
47 int panthor_gpu_l2_power_on(struct panthor_device *ptdev);
48 int panthor_gpu_flush_caches(struct panthor_device *ptdev,
49 u32 l2, u32 lsc, u32 other);
50 int panthor_gpu_soft_reset(struct panthor_device *ptdev);