lkml.org 
[lkml]   [2019]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] spi: SPI bus multiplexer
Date
Hi All,

I have a hardware design where a single SPI chip select is steered by a
GPIO being asserted or de-asserted. On older kernels I was able to
(ab)use a gpio-hog and cs-gpios to deal with this.

Unfortunately recent changes have stopped my hacks from working. I've
tried adapting cs-gpios to work with my particular hardware but I came
to the realisation that the current cs-gpios support assumes a 1:1
mapping of gpio to SPI device whereas my hardware used the state of the
gpio selecting the device i.e. a 1:2 mapping.

This is my attempt to implement a driver to deal with this. One nice
property is that it is pretty much self contained. The only change to
the core SPI infrastructure is exposing a function I needed to lookup
the spi_controller instance.

Chris Packham (3):
dt-bindings: spi: Add spi-mux-gpio
spi: Make of_find_spi_controller_by_node visible
spi: Add SPI bus gpio multiplexer

.../devicetree/bindings/spi/spi-mux-gpio.txt | 46 +++++
drivers/spi/Kconfig | 7 +
drivers/spi/Makefile | 1 +
drivers/spi/spi-mux-gpio.c | 169 ++++++++++++++++++
drivers/spi/spi.c | 7 +-
include/linux/spi/spi.h | 7 +
6 files changed, 234 insertions(+), 3 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/spi-mux-gpio.txt
create mode 100644 drivers/spi/spi-mux-gpio.c

--
2.21.0

\
 
 \ /
  Last update: 2019-04-12 07:03    [W:0.534 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site