> I understand you are looking for a generic API that can be used from > drivers to access GPIOs, right? > I understand this may come up in situations like handling CS lines from > SPI driver.
Right. > Currently we handle this by delegating the select line handling to board > logic completely. > That's what I called driver balkanization > > I thought about this a few times and I think this can be made better > without breaking modularity. A new system, thought from the ground up to solve a problem, doesn't break modularity per se > I think the closest approach is to use something in the lines of what > Xiang suggested: give the lower-half part of the SPI device driver the > ability to control the GPIO via some interface (ioexpander in this case). I already explained why ioexpander is useless > One improvement I can think of is to avoid the devid -> CS line routing to > be made at board-logic level and make a SPI device driver (eg: a sensor) > handle it itself. In other words, make a SPI device driver provide the > select operation (instead of the typical <arch>_spiNselect() at board logic > level. > This could also be used for the spiNstatus and D/C lines, if present. > That's moving the same problem from one place to another instead of eliminating it: you need to rewrite some part of the driver for each chip/subchip. > > That could go a long way to reduce boilerplate code to enable use of a SPI > device from a given board. > I don't want to _reduce_ it. I want to _solve the problem_ > > Best, > Matias > > On Sat, Feb 6, 2021, at 09:16, Grr wrote: > > El vie, 5 feb 2021 a las 23:15, Brennan Ashton (< > bash...@brennanashton.com>) > > escribió: > > > > > On Fri, Feb 5, 2021, 8:43 PM Grr <gebbe...@gmail.com> wrote: > > > > > > > > > Arch specific ones are not allowed in arch/ or your application > > > > > > There is no reason to provide your application > > > > > > > GPIO system is _not_ my application > > > > We are talking in circles here at this point. You would have to show what > > > you are planning on doing with the information you are trying to put in > > > board.h because I don't see how it helps > > > > > > I already did that > > > > Where would this base address be > > > used, what exactly would call it? > > > > > > > GPIO system gpio_setpin() function > > >