aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/generic
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-07-01 01:26:22 -0700
committerFurquan Shaikh <furquan@google.com>2020-07-02 19:12:32 +0000
commit8c88ceca578d117ec7981d61b89580570e2dbab9 (patch)
tree5e070c6713d93874622b2f298ef78ce05213c2d2 /src/drivers/generic
parent8cdb0b3767ad46586d75ceccc8696e4641f2b38e (diff)
drivers/generic/gpio_regulator: Drop unused driver for gpio_regulator
Proposal for gpio_regulator usage in ACPI never got accepted upstream for Linux kernel. So, the gpio_regulator driver in coreboot remains unused. This change drops this unused driver. Change-Id: Ia1e0ae4f955b9ffc8346d957f755499419d8cbc7 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42966 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/generic')
-rw-r--r--src/drivers/generic/gpio_regulator/Kconfig5
-rw-r--r--src/drivers/generic/gpio_regulator/Makefile.inc3
-rw-r--r--src/drivers/generic/gpio_regulator/chip.h14
-rw-r--r--src/drivers/generic/gpio_regulator/gpio_regulator.c75
4 files changed, 0 insertions, 97 deletions
diff --git a/src/drivers/generic/gpio_regulator/Kconfig b/src/drivers/generic/gpio_regulator/Kconfig
deleted file mode 100644
index c4c83e40bc..0000000000
--- a/src/drivers/generic/gpio_regulator/Kconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-config DRIVERS_GENERIC_GPIO_REGULATOR
- bool
- depends on HAVE_ACPI_TABLES
diff --git a/src/drivers/generic/gpio_regulator/Makefile.inc b/src/drivers/generic/gpio_regulator/Makefile.inc
deleted file mode 100644
index 232e65e347..0000000000
--- a/src/drivers/generic/gpio_regulator/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-
-ramstage-$(CONFIG_DRIVERS_GENERIC_GPIO_REGULATOR) += gpio_regulator.c
diff --git a/src/drivers/generic/gpio_regulator/chip.h b/src/drivers/generic/gpio_regulator/chip.h
deleted file mode 100644
index 4d9e3ceb35..0000000000
--- a/src/drivers/generic/gpio_regulator/chip.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __DRIVERS_GENERIC_GPIO_REGULATOR_H__
-#define __DRIVERS_GENERIC_GPIO_REGULATOR_H__
-
-#include <acpi/acpi_device.h>
-
-struct drivers_generic_gpio_regulator_config {
- const char *name;
- struct acpi_gpio gpio;
- bool enabled_on_boot;
-};
-
-#endif /* __DRIVERS_GENERIC_GPIO_REGULATOR_H__ */
diff --git a/src/drivers/generic/gpio_regulator/gpio_regulator.c b/src/drivers/generic/gpio_regulator/gpio_regulator.c
deleted file mode 100644
index be71b9de0e..0000000000
--- a/src/drivers/generic/gpio_regulator/gpio_regulator.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <acpi/acpi_device.h>
-#include <acpi/acpigen.h>
-#include <device/device.h>
-#include <device/path.h>
-#include <string.h>
-
-#include "chip.h"
-
-static void gpio_regulator_fill_ssdt_generator(const struct device *dev)
-{
- struct drivers_generic_gpio_regulator_config *config = dev->chip_info;
- const char *scope = acpi_device_scope(dev);
- const char *path = acpi_device_path(dev);
- struct acpi_dp *dsd;
-
- if (!dev->enabled || !scope || !path || !config->gpio.pin_count)
- return;
-
- /* Device */
- acpigen_write_scope(scope);
- acpigen_write_device(acpi_device_name(dev));
-
- /* _HID is set to PRP0001 */
- acpigen_write_name_string("_HID", ACPI_DT_NAMESPACE_HID);
-
- /* Resources - _CRS */
- acpigen_write_name("_CRS");
- acpigen_write_resourcetemplate_header();
- acpi_device_write_gpio(&config->gpio);
- acpigen_write_resourcetemplate_footer();
-
- /* DSD */
- dsd = acpi_dp_new_table("_DSD");
- acpi_dp_add_string(dsd, "compatible", "regulator-fixed");
- acpi_dp_add_string(dsd, "regulator-name", config->name);
- acpi_dp_add_gpio(dsd, "gpio-gpios", path, 0, 0, config->gpio.polarity);
- if (config->enabled_on_boot)
- acpi_dp_add_string(dsd, "regulator-boot-on", "on");
- if (config->gpio.polarity == ACPI_GPIO_ACTIVE_HIGH)
- acpi_dp_add_string(dsd, "enable-active-high", "on");
- acpi_dp_write(dsd);
-
- acpigen_pop_len(); /* Device */
- acpigen_pop_len(); /* Scope */
-}
-
-static const char *gpio_regulator_acpi_name(const struct device *dev)
-{
- struct drivers_generic_gpio_regulator_config *config = dev->chip_info;
- static char name[5];
-
- snprintf(name, sizeof(name), "R%03.3X", config->gpio.pins[0]);
- name[4] = '\0';
-
- return name;
-}
-
-static struct device_operations gpio_regulator_ops = {
- .read_resources = noop_read_resources,
- .set_resources = noop_set_resources,
- .acpi_name = gpio_regulator_acpi_name,
- .acpi_fill_ssdt = gpio_regulator_fill_ssdt_generator,
-};
-
-static void gpio_regulator_enable(struct device *dev)
-{
- dev->ops = &gpio_regulator_ops;
-}
-
-struct chip_operations drivers_generic_gpio_regulator_ops = {
- CHIP_NAME("GPIO Regulator")
- .enable_dev = gpio_regulator_enable
-};