All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: chao bi <chao.bi@intel.com>
Cc: alan@linux.intel.com, linux-serial@vger.kernel.org,
	richardx.r.gorby@intel.com, chuansheng.liu@intel.com,
	jun.d.chen@intel.com
Subject: Re: [PATCH] serial:ifx6x60:different SPI word width configure requires different swap process
Date: Wed, 24 Oct 2012 13:31:29 +0100	[thread overview]
Message-ID: <20121024133129.1155cc2e@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1351061328.18855.95.camel@bichao>

On Wed, 24 Oct 2012 14:48:48 +0800
chao bi <chao.bi@intel.com> wrote:

> 
> SPI protocol driver only provide one function (swap_buf()) to swap SPI data
> into big endian format, which is only available when SPI controller's word width
> is 16 bits. But word width could be configured as 8/16/32 bits, different word
> width configure should be mapped to different swap methods.This patch is to make
> SPI protocol driver choose the right swap function corresponding to SPI word
> width configuration.
> 
> cc: liu chuansheng <chuansheng.liu@intel.com>
> cc: Chen Jun <jun.d.chen@intel.com>
> Signed-off-by: channing <chao.bi@intel.com>

> +	len = (0 == (len&0x03)) ? (len >> 2) : ((len >> 2) + 1);

Minor question - is that not just (len + 3) >> 2 ?

The SPI swapping stuff at runtime looks right so.

Acked-by: Alan Cox <alan@linux.intel.com>

  reply	other threads:[~2012-10-24 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  6:48 [PATCH] serial:ifx6x60:different SPI word width configure requires different swap process chao bi
2012-10-24 12:31 ` Alan Cox [this message]
2012-10-25  0:40   ` Bi, Chao
  -- strict thread matches above, loose matches on Subject: below --
2012-10-25  1:02 chao bi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121024133129.1155cc2e@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=alan@linux.intel.com \
    --cc=chao.bi@intel.com \
    --cc=chuansheng.liu@intel.com \
    --cc=jun.d.chen@intel.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=richardx.r.gorby@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.