xref: /openbmc/linux/drivers/gpu/drm/i915/intel_pcode.h (revision 74de3792)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2013-2021 Intel Corporation
4  */
5 
6 #ifndef _INTEL_PCODE_H_
7 #define _INTEL_PCODE_H_
8 
9 #include <linux/types.h>
10 
11 struct drm_i915_private;
12 
13 int snb_pcode_read(struct drm_i915_private *i915, u32 mbox, u32 *val, u32 *val1);
14 int snb_pcode_write_timeout(struct drm_i915_private *i915, u32 mbox, u32 val,
15 			    int fast_timeout_us, int slow_timeout_ms);
16 #define snb_pcode_write(i915, mbox, val)			\
17 	snb_pcode_write_timeout(i915, mbox, val, 500, 0)
18 
19 int skl_pcode_request(struct drm_i915_private *i915, u32 mbox, u32 request,
20 		      u32 reply_mask, u32 reply, int timeout_base_ms);
21 
22 int intel_pcode_init(struct drm_i915_private *i915);
23 
24 #endif /* _INTEL_PCODE_H */
25