Hi, Mike

On Fri, Jun 17, 2011 at 4:16 PM, Mike Frysinger <[email protected]> wrote:
> commit:
> http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=5b461b20689831b1ae2181f998b47fdd652c8626
> branch:
> http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/trunk
>
> 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]>
> ---
>  drivers/spi/spi_bfin5xx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
> index ae30fa3..c491057 100644
> --- a/drivers/spi/spi_bfin5xx.c
> +++ b/drivers/spi/spi_bfin5xx.c
> @@ -687,7 +687,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
>               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;
>

I think this change still not work. Sorry for that.
By this change drv_data->n_bytes will be set to 0 which isn't correct.

In my opinion it should be like this, but i am still have no time to test it .

Index: drivers/spi/spi_bfin5xx.c
===================================================================
--- drivers/spi/spi_bfin5xx.c   (revision 9946)
+++ drivers/spi/spi_bfin5xx.c   (working copy)
@@ -682,6 +682,9 @@

        /* Bits per word setup */
        bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word;
+       if (!bits_per_word)
+               bits_per_word = 8;      /* set default value */
+
        if ((bits_per_word > 0) && (bits_per_word % 16 == 0)) {
                drv_data->n_bytes = bits_per_word/8;
                drv_data->len = (transfer->len) >> 1;


-- 
Regards,
--Bob
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to