ARM: OMAP: SPI edge selection [was Re: Edge selecton on SPI bus]
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ARM: OMAP: omap2_mcspi: fix for channel configuration and CSdrivers/ | +7 | 0 replies | |
| 2/3 | ARM: OMAP: edge selection for McSPI / uWiredrivers/ drivers/ | +5 | 0 replies | |
| 3/3 | Input: ads7846: select correct SPI modedrivers/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] ARM: OMAP: SPI edge selection [was Re: Edge selecton on SPI bus]
Quoted 11 lines · ext David Brownell
Quoted 9 lines · Imre Deak
Hi,
I think the edge selection in the
omap_uwireandomap2_mcspiis borked. I have a patch for it, but I'd like to ask first if my assumption is right:
On the SPI / uWire bus by definition you can only configure a mode (one of the 4 modes), in which the read / write takes place on opposite edges. That is you can't configure for example a read rising edge / write rising edge mode.
Quoted 8 lines
That's my understanding, yes. Consider that if you connect MOSI directly to MISO for a loopback configuration, what you send is supposed to exactly match what you receive ... that couldn't happen if there were no settling time between setting MOSI and reading MISO.
That
WRITE_FALLING|READ_FALLINGalways did look goofy, but I recall it as more or less a direct translation from the old driver. In any case the REVISIT note seems to have gotten lost.
I think the devices worked so far with this buggy logic since I suspect a complementary problem in the TRM for the read edge selection HW flag. I checked this against devices that are known to be using a given SPI mode.
The OMAP2 McSPI code too has a wrong mapping between SPI mode and read / write edge.
Also at least the ads7846 was using incorrectly SPI mode 0, since it's expecting writes on the falling / reads on the rising edge which maps to mode 1.
I'm posting 3 patches to solve these issues.
--Imre
Quoted 11 lines
- Dave
Quoted 6 lines
On OMAP2 this I even see from the fact that you can set the reading edge and the writing edge is implied.
--Imre