Skip to content

Lesson 12 - #122

Open
megaparanoik wants to merge 8 commits into
Kernel-GL-HRK:Alexander.Androsovfrom
megaparanoik:lesson_12
Open

megaparanoik wants to merge 8 commits into
Kernel-GL-HRK:Alexander.Androsovfrom
megaparanoik:lesson_12

Conversation

@megaparanoik

Copy link
Copy Markdown

There was added a char device interface to the existed mpu6050 driver.
Now the driver allocates the char device file /dev/accel.
There were implemented write and read operation but they are extremely limited.
Essentially, the driver doesn't allow direct read or write thus we just inform a userspace application to use IOCTL instead.
The IOCTLs Implemented allow to get access to the raw accelerometer data, a statistic related to IRQ handling.
Also, these IOCTLs allow writing and reading to/from any register in IC directly.

Aleksandr Androsov added 8 commits January 18, 2019 00:11
As a base we took a driver from lesson 11.

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
In order to have access from user-space we implement
a char device interface which allocates /dev/accel device

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Just to inform a user that the device
doesn't support a read operation we print
a message to use IOCTL instead.

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Since the driver doesn't allow any input parameter
we just return EFAULT.

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
To be able to get acces to the device we
have implemented a user space application which
interacts with the driver via read/write operations
an IOCTLs.

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
application

Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants