linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org"
	<linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Chris Zankel <chris-YvXeqwSYzG2sTnJN9+BGXg@public.gmane.org>,
	Marc Gauthier <marc-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH v2 1/3] spi: add xtfpga SPI controller driver
Date: Wed, 12 Mar 2014 21:13:35 +0400	[thread overview]
Message-ID: <CAMo8Bf+mC_ZfECqJ2Apf5rcTJ10hbE55wN1cT7Jv74kzWFuVTg@mail.gmail.com> (raw)
In-Reply-To: <20140312124901.GQ28112-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

On Wed, Mar 12, 2014 at 4:49 PM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Wed, Mar 12, 2014 at 04:21:03PM +0400, Max Filippov wrote:
>
>> +     case 16:
>> +             /* Bytes that should go out earlier have lower addresses,
>> +              * but the hardware operates with 16 bit words and transmits
>> +              * higher bits first. Thus data in memory is in BE order.
>> +              */
>> +             xspi->data = (xspi->data << 16) | be16_to_cpu(v);
>> +             xspi->data_sz += 2;
>> +             break;
>
> Are you sure you need to do this byte swap?  SPI words are big endian so
> if you are running on a little endian processor if you are transmitting
> 16 bit words you should see the data getting swapped on the bus (this is
> why I say you should never have more than 8 bits per word for regmap).

Looks like this swap is not needed: I've looked at drivers that set
bits_per_word = 16, they submit data in cpu endianness. Will fix in v3.

-- 
Thanks.
-- Max
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-03-12 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 12:21 [PATCH v2 0/3] xtensa xtfpga SPI controller driver Max Filippov
2014-03-12 12:21 ` [PATCH v2 1/3] spi: add " Max Filippov
     [not found]   ` <1394626865-15105-2-git-send-email-jcmvbkbc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-12 12:49     ` Mark Brown
     [not found]       ` <20140312124901.GQ28112-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-03-12 17:13         ` Max Filippov [this message]
     [not found] ` <1394626865-15105-1-git-send-email-jcmvbkbc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-12 12:21   ` [PATCH v2 2/3] spi/xtensa-xtfpga: add DT binding documentation Max Filippov
     [not found]     ` <1394626865-15105-3-git-send-email-jcmvbkbc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-12 15:13       ` Mark Rutland
2014-03-12 17:21         ` Max Filippov
2014-03-12 12:21 ` [PATCH v2 3/3] MAINTAINERS: add xtfpga platform section Max Filippov

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=CAMo8Bf+mC_ZfECqJ2Apf5rcTJ10hbE55wN1cT7Jv74kzWFuVTg@mail.gmail.com \
    --to=jcmvbkbc-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=chris-YvXeqwSYzG2sTnJN9+BGXg@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org \
    --cc=marc-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).