public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Mohammed Billoo <mab@mab-labs.com>
Cc: Peter Korsgaard <peter@korsgaard.com>, linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: ocores: Allow endian-specific grlib accessors
Date: Wed, 19 Aug 2020 04:14:02 +0200	[thread overview]
Message-ID: <20200819021402.GC2347062@lunn.ch> (raw)
In-Reply-To: <CALkjhPo9rvaM4_uOPFxZ3PjkfOqpC01O==o-gz9aNAxqkRWcNQ@mail.gmail.com>

On Tue, Aug 18, 2020 at 06:14:31PM -0400, Mohammed Billoo wrote:
> Andrew,
> 
> Thanks for your comments. Does it make sense to replace the big_endian
> bool with a small_endian bool? The code to choose the appropriate
> non-grlib accessors assumes that big_endian will be specified, either
> in a device tree blob or via platform_data:
> 
> if (!i2c->setreg || !i2c->getreg) {
>         bool be = pdata ? pdata->big_endian :
>                 of_device_is_big_endian(pdev->dev.of_node);
> .
> .
> .
> case 2:
>         i2c->setreg = be ? oc_setreg_16be : oc_setreg_16;
> 
> And so if endianess isn't specified (assuming the default is big
> endian), it will actually default to small endian.

You have to assume there is no indication of endianness in device tree
by default. For your broken hardware you will indicate little endian
in device tree. If you want, you could add support for DT indicating
big endian, but it is not required.

       Andrew

  reply	other threads:[~2020-08-19  2:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 21:01 [PATCH] i2c: ocores: Allow endian-specific grlib accessors Mohammed Billoo
2020-08-18  1:34 ` Andrew Lunn
2020-08-18 22:14   ` Mohammed Billoo
2020-08-19  2:14     ` Andrew Lunn [this message]
2020-08-19 23:57       ` Mohammed Billoo

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=20200819021402.GC2347062@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mab@mab-labs.com \
    --cc=peter@korsgaard.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox