[PATCH] spi: add driver for BCM2835

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Mar 12 15:06:38 EDT 2013

On Thu, Mar 07, 2013 at 11:12:46PM -0700, Stephen Warren wrote:
> On 03/05/2013 09:05 PM, Mark Brown wrote:
> > On Tue, Mar 05, 2013 at 07:49:02PM -0700, Stephen Warren wrote:
> >> +	switch (bpw) { +	case 8: +		break; +	default: +
> >> dev_err(&spi->dev, "unsupported bits_per_word=%d\n", bpw); +
> >> return -EINVAL; +	}

> Is there an assumption in the SPI core that bpw will never be >32? The
> value is stored in a u8 in the controller and transfer structs, so
> large values are physically possible. So if there is no such
> assumption, then representing all of an SPI controller's supported BPW
> in a mask/list would be a little unwieldy, so doing central checking
> might not work well.

I don't think there's such an assumption, on the other hand such
hardware is exceptionally rare so it seems sensible to at least handle
the common case - for example, allow the driver to specify a bitmask and
if no mask is specified just accept anything and let the drive worry
about it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-rpi-kernel/attachments/20130312/dbff0a1b/attachment.sig>

More information about the linux-rpi-kernel mailing list