Article 5FRFM Linux Driver - Best Practices

Linux Driver - Best Practices

by
tui_smuggler
from LinuxQuestions.org on (#5FRFM)
Hi All,

I am currently writing a kernel module driver for a Texas Instruments DAC16S997 SPI based device using IIO(class?). I have successfully created something that works for me but was wondering if anyone out there can comment on best practices regarding drivers and user space. The intention would be to create a pull request on the main branch. Before I do this I would like some insight as this is my first rodeo.

Main questions/areas of concern:

1. SPI Register access
How much access should I give the user space. Do i create an interface for every register and let the user space configure anything at will? or not at all. Or somewhere in between?

2. Persistent Configuration - Should configuration be persistent across reboot. i.e Do i reset to a default state on boot or just pickup where it was left.

Regarding Q1 I see a potential solution being to wrap a config around the registers so the user space only has access to configuration parameters which under the hood deal with registers.

Any general insights or thoughts will also be appreciated.

Thankslatest?d=yIl2AUoC8zA latest?i=uJ7S9kCQvRU:J-430eKDzUc:F7zBnMy latest?i=uJ7S9kCQvRU:J-430eKDzUc:V_sGLiP latest?d=qj6IDK7rITs latest?i=uJ7S9kCQvRU:J-430eKDzUc:gIN9vFwuJ7S9kCQvRU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments