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-or-later */
2
3
#include <baseboard/gpio.h>
4
#include <baseboard/variants.h>
5
#include <
bootstate.h
>
6
#include <
fw_config.h
>
7
#include <
commonlib/helpers.h
>
8
9
/* Pad configuration of stylus */
10
static
const
struct
pad_config
stylus_det_pads
[] = {
11
/* C12 : AP_PEN_DET_ODL (external pull-high) */
12
PAD_CFG_GPI_GPIO_DRIVER
(
GPP_C12
,
NONE
, DEEP),
13
};
14
15
static
void
fw_config_handle
(
void
*
unused
)
16
{
17
if
(
fw_config_probe
(
FW_CONFIG
(STYLUS, STYLUS_PRESENT)))
18
gpio_configure_pads
(
stylus_det_pads
,
ARRAY_SIZE
(
stylus_det_pads
));
19
}
20
BOOT_STATE_INIT_ENTRY
(
BS_DEV_ENABLE
,
BS_ON_ENTRY
,
fw_config_handle
,
NULL
);
GPP_C12
#define GPP_C12
Definition:
gpio_soc_defs.h:549
bootstate.h
BS_DEV_ENABLE
@ BS_DEV_ENABLE
Definition:
bootstate.h:82
BS_ON_ENTRY
@ BS_ON_ENTRY
Definition:
bootstate.h:95
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
fw_config.h
FW_CONFIG
#define FW_CONFIG(__field, __option)
Definition:
fw_config.h:28
helpers.h
fw_config_probe
bool fw_config_probe(const struct fw_config *match)
Definition:
fw_config.c:62
BOOT_STATE_INIT_ENTRY
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL)
stylus_det_pads
static const struct pad_config stylus_det_pads[]
Definition:
gpio.c:10
fw_config_handle
static void fw_config_handle(void *unused)
Definition:
gpio.c:15
NONE
@ NONE
Definition:
qup_se_handlers_common.h:196
gpio_configure_pads
void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
program a particular set of GPIO
Definition:
gpio.c:307
PAD_CFG_GPI_GPIO_DRIVER
#define PAD_CFG_GPI_GPIO_DRIVER(pad, pull, rst)
Definition:
gpio_defs.h:323
NULL
#define NULL
Definition:
stddef.h:19
pad_config
Definition:
gpio.h:75
pad_config::unused
uint16_t unused
Definition:
padconfig.h:13
src
mainboard
google
dedede
variants
magolor
gpio.c
Generated by
1.9.1