[Top][All Lists]

[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
> -- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]