cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
6,582 Views
Registered: ‎02-26-2013

SPI GPIO chipselect

Hi,

there is possibility to map SPI device chipselect to GPIO?

I just modifiy a device driver:

 

gpiod_set_value(csgp, 0);
ret = spi_write_then_read(spi, &buf[0], 2, rbuf, num);
gpiod_set_value(csgp, 1);

 

but a I thing it is not so good solution.

0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
6,554 Views
Registered: ‎08-01-2012

What is the FPGA device part number? 

________________________________________________

Please mark this post as an "Accept as solution" in case if it helped to resolve your query. So that it will help to other forum users to directly refer to the answer.

Give kudos to this post in case if you think the information is useful and reply oriented.

0 Kudos
Highlighted
Scholar
Scholar
6,520 Views
Registered: ‎11-09-2013

linux native spi driver allows to use any GPIO as chip select.. this all explaine in the device tree bindings

 

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/spi/spi-bus.txt?v=3.14

0 Kudos
Highlighted
Observer
Observer
1,541 Views
Registered: ‎02-20-2014

I put a patch on the list, if you still have the issue:

 

https://lkml.org/lkml/2017/4/25/728

0 Kudos