|
iPXE
|
General purpose I/O. More...
Go to the source code of this file.
Data Structures | |
| struct | gpio |
| A GPIO pin. More... | |
| struct | gpios |
| A GPIO controller. More... | |
| struct | gpio_operations |
| GPIO operations. More... | |
Macros | |
| #define | GPIO_CFG_ACTIVE_LOW 0x01 |
| GPIO is active low. More... | |
| #define | GPIO_CFG_OUTPUT 0x0100 |
| GPIO is an output. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static struct gpios * | gpios_get (struct gpios *gpios) |
| Get reference to GPIO controller. More... | |
| static void | gpios_put (struct gpios *gpios) |
| Drop reference to GPIO controller. More... | |
| static struct gpio * | gpio_get (struct gpio *gpio) |
| Get reference to GPIO pin. More... | |
| static void | gpio_put (struct gpio *gpio) |
| Drop reference to GPIO ping. More... | |
| static void | gpios_init (struct gpios *gpios, struct gpio_operations *op) |
| Initialise a GPIO controller. More... | |
| static void | gpios_nullify (struct gpios *gpios) |
| Stop using a GPIO controller. More... | |
| static int | gpio_in (struct gpio *gpio) |
| Get current GPIO input value. More... | |
| static void | gpio_out (struct gpio *gpio, int active) |
| Set current GPIO output value. More... | |
| static int | gpio_config (struct gpio *gpio, unsigned int config) |
| Configure GPIO pin. More... | |
| struct gpios * | alloc_gpios (unsigned int count, size_t priv_len) |
| Allocate GPIO controller. More... | |
| int | gpios_register (struct gpios *gpios) |
| Register GPIO controller. More... | |
| void | gpios_unregister (struct gpios *gpios) |
| Unregister GPIO controller. More... | |
| struct gpios * | gpios_find (unsigned int bus_type, unsigned int location) |
| Find GPIO controller. More... | |
Variables | |
| struct gpio_operations | null_gpio_operations |
| Null GPIO operations. More... | |
General purpose I/O.
Definition in file gpio.h.
| #define GPIO_CFG_ACTIVE_LOW 0x01 |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Get reference to GPIO controller.
| gpios | GPIO controller |
| gpios | GPIO controller |
Definition at line 95 of file gpio.h.
References ref_get, and gpios::refcnt.
Referenced by gpio_get(), and gpios_register().
|
inlinestatic |
Drop reference to GPIO controller.
| gpios | GPIO controller |
Definition at line 106 of file gpio.h.
References ref_put, and gpios::refcnt.
Referenced by dwgpio_probe(), dwgpio_remove(), gpio_put(), and gpios_unregister().
Get reference to GPIO pin.
| gpio | GPIO pin |
| gpio | GPIO pin |
Definition at line 117 of file gpio.h.
References gpio, gpio::gpios, and gpios_get().
|
inlinestatic |
Drop reference to GPIO ping.
| gpio | GPIO pin |
Definition at line 128 of file gpio.h.
References gpio::gpios, and gpios_put().
|
inlinestatic |
Initialise a GPIO controller.
| gpios | GPIO controller |
| op | GPIO operations |
Definition at line 139 of file gpio.h.
Referenced by dwgpio_probe().
|
inlinestatic |
Stop using a GPIO controller.
| gpios | GPIO controller |
Drivers should call this method immediately before the final call to gpios_put().
Definition at line 152 of file gpio.h.
References null_gpio_operations, and gpios::op.
Referenced by dwgpio_probe(), and dwgpio_remove().
|
inlinestatic |
Get current GPIO input value.
| gpio | GPIO pin |
| active | Pin is in the active state |
Definition at line 162 of file gpio.h.
References gpio::gpios, gpio_operations::in, and gpios::op.
|
inlinestatic |
Set current GPIO output value.
| gpio | GPIO pin |
| active | Set pin to active state |
Definition at line 174 of file gpio.h.
References gpio::gpios, gpios::op, and gpio_operations::out.
|
inlinestatic |
Configure GPIO pin.
| gpio | GPIO pin |
| config | Configuration |
| rc | Return status code |
Definition at line 187 of file gpio.h.
References gpio_operations::config, gpio::gpios, and gpios::op.
Allocate GPIO controller.
| count | Number of GPIO pins |
| priv_len | Size of driver-private data |
| gpios | GPIO controller, or NULL |
Definition at line 46 of file gpio.c.
References gpios::count, count, gpio, gpios::gpio, gpio::gpios, gpio::index, len, NULL, gpios::priv, and zalloc().
Referenced by dwgpio_probe().
| int gpios_register | ( | struct gpios * | gpios | ) |
Register GPIO controller.
| gpios | GPIO controller |
| rc | Return status code |
Definition at line 78 of file gpio.c.
References gpios::count, DBGC, gpios::dev, gpios_get(), gpios::list, list_add_tail, and device::name.
Referenced by dwgpio_probe().
| void gpios_unregister | ( | struct gpios * | gpios | ) |
Unregister GPIO controller.
| gpios | GPIO controller |
Definition at line 94 of file gpio.c.
References DBGC, gpios::dev, gpios_put(), gpios::list, list_del, and device::name.
Referenced by dwgpio_probe(), and dwgpio_remove().
| struct gpios* gpios_find | ( | unsigned int | bus_type, |
| unsigned int | location | ||
| ) |
Find GPIO controller.
| bus_type | Bus type |
| location | Bus location |
| gpios | GPIO controller, or NULL |
Definition at line 109 of file gpio.c.
References device_description::bus_type, device::desc, gpios::dev, gpios::list, list_for_each_entry, device_description::location, and NULL.
| struct gpio_operations null_gpio_operations |
1.8.15