LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-22-2022, 04:24 AM   #1
lubna
LQ Newbie
 
Registered: Nov 2022
Posts: 2

Rep: Reputation: 0
Linux SPI driver Implemenation


I have question regarding SPI interface in th linux kernel. I want access SPI device in the user space as well as kernel space.

I found information in the below URL about SPI system, which helped me understand SPI system better.
https://wiki.st.com/stm32mpu/wiki/SPI_overview

I want to keep the spidev interface to access SPI device in the user space and I also want to implement protocol driver in the kernel space.

My query is can spidev driver(userspace) and protocol driver(kernel space) co-exist? If yes, can I access spidev driver and protocol driver simulataneously?



Thanks in advance.


Kind Regards,
Lubna
 
Old 11-22-2022, 05:33 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I guess yes, the protocol driver will create some other device(s), like /dev/spi_protocol and works on /dev/spidev. But obviously you can hardly run two or more drivers on the same device simultaneously. So I don't really understand what do you want to achieve.
 
Old 11-22-2022, 06:33 AM   #3
lubna
LQ Newbie
 
Registered: Nov 2022
Posts: 2

Original Poster
Rep: Reputation: 0
@pan64 Thanks for the reply.

So what I am trying to achieve is, I want to implement a protocol driver to access SPI device in the kernel space.
But I also have to use software applications in the user space[ E.g Skyworks API for Network time synchronization] which are heavily depend on spidev driver interface.



A dumb question: Instead of creating a new device node[like /dev/spi_protocol] in the protocol driver, can I just intercept spidev driver [E.g /dev/spidev1.0] in the kernel protocol driver to communicate SPI device?
 
Old 11-22-2022, 07:49 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
yes. you can do that obviously, the problem is when you access the same device from several different apps simultaneously. But without details hard to say anything.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DTS configuration for SPI BUS with spi-mux Zano Linux - Kernel 0 08-28-2021 12:45 PM
Can i register a ssc driver (a serial interface device) to be a spi driver ? 5883 Programming 0 03-04-2012 06:14 PM
Urgent : help needed on web server implemenation kbsadiga Programming 4 11-29-2004 12:05 PM
Urgent : help needed on web server implemenation kbsadiga Linux - Networking 2 11-28-2004 02:52 AM
help to separate implemenation of IP and LINK layers in ip_output.c cranium2004 Programming 0 08-18-2004 05:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration