Debian Codegraph @

src/soc/intel/skylake/sd.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <acpi/acpi_device.h>
4 #include <device/device.h>
5 #include <intelblocks/sd.h>
6 #include <stdint.h>
7
8 #include "chip.h"
9
10 int sd_fill_soc_gpio_info(struct acpi_gpio *gpio, const struct device *dev)
11 {
12 config_t *config = config_of(dev);
13
14 if (!config->sdcard_cd_gpio)
15 return -1;
16
17 gpio->type = ACPI_GPIO_TYPE_INTERRUPT;
18 gpio->pull = ACPI_GPIO_PULL_NONE;
19 gpio->irq.mode = ACPI_IRQ_EDGE_TRIGGERED;
20 gpio->irq.polarity = ACPI_IRQ_ACTIVE_BOTH;
21 gpio->irq.shared = ACPI_IRQ_SHARED;
22 gpio->irq.wake = ACPI_IRQ_WAKE;
23 gpio->interrupt_debounce_timeout = 10000; /* 100ms */
24 gpio->pin_count = 1;
25 gpio->pins[0] = config->sdcard_cd_gpio;
26
27 return 0;
28 }