I'm working on a new device, the Mikrotik SXTR.
Some modem control functions and the signal bar LEDs are on a 74HC595. The clock and data of this chip are connected to the same SPI lines as the flash chip, and the latch enable is on GPIO 11.
I thought this would work (in particular the cs-gpios option), but it does not.
&spi {
status = "okay";
num-cs = <2>;
cs-gpios = <0>, <&gpio 11 GPIO_ACTIVE_HIGH>;
gpio_ext: gpio_ext@1 {
compatible = "fairchild,74hc595";
reg = <1>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <10000000>;
};
};
- The flash chip still works.
- There is now a second SPI device, spi0.1
- The LEDs created on gpio_ext are in the LED system.
- Trying to light an LED proceeds without error, but it does not light.
- The spi0.1 statistics count up when accessing LEDs.
- GPIO 11 has not been seized by the kernel, I can still go to /sys/class/gpio and export it and bit bang it and the levels will appear at the chip.
- There is a 0b (11) in here, but again it did not actually take:
root@OpenWrt:/sys/devices/platform/ahb/1f000000.spi/spi_master/spi0# hexdump of_node/cs-gpios
0000000 0000 0000 0000 000f 0000 000b 0000 0000
I look at the Teltonika 955 as a similar example, but there they are using pinctrls to make the HC595 pins including CS native to the SPI controller. Which I was hoping not to have to deal with pinctrls.
Any help is appreciated.