[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 10/12] register: Add GPIO API
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [PATCH v7 10/12] register: Add GPIO API |
Date: |
Thu, 23 Jun 2016 11:14:32 -0700 |
On Thu, Jun 23, 2016 at 6:19 AM, Peter Maydell <address@hidden> wrote:
> On 22 June 2016 at 21:24, Alistair Francis <address@hidden> wrote:
>> Add GPIO functionality to the register API. This allows association
>> and automatic connection of GPIOs to bits in registers. GPIO inputs
>> will attach to handlers that automatically set read-only bits in
>> registers. GPIO outputs will be updated to reflect their field value
>> when their respective registers are written (or reset). Supports
>> active low GPIOs.
>>
>> This is particularly effective for implementing system level
>> controllers, where heterogenous collections of control signals are
>> placed is a SoC specific peripheral then propagated all over the
>> system.
>
> I still don't think this is a good idea. GPIOs are device-level,
> not register-level. Most devices don't really have very many
> GPIOs. It should be easy to wire up "change GPIO state based on
> new register value" from a register post-write hook. This API
> can't handle the absolute most common case, which is "GPIO state
> is based on a bit being set in (raw-state-register AND mask-register)."
>
> Basically I don't think GPIOs belong in this API, and I don't think
> there's a good case that adding them makes a significant class
> of devices much easier to write.
Ok, I'm going to remove the GPIO part from this patch set (the last
few patches).
Once this patchset is accepted I'll spin up a new series with the
GPIOs and some better/more complex devices and we can go from there.
Thanks,
Alistair
>
> thanks
> -- PMM
>
- Re: [Qemu-devel] [PATCH v7 04/12] register: Define REG and FIELD macros, (continued)
- [Qemu-devel] [PATCH v7 02/12] register: Add Register API, Alistair Francis, 2016/06/22
- [Qemu-devel] [PATCH v7 09/12] irq: Add opaque setter routine, Alistair Francis, 2016/06/22
- [Qemu-devel] [PATCH v7 07/12] dma: Add Xilinx Zynq devcfg device model, Alistair Francis, 2016/06/22
- [Qemu-devel] [PATCH v7 08/12] xilinx_zynq: Connect devcfg to the Zynq machine model, Alistair Francis, 2016/06/22
- [Qemu-devel] [PATCH v7 10/12] register: Add GPIO API, Alistair Francis, 2016/06/22
- [Qemu-devel] [PATCH v7 11/12] misc: Introduce ZynqMP IOU SLCR, Alistair Francis, 2016/06/22