Does the Linux SPI subsystem have support for handling the slave side of SPI interactions?
The mechanism has two devices(devA running on Linux platform board and devB on another platform) glued together via 2 spi buses. The idea is to use one SPI bus when devA acts a master and to use the other bus to handle the return path data from the devB.
Does the Linux SPI subsystem support handling the devB as a slave device during the return data path?
Related
I have multiple devices on MDIO bus (one AR8035 PHY, and 6 DP83849IFVS dual PHYs). The bus is connected to AM335x SoC with linux 4.14.40. Davinchi_mdio scans bus and finds all devices and attaches driver I think for AR8035. How can I access this bus via mdio? I want to write stand-lone (not PHY driver) kernel module, that can simply access mdio bus? How can I do that? I wanted to do that with phy_write/phy_read but I can't get struct phy_device* from my kernel module. How can I get struct phy_device* from the name of the interface ("eth0"). Will it be safe in terms of locks/mutaxes?
If you already have an subsystem for MDIO controller, then I can think of implementing an UIO driver for MDIO interface, which deals with read and write.
UIO driver is safe when compared to the messy kernel driver and complete control will be with the user application which uses that UIO.
**
*Each UIO device is accessed through a device file and several sysfs attribute files. The device file will be called /dev/uio0 for the first device, and /dev/uio1, /dev/uio2 and so on for subsequent devices.
/dev/uioX is used to access the address space of the card. Just use mmap() to access registers or RAM locations of your card.
Interrupts are handled by reading from /dev/uioX. A blocking read() from /dev/uioX will return as soon as an interrupt occurs.*
**
I am looking into USB device driver code. looks like all it does is to fill a URB message then calls usb_submit_urb() to pass the message to USB core functions once probe() is called upon matching PCI vendor/product ID.
However I am not able to figure out how USB core relates the device driver to correct HCI driver (xHCI, eHCI etc.)... what I found is most of HCI drivers register themselves as a platform driver which has a unique name, is that the identifier for usb core to correlate the device driver and host driver?
When you have usb 3.0 - then kernel uses xhci driver and doesn't need uhci, ohci or ehci drivers. In such configuration you have got only one hci driver and one hci host. Earlier in the USB 2.0 era there were 2 possible configurations:
ehci with companion controller (ohci or uhci)
ehci with transaction translator (TT)
In the first situation you need to have both drivers installed - for example ehci and uhci. In the second one only dedicated ehci driver was needed.
So currently when you have only xhci - it registers itself as the only usb host driver in linux system. Second thing - it is host driver function to request anything from usb devices - so usb host generates any requests to devices and it is responsible for maintenance of the answers from device. The xhci host driver registers his interrupt and memory area for request maintenance.
I think you need to take a look at this problem from the host (xhci) point of view, not from device point of view, because the host is the master in usb communication and the host initiates any requests. Device is only answering those requests.
As per, rpi3 device tree, it has two spi buses i.e spi0 and spi1. spi0 bus supports 2 chip select [spi0.0, spi0.1] and spi1 bus supports 3 chip select[spi1.0, spi1.1, spi1.2] pins. All these can be configured in config.txt using dtoverlay.
Now my rpi3 uses spi0.1 for touchscreen interface. I dont want to use spi0.0 because it may cause bus contention. So i need to connect my other peripheral on spi1.x bus.
When i am querying rpi3 for spi buses using getSpiBusList(), the ouput is [SPI0.0, SPI0.1]
How do i get around this issue?
Note:- Using android things 0.7-devpreview
According Raspberry Pi I/O pinout there is only SPI0.0 and SPI0.1 SPI buses pins, so you can't use SPI1.? bus even if you configure it in config.txt.
I want to connect the module HC05 (with UART protocol) to Raspberry pi and see the receiving result on wxwidgets (code-blocks GUI).
where can i write UART code in wxwidgets?
How can i write each protocol in wxwidgets?
wxWidgets doesn't provide a uniform API for communicating with serial ports, as explained here.
The Raspberry Pi is typically running a Linux distribution where serial ports are exposed as special device files such as /dev/stty0. Consult your favorite Linux/Raspberry Pi documentation for information on how to configure serial port parameters. Once configured, just read/write to the file in order to communicate with whatever devices is attached to the port.
I am new to Linux Device driver and trying to understand Linux device driver model which says a device must registered with its respected bus, be it the platform bus or real spi/i2c bus.
I could see the following macro which registered the i2c client device to its i2c bus.
module_i2c_driver(lm73_driver);
But I am not sure how it happen for a spi client device for example a CPLD/FPGA device sits on the spi bus.
Is such registrations based on the type of device?(block device or char device)