coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sd.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
intelblocks/sd.h
>
4
#include <soc/soc_chip.h>
5
6
int
sd_fill_soc_gpio_info
(
struct
acpi_gpio
*
gpio
,
const
struct
device
*dev)
7
{
8
config_t
*
config
=
config_of
(dev);
9
10
if
(!
config
->sdcard_cd_gpio)
11
return
-1;
12
13
gpio
->type =
ACPI_GPIO_TYPE_INTERRUPT
;
14
gpio
->
pull
=
ACPI_GPIO_PULL_NONE
;
15
gpio
->irq.mode =
ACPI_IRQ_EDGE_TRIGGERED
;
16
gpio
->irq.polarity =
ACPI_IRQ_ACTIVE_BOTH
;
17
gpio
->irq.shared =
ACPI_IRQ_SHARED
;
18
gpio
->irq.wake =
ACPI_IRQ_WAKE
;
19
gpio
->interrupt_debounce_timeout = 10000;
/* 100ms */
20
gpio
->pin_count = 1;
21
gpio
->pins[0] =
config
->sdcard_cd_gpio;
22
23
return
0;
24
}
ACPI_IRQ_SHARED
@ ACPI_IRQ_SHARED
Definition:
acpi_device.h:80
ACPI_IRQ_ACTIVE_BOTH
@ ACPI_IRQ_ACTIVE_BOTH
Definition:
acpi_device.h:75
ACPI_GPIO_PULL_NONE
@ ACPI_GPIO_PULL_NONE
Definition:
acpi_device.h:151
ACPI_IRQ_WAKE
@ ACPI_IRQ_WAKE
Definition:
acpi_device.h:85
ACPI_GPIO_TYPE_INTERRUPT
@ ACPI_GPIO_TYPE_INTERRUPT
Definition:
acpi_device.h:143
ACPI_IRQ_EDGE_TRIGGERED
@ ACPI_IRQ_EDGE_TRIGGERED
Definition:
acpi_device.h:68
sd.h
config_of
static DEVTREE_CONST void * config_of(const struct device *dev)
Definition:
device.h:382
config
enum board_config config
Definition:
memory.c:448
sd_fill_soc_gpio_info
int sd_fill_soc_gpio_info(struct acpi_gpio *gpio, const struct device *dev)
Definition:
sd.c:6
acpi_gpio
Definition:
acpi_device.h:164
device
Definition:
device.h:107
ec_kontron_it8516e_config
Definition:
chip.h:8
gpio
Definition:
pinmux.c:36
gpio::pull
unsigned int pull
Definition:
pinmux.c:39
src
soc
intel
jasperlake
sd.c
Generated by
1.9.1