diff options
author | Mary Ruthven <mruthven@chromium.org> | 2021-01-05 16:07:44 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-06 23:06:30 +0000 |
commit | 88b0316d684b31ef7983d2bc06f7e1b919112779 (patch) | |
tree | 7f96b27cb76505a54c0cd3c8ec530278b7cbcebd /include | |
parent | deb429c0832cb11bfe372dc87716e92c75031f0d (diff) | |
download | chrome-ec-88b0316d684b31ef7983d2bc06f7e1b919112779.tar.gz |
coil: remove ioexpander
This code uses coil terms we're removing, but we don't use it in
platform/cr50. Remove the code instead of replacing the terms.
BUG=b:175244613
TEST=make buildall -j
Change-Id: Ia5c02c4ba1f81f68a6ab03b9b380143ad8e85330
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613446
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpio.h | 28 | ||||
-rw-r--r-- | include/gpio_list.h | 65 | ||||
-rw-r--r-- | include/gpio_signal.h | 16 | ||||
-rw-r--r-- | include/ioexpander.h | 160 |
4 files changed, 0 insertions, 269 deletions
diff --git a/include/gpio.h b/include/gpio.h index e1957813e0..d6fc76cec7 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -235,25 +235,6 @@ int gpio_get_default_flags(enum gpio_signal signal); void gpio_set_level(enum gpio_signal signal, int value); /** - * Set the value of a signal and log to the console. - * - * @param channel Output channel - * @param signal Signal to set - * @param value New value for signal (0 = low, 1 = high) - */ -void gpio_set_level_verbose(enum console_channel channel, - enum gpio_signal signal, int value); - -/** - * Set the value of a signal that could be either a local GPIO or an IO - * expander GPIO. - * - * @param signal GPIO_* or IOEX_* signal to set - * @param value New value for signal (0 = low, 1 = high) - */ -void gpio_or_ioex_set_level(int signal, int value); - -/** * Reset the GPIO flags and alternate function state * * This returns the GPIO to it's default state of being a GPIO (not @@ -339,15 +320,6 @@ void gpio_set_alternate_function(uint32_t port, uint32_t mask, int gpio_power_down_module(enum module_id id); #endif -/* - * Check if signal is a valid GPIO signal, and not IO expander (enum - * ioex_signal) or eSPI virtual wire (enum espi_vw_signal). - * - * @param signal GPIO or IOEX or VW signal - * @return 1 if signal is GPIO else return 0 - */ -int signal_is_gpio(int signal); - /** * Configure a GPIO as wake source on a given condition and enable it, or * disable it. diff --git a/include/gpio_list.h b/include/gpio_list.h index 37d49a6f97..581310f646 100644 --- a/include/gpio_list.h +++ b/include/gpio_list.h @@ -63,68 +63,3 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); __attribute__((unused, section(".unused"))) = __LINE__; #include "gpio.wrap" -#include "ioexpander.h" -#define IOEX_EXPIN(ioex, port, index) (ioex), (port), BIT(index) - -/* - * Define the IO expander IO in gpio.inc by the format: - * IOEX(name, EXPIN(ioex_port, port, offset), flags) - * - name: the name of this IO pin - * - EXPIN(ioex, port, offset) - * - ioex: the IO expander port (defined in board.c) this IO - * pin belongs to. - * - port: the port number in the IO expander chip. - * - offset: the bit offset in the port above. - * - flags: the same as the flags of GPIO. - * - */ -#define IOEX(name, expin, flags) {#name, IOEX_##expin, flags}, -/* - * Define the IO expander IO which supports interrupt in gpio.inc by - * the format: - * IOEX_INT(name, EXPIN(ioex_port, port, offset), flags, handler) - * - name: the name of this IO pin - * - EXPIN(ioex, port, offset) - * - ioex: the IO expander port (defined in board.c) this IO - * pin belongs to. - * - port: the port number in the IO expander chip. - * - offset: the bit offset in the port above. - * - flags: the same as the flags of GPIO. - * - handler: the IOEX IO's interrupt handler. - */ -#define IOEX_INT(name, expin, flags, handler) IOEX(name, expin, flags) - -/* IO expander signal list. */ -const struct ioex_info ioex_list[] = { - #include "gpio.wrap" -}; -BUILD_ASSERT(ARRAY_SIZE(ioex_list) == IOEX_COUNT); - -/* IO Expander Interrupt Handlers */ -#define IOEX_INT(name, expin, flags, handler) handler, -void (* const ioex_irq_handlers[])(enum ioex_signal signal) = { - #include "gpio.wrap" -}; -const int ioex_ih_count = ARRAY_SIZE(ioex_irq_handlers); -/* - * All IOEX IOs with interrupt handlers must be declared at the top of the - * IOEX's declaration in the gpio.inc - * file. - */ -#define IOEX_INT(name, expin, flags, handler) \ - BUILD_ASSERT(IOEX_##name < ARRAY_SIZE(ioex_irq_handlers)); -#include "gpio.wrap" - -#define IOEX(name, expin, flags) expin -#define IOEX_INT(name, expin, flags, handler) expin - -/* The compiler will complain if we use the same name twice or the controller - * number declared is greater or equal to CONFIG_IO_EXPANDER_PORT_COUNT. - * The linker ignores anything that gets by. - */ -#define EXPIN(a, b, c...) \ - static const int _expin_ ## a ## _ ## b ## _ ## c \ - __attribute__((unused, section(".unused"))) = __LINE__; \ - BUILD_ASSERT(a < CONFIG_IO_EXPANDER_PORT_COUNT); - -#include "gpio.wrap" diff --git a/include/gpio_signal.h b/include/gpio_signal.h index 478e83dca5..5d629640c9 100644 --- a/include/gpio_signal.h +++ b/include/gpio_signal.h @@ -30,20 +30,4 @@ enum gpio_signal { }; BUILD_ASSERT(GPIO_COUNT < GPIO_LIMIT); -#define IOEX(name, expin, flags) IOEX_##name, -#define IOEX_INT(name, expin, flags, signal) IOEX_##name, - -enum ioex_signal { - /* The first valid IOEX signal is 0x1000 */ - IOEX_SIGNAL_START = GPIO_LIMIT + 1, - /* Used to ensure that the first IOEX signal is same as start */ - __IOEX_PLACEHOLDER = GPIO_LIMIT, - #include "gpio.wrap" - IOEX_SIGNAL_END, - IOEX_LIMIT = 0x1FFF -}; -BUILD_ASSERT(IOEX_SIGNAL_END < IOEX_LIMIT); - -#define IOEX_COUNT (IOEX_SIGNAL_END - IOEX_SIGNAL_START) - #endif /* __CROS_EC_GPIO_SIGNAL_H */ diff --git a/include/ioexpander.h b/include/ioexpander.h deleted file mode 100644 index 206b0a390c..0000000000 --- a/include/ioexpander.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2019 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef __CROS_EC_IOEXPANDER_H -#define __CROS_EC_IOEXPANDER_H - -/* IO expander signal definition structure */ -struct ioex_info { - /* Signal name */ - const char *name; - - /* IO expander port number */ - uint16_t ioex; - - /* IO port number in IO expander */ - uint16_t port; - - /* Bitmask on that port (1 << N) */ - uint32_t mask; - - /* Flags - the same as the GPIO flags */ - uint32_t flags; -}; - -/* Signal information from board.c. Must match order from enum ioex_signal. */ -extern const struct ioex_info ioex_list[]; -extern void (* const ioex_irq_handlers[])(enum ioex_signal signal); -extern const int ioex_ih_count; - -struct ioexpander_drv { - /* Initialize IO expander chip/driver */ - int (*init)(int ioex); - /* Get the current level of the IOEX pin */ - int (*get_level)(int ioex, int port, int mask, int *val); - /* Set the level of the IOEX pin */ - int (*set_level)(int ioex, int port, int mask, int val); - /* Get flags for the IOEX pin */ - int (*get_flags_by_mask)(int ioex, int port, int mask, int *flags); - /* Set flags for the IOEX pin */ - int (*set_flags_by_mask)(int ioex, int port, int mask, int flags); - /* Enable/disable interrupt for the IOEX pin */ - int (*enable_interrupt)(int ioex, int port, int mask, int enable); -}; - -struct ioexpander_config_t { - /* Physical I2C port connects to the IO expander chip. */ - int i2c_host_port; - /* I2C slave address */ - int i2c_slave_addr; - /* - * Pointer to the specific IO expander chip's ops defined in - * the struct ioexpander_drv. - */ - const struct ioexpander_drv *drv; -}; - -extern struct ioexpander_config_t ioex_config[]; - -/* - * Enable the interrupt for the IOEX signal - * - * @param signal IOEX signal to enable the interrupt - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_enable_interrupt(enum ioex_signal signal); - -/* - * Disable the interrupt for the IOEX signal - * - * @param signal IOEX signal to disable the interrupt - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_disable_interrupt(enum ioex_signal signal); - -/* - * Get flags for the IOEX pin by mask - * - * @param ioex IO expander chip's port number - * @param port IO port in the IO expander chip - * @param mask Bitmask of the pin on the port above - * @param flags Pointer to the keep the flags read - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_get_flags_by_mask(int ioex, int port, int mask, int *flags); - -/* - * Set flags for the IOEX pin by mask - * - * @param ioex IO expander chip's port number - * @param port IO port in the IO expander chip - * @param mask Bitmask of the pin on the port above - * @param flags flags to set - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_set_flags_by_mask(int ioex, int port, int mask, int flags); - -/* - * Get flags for the IOEX signal - * - * @param signal IOEX signal to get flags for - * @param flags Pointer to the keep the flags read - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_get_flags(enum ioex_signal signal, int *flags); - -/* - * Set flags for the IOEX signal - * - * @param signal IOEX signal to set flags for - * @param flags New flags for the IOEX signal - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_set_flags(enum ioex_signal signal, int flags); - -/* - * Get the current level of the IOEX signal - * - * @param signal IOEX signal to get the level - * @param val Pointer to the keep the level read - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_get_level(enum ioex_signal signal, int *val); - -/* - * Set the level of the IOEX signal - * - * @param signal IOEX signal to set the level - * @param value New level for the IOEX signal - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_set_level(enum ioex_signal signal, int value); - -/* - * Initialize IO expander chip/driver - * - * @param ioex IO expander chip's port number - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_init(int ioex); - -/* - * Get the name for the IOEX signal - * - * @param signal IOEX signal to get the name - * @returns name of the given IOEX signal - */ -const char *ioex_get_name(enum ioex_signal signal); - -/* - * Check if signal is an IO expander signal or GPIO signal. - * - * @param signal GPIO or IOEX signal - * @return 1 if signal is IOEX else return 0 - */ -int signal_is_ioex(int signal); - -#endif /* __CROS_EC_IOEXPANDER_H */ |