History log of /fuchsia/zircon/system/dev/gpio/gpio-test/gpio-test.c
Revision Date Author Comments
# 6c2ccb39 19-Sep-2018 Mike Voydanoff <voydanoff@google.com>

[gpio] Refactor the GPIO protocol

This is a first step in a move toward using protocols to represent
individual resources. A similar change will be made to the I2C protocol
to bring it in line with how I2C is used on x86 platforms.

From the client's point of view, an instance of the ZX_PROTOCOL_GPIO
protocol now represents a single pin. The protocol remains the same,
except the "uint32_t index" has been removed from all the protocol functions.

For devices that have only one GPIO resource assigned to them, the driver
can simply call device_get_protocol() to access the GPIO protocol for the pin.
To for devices with more than one GPIO pins, a new API in the platform bus called
pdev_get_protocol() must be used instead.

In addition, we add a new protocol ZX_PROTOCOL_GPIO_IMPL, which is now
implemented by the GPIO drivers. This protocol is essentially the same as
the old GPIO protocol, except "index" has been renamed "pin".
Board drivers may use this protocol directly when doing low level system
configuration, specifying pin numbers directly.

TEST: Booted on VIM2 and Hikey.
On VIM2, USB, display, ethernet and the GPIO test driver are working properly
On Hikey, the system boots and USB is functional.

Change-Id: I44f1bc11ad9793543361a2d19d7a2de4458c334b


# 2d20e548 04-Sep-2018 Mike Voydanoff <voydanoff@google.com>

[ddk][gpio] Break gpio_config() API into two functions

gpio_config_in() is used to configure a pin for input, while
gpio_config_out() is used to configure a pin for output.
gpio_config_out() now takes an initial value for the pin,
so the configuration and value can be set atomically to avoid a
race condition or glitch between setting it as output and writing the value.

Also removed some unnecessary GPIO configuration flags.
Now we only have flags for configuring the pull-up in gpio_config_in().
gpio_get_interrupt() uses interrupt handle flags for configuring edge vs level triggered,
so we don't need GPIO_* flags for these.

TEST: manual testing on VIM2, astro and gauss

ZX-2564 #in progress
ZX-2465 #in progress

Change-Id: I280c489ba951ca5953c0a2d57135c3482dd96c37


# 07370a21 30-May-2018 Brijen Raval <braval@google.com>

[gpio][test] Toggle only output pins

Change-Id: Id0734ca812dc59521161219082c3afab56f2de48


# fbc064a4 26-Apr-2018 Brijen Raval <braval@google.com>

[imx8m][gpio][interrupts] Add GPIO IRQ support for NXP

Change-Id: I2bc59f60092670d0daadcf88548ce8982744054b


# 937a9826 30-Apr-2018 Brijen Raval <braval@google.com>

[interrupts][syscall] Rename syscalls zx_irq_* to zx_interrupt_*

Change-Id: Ie01f65f29c1fd6171463340e2a5c103ff8e704b6


# cca25b86 26-Apr-2018 Brijen Raval <braval@google.com>

[syscall][irq] Remove (disabled) old irq syscall implementations

Change-Id: I2f4a4f42e174dbab5ac4eb84255955fa805cd75d


# 3b7433be 17-Apr-2018 Brijen Raval <braval@google.com>

[gpio][interrupts] Add GPIO Interrupt Support

Change-Id: Ib9890ed4170fbb84c4c0bb657d716fb3ae983516


# 89474d5e 27-Feb-2018 Mike Voydanoff <voydanoff@google.com>

[dev][gpio-test] Replace board specific gpio-test drivers with a common driver

Change-Id: I1ec684d8bdd539d3a9d26a8183178016b7d5d129