public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "FIXED-TERM Buecheler Konstantin (ETAS-SEC/ECT-Mu)"  <fixed-term.Konstantin.Buecheler@escrypt•com>
To: "linux-can@vger•kernel.org" <linux-can@vger•kernel.org>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>
Cc: Dan Murphy <dmurphy@ti•com>
Subject: can: tcan4x5x: spi bits_per_word issue on Raspberry PI
Date: Wed, 14 Aug 2019 15:01:44 +0000	[thread overview]
Message-ID: <3f71bdff8f4f4fe19ad9a09be89bc73d@escrypt.com> (raw)

> Hi all,
> 
> I am trying to use a tcan4550 together with a Raspberry PI 3 B. I am using the
> tcan4x5x driver from net-next.
> I always get the following error during startup.
> 	tcan4x5x spi0.0: Probe failed, err=-22
> 	tcan4x5x: probe of spi0.0 failed with error -22
> 
> I realized that this happens because the Raspberry PI does only support 8/9 bit
> words. https://elinux.org/index.php?title=RPi_SPI#Supported_bits_per_word
> In the driver it is set to 32.
> 	spi->bits_per_word = 32;
> 
> Setting this to 8 does not help of course since the tcan chip expects a multiple of
> 32 per spi transaction.
> I don't know if this is a Raspberry Pi specific problem or if there are more devices
> with this hardware limitation.
> 
> Does anyone have a workaround for that?

It seems to be enough to just change the bits_per_word value to 8

> 
> If this a common issue it might be a good idea to patch the driver. I will check if I
> can find proper a way to do so.
> 
> Regards,
> Konstantin

Now I have another really confusing problem. Anything I write to SPI is written little endian. The tcan chip expects big endian. 
Anything I read from SPI is treated as little endian but is big endian. Does anyone know why this happens? 
Is there a flag or something I can set for the SPI device/wire to fix this?

Regards,
Konstantin

             reply	other threads:[~2019-08-14 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 15:01 FIXED-TERM Buecheler Konstantin (ETAS-SEC/ECT-Mu) [this message]
2019-08-15  8:34 ` can: tcan4x5x: spi bits_per_word issue on Raspberry PI Marc Kleine-Budde
     [not found]   ` <e6577cc2-89fc-9428-b73e-47f41eff2949@posteo.de>
2019-08-16  8:26     ` AW: " FIXED-TERM Buecheler Konstantin (ETAS-SEC/ECT-Mu)
2019-08-16  8:37       ` Marc Kleine-Budde
  -- strict thread matches above, loose matches on Subject: below --
2019-08-14  9:43 FIXED-TERM Buecheler Konstantin (ETAS-SEC/ECT-Mu)

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=3f71bdff8f4f4fe19ad9a09be89bc73d@escrypt.com \
    --to=fixed-term.konstantin.buecheler@escrypt$(echo .)com \
    --cc=dmurphy@ti$(echo .)com \
    --cc=linux-can@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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