From: Vitaly W. <vw...@ru...> - 2005-09-20 16:53:01
|
dmitry pervushin wrote: <snip> >3.1 The SPI outline > >The SPI infrastructure deals with several levels of abstraction. They are >"SPI bus", "SPI bus driver", "SPI device" and "SPI device driver". The >"SPI bus" is hardware device, which usually called "SPI adapter", and has >"SPI devices" connected. From the Linux' point of view, the "SPI bus" is >structure of type platform_device, and "SPI device" is structure of type >spi_device. The "SPI bus driver" is the driver which controls the whole > > Is there platform_bus structure BTW? :) <snip> >To handle DMA transfers on SPI bus, any device driver might provide special >callbacks to allocate/free/get access to buffer. These callbacks are defined >in subsection iii of section 4. >To send data using DMA, the buffers should be allocated using >dma_alloc_coherent function. Usually buffers are allocated statically or >using kmalloc function. >To allow drivers to allocate buffers in non-standard > > ...? >When one allocates the structure for spi message, it needs to provide target > > one = he :) >device. If its driver wants to allocate buffer in driver-specific way, it may >provide its own allocation/free methods: alloc and free. If driver does not >provide these methods, kmalloc and kfree will be used. > > suggest: ...and it's also up to him to create a specific structure and return this structure pointer in alloc and cast to it in free. Best regards, Vitaly |