1 /* SPDX-License-Identifier: GPL-2.0-only */
7 #include <device/device.h>
11 UAO_AC_AND_BATTERY
= 1,
15 void h8_trackpoint_enable(int on
);
16 void h8_wlan_enable(int on
);
17 void h8_set_audio_mute(int on
);
18 void h8_usb_always_on_enable(enum usb_always_on on
);
19 void h8_usb_power_enable(int on
);
20 void h8_enable_event(int event
);
21 void h8_disable_event(int event
);
22 int h8_ultrabay_device_present(void);
23 u8
h8_build_id_and_function_spec_version(char *buf
, u8 buf_len
);
24 void h8_usb_always_on(void);
26 int h8_get_fn_key(void);
27 int h8_get_sense_ready(void);
29 void h8_bluetooth_enable(int on
);
30 bool h8_bluetooth_nv_enable(void);
31 bool h8_has_bdc(const struct device
*dev
);
33 void h8_wwan_enable(int on
);
34 bool h8_wwan_nv_enable(void);
35 bool h8_has_wwan(const struct device
*dev
);
37 void h8_ssdt_generator(const struct device
*dev
);
39 * boards needing specific h8-related inits could override it
41 void h8_mb_init(void);
44 #define H8_CONFIG0 0x00
45 #define H8_CONFIG0_EVENTS_ENABLE 0x02
46 #define H8_CONFIG0_HOTKEY_ENABLE 0x04
47 #define H8_CONFIG0_SMM_H8_ENABLE 0x20
48 #define H8_CONFIG0_TC_ENABLE 0x80
50 #define H8_CONFIG1 0x01
51 #define H8_CONFIG1_BKLT_LID 0x01
52 #define H8_CONFIG1_UBAY_PWR 0x20
54 #define H8_CONFIG2 0x02
55 #define H8_CONFIG2_USB_DOCK 0x01
56 #define H8_CONFIG2_DOCK_SPEAKER_MUTE 0x02
57 #define H8_CONFIG2_DOCK_SPEAKER_MUTE_POL 0x04
59 #define H8_CONFIG3 0x03
61 #define H8_SOUND_ENABLE0 0x04
62 #define H8_SOUND_ENABLE1 0x05
63 #define H8_SOUND_REG 0x06
64 #define H8_SOUND_REPEAT 0x07
66 #define H8_TRACKPOINT_CTRL 0x0B
67 #define H8_TRACKPOINT_AUTO 0x01
68 #define H8_TRACKPOINT_OFF 0x02
69 #define H8_TRACKPOINT_ON 0x03
71 #define H8_LED_CONTROL 0x0c
72 #define H8_LED_CONTROL_OFF 0x00
73 #define H8_LED_CONTROL_ON 0x80
74 #define H8_LED_CONTROL_PULSE 0xa0 /* Some models, power LED only*/
75 #define H8_LED_CONTROL_BLINK 0xc0
77 #define H8_LED_CONTROL_POWER_LED 0x00
78 #define H8_LED_CONTROL_BAT0_LED 0x01
79 #define H8_LED_CONTROL_BAT1_LED 0x02
80 #define H8_LED_CONTROL_UBAY_LED 0x04
81 #define H8_LED_CONTROL_SUSPEND_LED 0x07
82 #define H8_LED_CONTROL_DOCK_LED1 0x08
83 #define H8_LED_CONTROL_DOCK_LED2 0x09
84 #define H8_LED_CONTROL_ACDC_LED 0x0c
85 #define H8_LED_CONTROL_MUTE_LED 0x0e
87 #define H8_USB_ALWAYS_ON 0x0d
88 #define H8_USB_ALWAYS_ON_ENABLE 0x01
89 #define H8_USB_ALWAYS_ON_AC_ONLY 0x0c
91 #define H8_FAN_CONTROL 0x2f
92 #define H8_FAN_CONTROL_AUTO 0x80
94 #define H8_VOLUME_CONTROL 0x30
95 #define H8_VOLUME_CONTROL_MUTE 0x40
96 /* Embedded controller events */
97 #define H8_EVENT_FN_F1 0x10
98 #define H8_EVENT_FN_F2 0x11
99 #define H8_EVENT_FN_F3 0x12
100 #define H8_EVENT_FN_F4 0x13
101 #define H8_EVENT_FN_HOME 0x14
102 #define H8_EVENT_FN_END 0x15
103 #define H8_EVENT_FN_F7 0x16
104 #define H8_EVENT_FN_F8 0x17
105 #define H8_EVENT_FN_F9 0x18
106 #define H8_EVENT_FN_THINKVANTAGE 0x19
107 #define H8_EVENT_FN_F11 0x1a
108 #define H8_EVENT_FN_F12 0x1b
109 #define H8_EVENT_FN_1 0x1c
110 #define H8_EVENT_FN_2 0x1d
111 #define H8_EVENT_FN_PGUP 0x1f
113 #define H8_EVENT_AC_ON 0x26
114 #define H8_EVENT_AC_OFF 0x27
116 #define H8_EVENT_PWRSW_PRESS 0x28
117 #define H8_EVENT_PWRSW_RELEASE 0x29
119 #define H8_EVENT_LIDSW_CLOSE 0x2a
120 #define H8_EVENT_LIDSW_PUSH 0x2b
122 #define H8_EVENT_UBAY_UNLOCK 0x2c
123 #define H8_EVENT_UBAY_LOCK 0x2d
125 #define H8_EVENT_KEYPRESS 0x33
127 #define H8_EVENT_FN_PRESS 0x39
129 #define H8_STATUS0 0x46
130 #define H8_STATUS0_FN_KEY_DOWN 0x01
131 #define H8_STATUS1 0x47
132 #define H8_STATUS2 0x48
133 #define H8_STATUS3 0x49
135 #define H8_EVENT_BAT0 0x4a
136 #define H8_EVENT_BAT0_STATE 0x4b
138 #define H8_EVENT_BAT1 0x4c
139 #define H8_EVENT_BAT1_STATE 0x4d
141 #define H8_EVENT_FN_F5 0x64
142 #define H8_EVENT_FN_F6 0x65
144 #endif /* EC_LENOVO_H8_H */