mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-01 15:14:52 +00:00

In preparation for dropping the dependency on struct intel_uncore from display code, add a struct drm_device based interface to pcode. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/e4ee176ca5454cfc636cbe71feb9f55d9e91f4ea.1750678991.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
40 lines
1.3 KiB
C
40 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2013-2021 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_PCODE_H_
|
|
#define _INTEL_PCODE_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct drm_device;
|
|
struct intel_uncore;
|
|
|
|
int snb_pcode_read(struct intel_uncore *uncore, u32 mbox, u32 *val, u32 *val1);
|
|
int snb_pcode_write_timeout(struct intel_uncore *uncore, u32 mbox, u32 val, int timeout_ms);
|
|
#define snb_pcode_write(uncore, mbox, val) \
|
|
snb_pcode_write_timeout((uncore), (mbox), (val), 1)
|
|
|
|
int skl_pcode_request(struct intel_uncore *uncore, u32 mbox, u32 request,
|
|
u32 reply_mask, u32 reply, int timeout_base_ms);
|
|
|
|
int intel_pcode_init(struct intel_uncore *uncore);
|
|
|
|
/*
|
|
* Helpers for dGfx PCODE mailbox command formatting
|
|
*/
|
|
int snb_pcode_read_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u32 *val);
|
|
int snb_pcode_write_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u32 val);
|
|
|
|
/* Helpers with drm device */
|
|
int intel_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1);
|
|
int intel_pcode_write_timeout(struct drm_device *drm, u32 mbox, u32 val, int timeout_ms);
|
|
#define intel_pcode_write(drm, mbox, val) \
|
|
intel_pcode_write_timeout((drm), (mbox), (val), 1)
|
|
|
|
int intel_pcode_request(struct drm_device *drm, u32 mbox, u32 request,
|
|
u32 reply_mask, u32 reply, int timeout_base_ms);
|
|
|
|
#endif /* _INTEL_PCODE_H */
|