#
3ab16f4f |
|
19-Sep-2018 |
Andres Oportus <andresoportus@google.com> |
[ddk][i2c] Refactor the I2C protocol This change is similar to "[gpio] Refactor the GPIO protocol" but for I2C channels: https://fuchsia-review.googlesource.com/c/zircon/+/199400 After this change an instance of the ZX_PROTOCOL_I2C protocol now represents a single I2C channel. The protocol remains the same, except the "uint32_t index" has been removed from all the protocol functions. For devices that have only one I2C channel assigned to them, the driver can simply call device_get_protocol() to access the I2C protocol for the channel. To support multiple channel, a new API in the platform bus called pdev_get_protocol() allows accessing the I2C channels protocols by index. ZX-2621 #comment Refactor the I2C protocol removing index. Test: Boot and I2C transactions work on astro and NXP IMX8 Change-Id: I55d08aa3d82024f6977646425fd3d75a378f2740
|
#
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
|