1  /* SPDX-License-Identifier: GPL-2.0-only */
2  /*
3   * Copyright (c) 2020, NVIDIA CORPORATION.  All rights reserved.
4   */
5  
6  #ifndef __PLATFORM_DATA_X86_NVIDIA_WMI_EC_BACKLIGHT_H
7  #define __PLATFORM_DATA_X86_NVIDIA_WMI_EC_BACKLIGHT_H
8  
9  #define WMI_BRIGHTNESS_GUID "603E9613-EF25-4338-A3D0-C46177516DB7"
10  
11  /**
12   * enum wmi_brightness_method - WMI method IDs
13   * @WMI_BRIGHTNESS_METHOD_LEVEL:  Get/Set EC brightness level status
14   * @WMI_BRIGHTNESS_METHOD_SOURCE: Get/Set EC Brightness Source
15   */
16  enum wmi_brightness_method {
17  	WMI_BRIGHTNESS_METHOD_LEVEL = 1,
18  	WMI_BRIGHTNESS_METHOD_SOURCE = 2,
19  	WMI_BRIGHTNESS_METHOD_MAX
20  };
21  
22  /**
23   * enum wmi_brightness_mode - Operation mode for WMI-wrapped method
24   * @WMI_BRIGHTNESS_MODE_GET:            Get the current brightness level/source.
25   * @WMI_BRIGHTNESS_MODE_SET:            Set the brightness level.
26   * @WMI_BRIGHTNESS_MODE_GET_MAX_LEVEL:  Get the maximum brightness level. This
27   *                                      is only valid when the WMI method is
28   *                                      %WMI_BRIGHTNESS_METHOD_LEVEL.
29   */
30  enum wmi_brightness_mode {
31  	WMI_BRIGHTNESS_MODE_GET = 0,
32  	WMI_BRIGHTNESS_MODE_SET = 1,
33  	WMI_BRIGHTNESS_MODE_GET_MAX_LEVEL = 2,
34  	WMI_BRIGHTNESS_MODE_MAX
35  };
36  
37  /**
38   * enum wmi_brightness_source - Backlight brightness control source selection
39   * @WMI_BRIGHTNESS_SOURCE_GPU: Backlight brightness is controlled by the GPU.
40   * @WMI_BRIGHTNESS_SOURCE_EC:  Backlight brightness is controlled by the
41   *                             system's Embedded Controller (EC).
42   * @WMI_BRIGHTNESS_SOURCE_AUX: Backlight brightness is controlled over the
43   *                             DisplayPort AUX channel.
44   */
45  enum wmi_brightness_source {
46  	WMI_BRIGHTNESS_SOURCE_GPU = 1,
47  	WMI_BRIGHTNESS_SOURCE_EC = 2,
48  	WMI_BRIGHTNESS_SOURCE_AUX = 3,
49  	WMI_BRIGHTNESS_SOURCE_MAX
50  };
51  
52  /**
53   * struct wmi_brightness_args - arguments for the WMI-wrapped ACPI method
54   * @mode:    Pass in an &enum wmi_brightness_mode value to select between
55   *           getting or setting a value.
56   * @val:     In parameter for value to set when using %WMI_BRIGHTNESS_MODE_SET
57   *           mode. Not used in conjunction with %WMI_BRIGHTNESS_MODE_GET or
58   *           %WMI_BRIGHTNESS_MODE_GET_MAX_LEVEL mode.
59   * @ret:     Out parameter returning retrieved value when operating in
60   *           %WMI_BRIGHTNESS_MODE_GET or %WMI_BRIGHTNESS_MODE_GET_MAX_LEVEL
61   *           mode. Not used in %WMI_BRIGHTNESS_MODE_SET mode.
62   * @ignored: Padding; not used. The ACPI method expects a 24 byte params struct.
63   *
64   * This is the parameters structure for the WmiBrightnessNotify ACPI method as
65   * wrapped by WMI. The value passed in to @val or returned by @ret will be a
66   * brightness value when the WMI method ID is %WMI_BRIGHTNESS_METHOD_LEVEL, or
67   * an &enum wmi_brightness_source value with %WMI_BRIGHTNESS_METHOD_SOURCE.
68   */
69  struct wmi_brightness_args {
70  	u32 mode;
71  	u32 val;
72  	u32 ret;
73  	u32 ignored[3];
74  };
75  
76  #endif
77