879
Comment: add IIO cleanup small tasks
|
2045
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= IIO staging cleanup = | ## page was renamed from IIO cleanup |
Line 3: | Line 3: |
''Mentors:'' [http://kernelnewbies.org/OctavianPurdila Octavian Purdila], [http://kernelnewbies.org/DanielBaluta Daniel Baluta] | ''This page is work in progress, I will remove this message when done. Then you can start working on tasks'' |
Line 5: | Line 5: |
== checkpatch.pl cleanups == | These tasks are for you to get familiar with the IIO subsystem. |
Line 7: | Line 7: |
Use `scripts/checkpatch.pl` to align code in `staging/drivers/iio` to Linux kernel coding style. | = Experimenting with IIO subsystem = |
Line 9: | Line 9: |
* accel/ * status: not assigned * adc/ * status: not assigned * addac/ * status: not assigned * cdc/ * status: '''clean''' * frequency/ * status: not assigned * gyro/ * status: '''clean''' * impedance-analyzer/ * status: '''clean''' * light/ * status: not assigned * magnetometer/ * status: not assigned * meter/ * status: not assigned * resolver/ * status: '''clean''' * trigger/ * status: not assigned |
For this we will use two kernel modules found in {{{drivers/staging/iio}}}: |
Line 34: | Line 11: |
Please send us an email with the directory you want to work on. Please specify your full name and IRC handle. | * {{{iio_dummy_evgen.ko}}} - generates ''fake'' events interrupts to be used by the {{{iio_dummy}}} example driver * implementation for this module is in {{{iio_dummy_evgen.c}}} * {{{iio_dummy.ko}}} - example IIO driver to demonstrate existing functionality * core implementation can be found in {{{iio_simple_dummy.c}}} * buffer functionality is implemented in {{{iio_simple_dummy_buffer.c}}} * events functionality is implemented in {{{iio_simple_dummy_events.c}}} == Dummy modules compilation == You need to select the following config options: * {{{CONFIG_IIO_DUMMY_EVGEN}}} - for building {{{iio_dummy_evgen}}} kernel module * {{{CONFIG_IIO_SIMPLE_DUMMY}}} - for building {{{iio_dummy}}} kernel module * {{{CONFIG_IIO_SIMPLE_DUMMY_EVENTS}}}, {{{CONFIG_IIO_SIMPLE_DUMMY_BUFFER}}} should be selected for events and buffer functionality. Use the following commands for modules compilation: * {{{$ make drivers/staging/iio/iio_dummy_evgen.ko}}} * {{{$ make drivers/staging/iio/iio_dummy.ko}}} Use the following commands for module loading: * {{{$ insmod iio_dummy_evgen.ko}}} * {{{$ insmod iio_dummy.ko}}} Task 01: * Show that the modules were successfully loaded. * lsmod * ls -l /sys/bus/iio/devices/ * ls -l /sys/bus/iio/devices/iio:device0/ * ls -l /sys/bus/iio/devices/iio_evgen/ == IIO event monitor == IIO event monitor is an user space example application which reads events from IIO layer and pretty prints the results. Implementation can be found in {{{iio_event_monitor.c}}} under {{{tools/iio/}}}. [[BR]] Task 02: * compile {{{iio_event_monitor.c}}} to obtain an executable called {{{iio_event_monitor}}}. |
This page is work in progress, I will remove this message when done. Then you can start working on tasks
These tasks are for you to get familiar with the IIO subsystem.
Experimenting with IIO subsystem
For this we will use two kernel modules found in drivers/staging/iio:
iio_dummy_evgen.ko - generates fake events interrupts to be used by the iio_dummy example driver
implementation for this module is in iio_dummy_evgen.c
iio_dummy.ko - example IIO driver to demonstrate existing functionality
core implementation can be found in iio_simple_dummy.c
buffer functionality is implemented in iio_simple_dummy_buffer.c
events functionality is implemented in iio_simple_dummy_events.c
Dummy modules compilation
You need to select the following config options:
CONFIG_IIO_DUMMY_EVGEN - for building iio_dummy_evgen kernel module
CONFIG_IIO_SIMPLE_DUMMY - for building iio_dummy kernel module
CONFIG_IIO_SIMPLE_DUMMY_EVENTS, CONFIG_IIO_SIMPLE_DUMMY_BUFFER should be selected for events and buffer functionality.
Use the following commands for modules compilation:
$ make drivers/staging/iio/iio_dummy_evgen.ko
$ make drivers/staging/iio/iio_dummy.ko
Use the following commands for module loading:
$ insmod iio_dummy_evgen.ko
$ insmod iio_dummy.ko
Task 01:
- Show that the modules were successfully loaded.
- lsmod
- ls -l /sys/bus/iio/devices/
- ls -l /sys/bus/iio/devices/iio:device0/
- ls -l /sys/bus/iio/devices/iio_evgen/
IIO event monitor
IIO event monitor is an user space example application which reads events from IIO layer and pretty prints the results. Implementation can be found in iio_event_monitor.c under tools/iio/. BR
Task 02:
compile iio_event_monitor.c to obtain an executable called iio_event_monitor.