Re: [PATCH] i2c: ocores: Allow endian-specific grlib accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux