# WP7702 two devices on SPI?

**URL:** <https://forum.legato.io/t/wp7702-two-devices-on-spi/4960>\
**Category:** Legato Linux distribution (Yocto project)\
**Created:** [January 23, 2020, 10:54am UTC](https://forum.legato.io/t/wp7702-two-devices-on-spi/4960 "2020-01-23T10:54:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tihomir.borovski](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tihomir.borovski](https://forum.legato.io/u/tihomir.borovski)\
**Post date:** [January 23, 2020, 10:54am UTC](https://forum.legato.io/t/wp7702-two-devices-on-spi/4960/1 "2020-01-23T10:54:43Z")

</div>

Hello,

We want to connect two devices on the SPI bus of the WP7702, but documentation says there is only one chip select pin available SPI1\_MRDY.  
However Qualcomm docs and linux spi driver say that SPI supports four chip selects.  
Even more - Linux device tree documentation states that using “cs-gpios” should be possible to set virtually any gpio as an SPI chip select.

**So the question is - how to enable additional SPI1 chip select (preferably hw or at least gpio), so we can connect another SPI device? Which pad of the module could be used for this and which GPIO is it as per the SoC/Device tree**

Since we have no the Qualcomm SoC PDF, we do not know which SoC pin supports this functionality. We also have no schematics of the WP7700 module so also do not know which pins of the SoC that function as SPI1 CSs are routed to pads of the module.

I already wasted 3 days trying lots of DTS configuration without success.

---

<div class="post-metadata">

**Author:** ![tihomir.borovski](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tihomir.borovski](https://forum.legato.io/u/tihomir.borovski)\
**Post date:** [January 28, 2020, 7:48am UTC](https://forum.legato.io/t/wp7702-two-devices-on-spi/4960/2 "2020-01-28T07:48:30Z")

</div>

OK, I made it work!  
I added this to the SPI configuration in the device tree:  
num-cs = \<2\>;  
cs-gpios = \<0\>, \<&tlmm\_pinmux 16 0\>;

But before using the SPI I had to set the GPIO as output in the sysfs:  
echo 7 \> export  
echo out \> direction

I believe this can also be avoided, if device tree is further setup properly.

---

<div class="post-metadata">

**Author:** ![simon.naegele](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@simon.naegele](https://forum.legato.io/u/simon.naegele)\
**Post date:** [September 2, 2021, 3:14pm UTC](https://forum.legato.io/t/wp7702-two-devices-on-spi/4960/3 "2021-09-02T15:14:07Z")

</div>

Hi @tihomir.borovski ,  
I’m also trying to add a second and third chip select.  
Maybe you can share the file?

Thanks,  
Simon
