Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have to write an application in linux-3.0.36 for ADC/DAC that has connected using SPI interface. Processor im using is mpc8379 and chip select signal to SPI has given using processor gpio. Problem is i dont know where to start.
I know the register details of spi. In kernel im not getting the code flow and how gpio interacts with with the spi driver code.
Finally i just want to know the SPI implementation flow in kernel code and User Space Support for SPI.
The device tree allows you to find out where your device is connected and how it is configured. However, you need to tell your driver to get that, and not the other device. You should be able to get all the ifnormation from the device tree, if you have it for your board.
1. There is a way to add it in device tree file. You can refer to arch/PowerPC/boot/dts/mpc8313erdb.dts spi@7000{
cell-index = <0>;
compatible = "fsl,spi";
reg = <0x7000 0x1000>;
interrupts = <16 0x8>;
interrupt-parent = <&ipic>;
mode = "cpu";
};
2. For mpc8xxx series, you need to configure one of the GPIO as SPICS signal. You can refer to the datasheet of the spi slave. Here you can get whether the
Chip Select signal is active high or active low. Based on this, you can set gpio line as 1/0 before doing any SPI transfer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.