Re: [RFC][PATCH v2 0/3] slower spi-gpio

From: Ben Gardiner
Date: Tue Dec 14 2010 - 11:58:21 EST


On Thu, Dec 9, 2010 at 11:38 PM, David Brownell <david-b@xxxxxxxxxxx> wrote:
> You know, the spi-gpio code was written so it
> would not need Kconfiguration, and I'd like
> to see that continued.
>
> Surely the minimal configuration you'd need
> could be wrapped up in #defineslike the
> actual GPIO numbers are wrapped up in.
>
> Heck, nothing outside your patches needs your
> :slow it way the heck down" option, so there's
> no point to exposing it  via Kconfig;
> such stuff is routinely embedded in C code.

Hi David,

Thanks for your comments. I'm glad to get a better picture of what you
expect from future proposed changes to spi_gpio.

Ok. Kconfig is clearly not an acceptable way to keep spi_gpio fast for
those who want it.

> Would it make more sense to have a separate
> slowed-down veresion of the driver, maybe just
> custom defs for our hardware plus the current
> driver body, as explained in the driver code
> (last time I looked at it, anyway).

I'm hearing that a separate driver is.

> (I notice you didn't even check the GPIOs to see
> if they are sleeping calls (e.g. over I2C), which
> would have been preferable to a static always-slow
> Kconfig option.  (But not to an always-slow object
> vs the current default always-fast model.

I hadn't thought that we could check for sleeping calls, thanks for
that suggestion.

> I still need to be able to get multi-megabit
> SPI clock rates out of the standard spi-gpio
> code base.  (When I've had to use spi-gpio it
> has never been a performance issue; the code
> was written to facilitate inner bitbang loops
> of about half a dozen instructions (ARM).

Ok so current users of spi_gpio require it to operate 'as fast as it
can.' But compile-time switching in the driver is undesireable.

What I'm taking away from the discussion is that we should introduce a
second bitbanging SPI master driver that reuses as much code as
possible from the existing spi_gpio driver.

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/