3 * (C) COPYRIGHT 2014 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
21 * Backend-specific HW access device APIs
24 #ifndef _KBASE_DEVICE_INTERNAL_H_
25 #define _KBASE_DEVICE_INTERNAL_H_
28 * kbase_reg_write - write to GPU register
29 * @kbdev: Kbase device pointer
30 * @offset: Offset of register
31 * @value: Value to write
32 * @kctx: Kbase context pointer. May be NULL
34 * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
35 * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
36 * != KBASEP_AS_NR_INVALID).
38 void kbase_reg_write(struct kbase_device *kbdev, u16 offset, u32 value,
39 struct kbase_context *kctx);
42 * kbase_reg_read - read from GPU register
43 * @kbdev: Kbase device pointer
44 * @offset: Offset of register
45 * @kctx: Kbase context pointer. May be NULL
47 * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
48 * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
49 * != KBASEP_AS_NR_INVALID).
51 * Return: Value in desired register
53 u32 kbase_reg_read(struct kbase_device *kbdev, u16 offset,
54 struct kbase_context *kctx);
58 * kbase_gpu_interrupt - GPU interrupt handler
59 * @kbdev: Kbase device pointer
60 * @val: The value of the GPU IRQ status register which triggered the call
62 * This function is called from the interrupt handler when a GPU irq is to be
65 void kbase_gpu_interrupt(struct kbase_device *kbdev, u32 val);
67 #endif /* _KBASE_DEVICE_INTERNAL_H_ */