2010-05-07 09:57:56     SPI MAX_CTRL_CS missing

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-05-07 09:57:56     SPI MAX_CTRL_CS missing

Charlie Ellis (UNITED STATES)

Message: 89227   

 

I have a SPI slave device attached to BF548 that requires me to have software control over the CS (none of the supported modes will work). Doc instructions provide clear instructions how to do this ==> set .chip_select field in spi_board_info to GPIO_PXX + MAX_CTRL_CS. MAX_CTRL_CS does not exist anywhere in the source code tree, thus I will need to dig in to the driver source to find out what is really required to get the functionality I need. Any chance someone can help point me to the correct method to get software GPIO control of CS?

QuoteReplyEditDelete

 

 

2010-05-07 10:03:46     SPI MAX_CTRL_CS missing

Michael Hennerich (GERMANY)

Message: 89228    Try it the old way. (The documentation targets the new implementation)

 

Set .chip_select = 0 and set bfin5xx_spi_chip.cs_gpio = GPIO_PXX;

 

This should work for one gpio controlled SPI select, but will fail due to a check in the generic spi bus driver code.

QuoteReplyEditDelete

 

 

2010-05-07 10:30:11     Re: SPI MAX_CTRL_CS missing

Charlie Ellis (UNITED STATES)

Message: 89229   

 

Try it the old way. (The documentation targets the new implementation)

 

Set .chip_select = 0 and set bfin5xx_spi_chip.cs_gpio = GPIO_PXX;

 

Thanks, that did the trick!

 

 

This should work for one gpio controlled SPI select, but will fail due to a check in the generic spi bus driver code. ---

 

So, does this mean if I have 3 slaves attached to the same controller and each one requires me to have software GPIO control of slave CS I'm going to run into trouble?

QuoteReplyEditDelete

 

 

2010-05-07 10:39:13     Re: SPI MAX_CTRL_CS missing

Michael Hennerich (GERMANY)

Message: 89230    >> This should work for one gpio controlled SPI select, but will fail due

>> to a check in the generic spi bus driver code. ---

 

> So, does this mean if I have 3 slaves attached to the same controller

> and each one requires me to have software GPIO control of slave CS I'm

> going to run into trouble?

 

rivers/spi/spi.c spi_add_device() prevents spi0.0 to exist twice.

 

Unless you remove this check the old way just works for on GPIO controlled SPI SSEL.

(and that's why we fixed it)

 

-Michael

QuoteReplyEditDelete

 

 

2010-05-07 10:50:43     Re: SPI MAX_CTRL_CS missing

Charlie Ellis (UNITED STATES)

Message: 89231   

 

Thanks Michael!

 

Best regards, Charlie

Attachments

    Outcomes