18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: MIT */
28c2ecf20Sopenharmony_ci#ifndef __NVIF_IF0001_H__
38c2ecf20Sopenharmony_ci#define __NVIF_IF0001_H__
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_INFO                                           0x00
68c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_ATTR                                           0x01
78c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_USER                                           0x02
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cistruct nvif_control_pstate_info_v0 {
108c2ecf20Sopenharmony_ci	__u8  version;
118c2ecf20Sopenharmony_ci	__u8  count; /* out: number of power states */
128c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE                         (-1)
138c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_PERFMON                         (-2)
148c2ecf20Sopenharmony_ci	__s8  ustate_ac; /* out: target pstate index */
158c2ecf20Sopenharmony_ci	__s8  ustate_dc; /* out: target pstate index */
168c2ecf20Sopenharmony_ci	__s8  pwrsrc; /* out: current power source */
178c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN                         (-1)
188c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_PERFMON                         (-2)
198c2ecf20Sopenharmony_ci	__s8  pstate; /* out: current pstate index */
208c2ecf20Sopenharmony_ci	__u8  pad06[2];
218c2ecf20Sopenharmony_ci};
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistruct nvif_control_pstate_attr_v0 {
248c2ecf20Sopenharmony_ci	__u8  version;
258c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT                          (-1)
268c2ecf20Sopenharmony_ci	__s8  state; /*  in: index of pstate to query
278c2ecf20Sopenharmony_ci		      * out: pstate identifier
288c2ecf20Sopenharmony_ci		      */
298c2ecf20Sopenharmony_ci	__u8  index; /*  in: index of attribute to query
308c2ecf20Sopenharmony_ci		      * out: index of next attribute, or 0 if no more
318c2ecf20Sopenharmony_ci		      */
328c2ecf20Sopenharmony_ci	__u8  pad03[5];
338c2ecf20Sopenharmony_ci	__u32 min;
348c2ecf20Sopenharmony_ci	__u32 max;
358c2ecf20Sopenharmony_ci	char  name[32];
368c2ecf20Sopenharmony_ci	char  unit[16];
378c2ecf20Sopenharmony_ci};
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cistruct nvif_control_pstate_user_v0 {
408c2ecf20Sopenharmony_ci	__u8  version;
418c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_USER_V0_STATE_UNKNOWN                          (-1)
428c2ecf20Sopenharmony_ci#define NVIF_CONTROL_PSTATE_USER_V0_STATE_PERFMON                          (-2)
438c2ecf20Sopenharmony_ci	__s8  ustate; /*  in: pstate identifier */
448c2ecf20Sopenharmony_ci	__s8  pwrsrc; /*  in: target power source */
458c2ecf20Sopenharmony_ci	__u8  pad03[5];
468c2ecf20Sopenharmony_ci};
478c2ecf20Sopenharmony_ci#endif
48