I am supposed to call an spoi bus init function to get the spi device I
then use to register my device to.

This is the code in sam34:
/****************************************************************************
 * Public Functions
 ****************************************************************************/

/****************************************************************************
 * Name: sam_spibus_initialize
 *
 * Description:
 *   Initialize the selected SPI port
 *
 * Input Parameters:
 *   cs - Chip select number (identifying the "logical" SPI port)
 *
 * Returned Value:
 *   Valid SPI device structure reference on success; a NULL on failure
 *
 ****************************************************************************/

struct spi_dev_s *sam_spibus_initialize(int port)
{
  struct sam_spidev_s *spi;
  struct sam_spics_s *spics;
  int csno  = (port & __SPI_CS_MASK) >> __SPI_CS_SHIFT;
  int spino = (port & __SPI_SPI_MASK) >> __SPI_SPI_SHIFT;

...


The delivered port is the bus number and chip select number combined.
I get an spi dev device specific for the bus and chipselect.

Not so for samd2l1.
The sam_spibus_initialize() takes the port directly and uses it to
select the physical bus.
There is no chipselect part.
Additionally it seems to init the physical bus unrelated if it had been
setup already.
So it is my interpretation that I can't call this function twice.

There is a similar problem I've noticed with the i2c_master setup.

I don't know if the chip select is really required, but at least both
drivers have no support to be called multiple times.

-- 
B.Walter <be...@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.

Reply via email to