On Fri, Jun 17, 2011 at 04:35:37AM -0400, Mike Frysinger wrote:
> The default bits per word setting should be 8 bits, but since most of our
> devices have been explicitly setting this up, we didn't notice when the
> default stopped working.
>
> At the moment, any default transfers without an explicit bit size setting
> error out with:
> bfin-spi bfin-spi.0: transfer: unsupported bits_per_word
>
> So in the transfer logic, have a bits_per_word setting of 0 fall into the
> 8 bit transfer logic.
>
> Signed-off-by: Mike Frysinger <[email protected]>
Merged for v3.0, thanks.
g.
> ---
> v2
> - wasn't quite as simple as i'd hope ...
>
> drivers/spi/spi_bfin5xx.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
> index ae30fa3..1f123b9 100644
> --- a/drivers/spi/spi_bfin5xx.c
> +++ b/drivers/spi/spi_bfin5xx.c
> @@ -681,13 +681,14 @@ static void bfin_spi_pump_transfers(unsigned long data)
> drv_data->cs_change = transfer->cs_change;
>
> /* Bits per word setup */
> - bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word;
> - if ((bits_per_word > 0) && (bits_per_word % 16 == 0)) {
> + bits_per_word = transfer->bits_per_word ? :
> + message->spi->bits_per_word ? : 8;
> + if (bits_per_word % 16 == 0) {
> drv_data->n_bytes = bits_per_word/8;
> drv_data->len = (transfer->len) >> 1;
> cr_width = BIT_CTL_WORDSIZE;
> drv_data->ops = &bfin_bfin_spi_transfer_ops_u16;
> - } else if ((bits_per_word > 0) && (bits_per_word % 8 == 0)) {
> + } else if (bits_per_word % 8 == 0) {
> drv_data->n_bytes = bits_per_word/8;
> drv_data->len = transfer->len;
> cr_width = 0;
> --
> 1.7.5.3
>
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general