coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <gpio.h>
6 #include <soc/gpio.h>
8 
9 static const struct pad_config default_override_table[] = {
10  PAD_NC(GPIO_52, UP_20K),
11  PAD_NC(GPIO_53, UP_20K),
12  PAD_NC(GPIO_67, UP_20K),
13  PAD_NC(GPIO_117, UP_20K),
14  PAD_NC(GPIO_143, UP_20K),
15 
16  /* EN_PP3300_TOUCHSCREEN */
17  PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
18  DISPUPD),
19 
20  PAD_NC(GPIO_161, DN_20K),
21 
22  PAD_NC(GPIO_213, DN_20K),
23  PAD_NC(GPIO_214, DN_20K),
24 };
25 
26 static const struct pad_config non_touchscreen_override_table[] = {
27  /* disable I2C7 SCL and SDA */
28  PAD_NC(GPIO_114, UP_20K), /* LPSS_I2C7_SDA */
29  PAD_NC(GPIO_115, UP_20K), /* LPSS_I2C7_SCL */
30 
31  PAD_NC(GPIO_52, UP_20K),
32  PAD_NC(GPIO_53, UP_20K),
33  PAD_NC(GPIO_67, UP_20K),
34  PAD_NC(GPIO_117, UP_20K),
35  PAD_NC(GPIO_143, UP_20K),
36 
37  /* EN_PP3300_TOUCHSCREEN */
38  PAD_NC(GPIO_146, UP_20K),
39 
40  PAD_NC(GPIO_161, DN_20K),
41 
42  PAD_NC(GPIO_213, DN_20K),
43  PAD_NC(GPIO_214, DN_20K),
44 };
45 
47 {
48  if (sku_id != 9)
49  return true;
50  else
51  return false;
52 }
53 
54 const struct pad_config *variant_override_gpio_table(size_t *num)
55 {
56  const struct pad_config *c;
58 
63  } else {
66  }
67 
68  return c;
69 }
uint32_t sku_id(void)
#define ARRAY_SIZE(a)
Definition: helpers.h:12
uint32_t google_chromeec_get_board_sku(void)
Definition: ec_skuid.c:6
#define GPIO_214
Definition: gpio_apl.h:172
#define GPIO_161
Definition: gpio_apl.h:282
#define GPIO_213
Definition: gpio_apl.h:171
#define GPIO_53
Definition: gpio_glk.h:67
#define GPIO_52
Definition: gpio_glk.h:66
const struct pad_config *__weak variant_override_gpio_table(size_t *num)
Definition: gpio.c:450
bool no_touchscreen_sku(uint32_t sku_id)
Definition: gpio.c:46
static const struct pad_config non_touchscreen_override_table[]
Definition: gpio.c:26
static const struct pad_config default_override_table[]
Definition: gpio.c:9
#define GPIO_143
Definition: gpio.h:90
#define GPIO_67
Definition: gpio.h:53
#define GPIO_115
Definition: gpio.h:77
#define GPIO_146
Definition: gpio.h:93
#define GPIO_114
Definition: gpio.h:76
#define PAD_NC(pin)
Definition: gpio_defs.h:263
#define GPIO_117
Definition: gpio.h:84
#define PAD_CFG_GPO_IOSSTATE_IOSTERM(pad, val, rst, pull, iosstate, ioterm)
Definition: gpio_defs.h:277
unsigned int uint32_t
Definition: stdint.h:14
#define c(value, pmcreg, dst_bits)