1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
6 #include <ec/google/chromeec/ec.h>
8 static const struct soc_amd_gpio berknip_bid1_gpio_set_stage_ram
[] = {
9 /* PEN_DETECT_ODL - no used */
11 /* PEN_POWER_EN - no used */
14 PAD_GPO(GPIO_13
, LOW
), // Select Camera 1 Dmic
15 /* USB_OC4_L - USB_A1 */
16 PAD_NF(GPIO_14
, USB_OC4_L
, PULL_NONE
),
17 /* USB_OC2_L - USB A0 */
18 PAD_NF(GPIO_18
, USB_OC2_L
, PULL_NONE
),
20 PAD_GPO(GPIO_29
, HIGH
),
21 /* EN_PWR_TOUCHPAD_PS2 */
22 PAD_GPO(GPIO_67
, HIGH
),
23 /* MST_GPIO_2 (Fw Update HDMI hub) */
24 PAD_GPI(GPIO_86
, PULL_NONE
),
26 PAD_GPO(GPIO_89
, HIGH
),
27 /* MST_GPIO_3 (Fw Update HDMI hub) */
28 PAD_GPI(GPIO_90
, PULL_NONE
),
30 PAD_GPO(GPIO_140
, HIGH
),
33 static const struct soc_amd_gpio berknip_bid2_gpio_set_stage_ram
[] = {
34 /* PEN_DETECT_ODL - no used */
36 /* PEN_POWER_EN - no used */
39 PAD_GPO(GPIO_89
, HIGH
),
43 PAD_GPO(GPIO_140
, HIGH
),
46 static const struct soc_amd_gpio berknip_gpio_set_stage_ram
[] = {
47 /* PEN_DETECT_ODL - no used */
49 /* PEN_POWER_EN - no used */
53 const struct soc_amd_gpio
*variant_override_gpio_table(size_t *size
)
55 uint32_t board_version
;
58 * If board version cannot be read, assume that this is an older revision of the board
59 * and so apply overrides. If board version is provided by the EC, then apply overrides
62 if (google_chromeec_cbi_get_board_version(&board_version
) != 0)
65 if (board_version
<= 1) {
66 *size
= ARRAY_SIZE(berknip_bid1_gpio_set_stage_ram
);
67 return berknip_bid1_gpio_set_stage_ram
;
68 } else if (board_version
<= 2) {
69 *size
= ARRAY_SIZE(berknip_bid2_gpio_set_stage_ram
);
70 return berknip_bid2_gpio_set_stage_ram
;
73 *size
= ARRAY_SIZE(berknip_gpio_set_stage_ram
);
74 return berknip_gpio_set_stage_ram
;