xref: /openbmc/linux/drivers/gpu/drm/i915/intel_pcode.h (revision 2427f03f)
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 sandybridge_pcode_read(struct drm_i915_private *i915, u32 mbox,
14 			   u32 *val, u32 *val1);
15 int sandybridge_pcode_write_timeout(struct drm_i915_private *i915, u32 mbox,
16 				    u32 val, int fast_timeout_us,
17 				    int slow_timeout_ms);
18 #define sandybridge_pcode_write(i915, mbox, val)	\
19 	sandybridge_pcode_write_timeout(i915, mbox, val, 500, 0)
20 
21 int skl_pcode_request(struct drm_i915_private *i915, u32 mbox, u32 request,
22 		      u32 reply_mask, u32 reply, int timeout_base_ms);
23 
24 int intel_pcode_init(struct drm_i915_private *i915);
25 
26 #endif /* _INTEL_PCODE_H */
27