mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
This patch uses common SCS library to setup
sd card.
BUG=none
BRANCH=none
TEST=none
Change-Id: I73f3b8d8469cfa7f77c491ff6c7bdf056929378b
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 65623b7264
Original-Change-Id: Iafbba04d7a498b9a321e8efee4abf07820d17330
Original-Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Original-Reviewed-on: https://review.coreboot.org/19632
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/539231
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright 2016 Google Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include <intelblocks/sd.h>
|
|
#include "chip.h"
|
|
|
|
int sd_fill_soc_gpio_info(struct acpi_gpio* gpio, struct device *dev)
|
|
{
|
|
config_t *config = dev->chip_info;
|
|
|
|
if (!config->sdcard_cd_gpio)
|
|
return -1;
|
|
|
|
gpio->type = ACPI_GPIO_TYPE_INTERRUPT;
|
|
gpio->pull = ACPI_GPIO_PULL_NONE;
|
|
gpio->irq.mode = ACPI_IRQ_EDGE_TRIGGERED;
|
|
gpio->irq.polarity = ACPI_IRQ_ACTIVE_BOTH;
|
|
gpio->irq.shared = ACPI_IRQ_SHARED;
|
|
gpio->irq.wake = ACPI_IRQ_WAKE;
|
|
gpio->interrupt_debounce_timeout = 10000; /* 100ms */
|
|
gpio->pin_count = 1;
|
|
gpio->pins[0] = config->sdcard_cd_gpio;
|
|
|
|
return 0;
|
|
}
|