Size: 879
Comment: add IIO cleanup small tasks
|
Size: 4296
Comment:
|
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] | These tasks are for you to get familiar with the IIO subsystem. You do not need to claim these via the Outreachy tasks page. For IIO related questions you can join #linux-iio IRC channel (server irc.oftc.net). |
Line 5: | Line 5: |
== checkpatch.pl cleanups == | Please email your solutions to amsfield22 at gmail dot com and daniel.baluta at gmail dot com. Your email should have the subject '''Task XX: Short task description''' |
Line 7: | Line 8: |
Use `scripts/checkpatch.pl` to align code in `staging/drivers/iio` to Linux kernel coding style. | = Experimenting with IIO subsystem = |
Line 9: | Line 10: |
* 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/iio/dummy}}}: |
Line 34: | Line 12: |
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. * {{{CONFIG_IIO_CONFIGFS}}} - for creating the dummy device under configfs * read Documentation/iio/iio_configfs.txt to see how to mount the configfs filesystem Use the following commands for modules compilation: * {{{$ make drivers/iio/dummy/iio_dummy_evgen.ko}}} * {{{$ make drivers/iio/dummy/iio_dummy.ko}}} Use the following commands for module loading: * {{{$ insmod iio_dummy_evgen.ko}}} * {{{$ insmod iio_dummy.ko}}} Use the following command to create your dummy device under the configfs filesystem: * {{{$ mkdir /config/iio/devices/dummy/my_dummy_device}}} Task 01: * Show that the modules were successfully loaded. * lsmod | grep dummy * ls -l /config/iio/devices/dummy/ * ls -l /sys/bus/iio/devices/iio_evgen/ Task 02: * Add channels for a 3-axis compass to iio_simple_dummy module. * Show that channels were successfully added * ls -l /sys/bus/iio/devices/iio:device0/ * ls -l /sys/bus/iio/devices/iio:device0/scan_elements * create a patch with your changes * '''Hints''': * channel type for a compass is IIO_MAGN * users should be able to read raw readings from each axis * users should be able to read a shared scale * users should be able to access data via a buffer * data is unsigned, resolution is 16 bits, storage is 16 bits * compass doesn't support events == 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 03: Compile iio_event_monitor: * compile {{{iio_event_monitor.c}}} to obtain an executable called {{{iio_event_monitor}}}. * send us the command(s) used to successfully compile iio_event_monitor.c Task 04: Read events using iio_event_monitor * run iio_event_monitor without arguments to figure out how it should be used * read events from iio_dummy module * '''Hints''' * Events are generated by iio_dummy_evgen via sysfs (look inside /sys/bus/iio/devices/iio_evgen/) * send us the commands used to read/generate the events == Generic buffer == Task 05: Create triggers using configfs interface. * read Documentation/iio/iio_configfs.txt in order to create a software trigger named t1. * where in the sysfs hierarchy does the trigger resides? * sends us the commands used to create the trigger Task 06: Read samples from buffer generated by the iio_dummy module. * compile iio_generic_buffer.c from tools/iio. This program will be used to read data from buffer. * have a look at ./iio_generic_buffer -h options. You will use the trigger ''t1'' created with the previous tasks and ''iio_dummy_part_no'' for IIO device. * send us the full command history |
These tasks are for you to get familiar with the IIO subsystem. You do not need to claim these via the Outreachy tasks page. For IIO related questions you can join #linux-iio IRC channel (server irc.oftc.net).
Please email your solutions to amsfield22 at gmail dot com and daniel.baluta at gmail dot com. Your email should have the subject Task XX: Short task description
Experimenting with IIO subsystem
For this we will use two kernel modules found in drivers/iio/dummy:
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.
CONFIG_IIO_CONFIGFS - for creating the dummy device under configfs
- read Documentation/iio/iio_configfs.txt to see how to mount the configfs filesystem
Use the following commands for modules compilation:
$ make drivers/iio/dummy/iio_dummy_evgen.ko
$ make drivers/iio/dummy/iio_dummy.ko
Use the following commands for module loading:
$ insmod iio_dummy_evgen.ko
$ insmod iio_dummy.ko
Use the following command to create your dummy device under the configfs filesystem:
$ mkdir /config/iio/devices/dummy/my_dummy_device
Task 01:
- Show that the modules were successfully loaded.
- lsmod | grep dummy
- ls -l /config/iio/devices/dummy/
- ls -l /sys/bus/iio/devices/iio_evgen/
Task 02:
- Add channels for a 3-axis compass to iio_simple_dummy module.
- Show that channels were successfully added
- ls -l /sys/bus/iio/devices/iio:device0/
- ls -l /sys/bus/iio/devices/iio:device0/scan_elements
- create a patch with your changes
Hints:
- channel type for a compass is IIO_MAGN
- users should be able to read raw readings from each axis
- users should be able to read a shared scale
- users should be able to access data via a buffer
- data is unsigned, resolution is 16 bits, storage is 16 bits
- compass doesn't support events
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 03:
Compile iio_event_monitor:
compile iio_event_monitor.c to obtain an executable called iio_event_monitor.
- send us the command(s) used to successfully compile iio_event_monitor.c
Task 04:
Read events using iio_event_monitor
- run iio_event_monitor without arguments to figure out how it should be used
- read events from iio_dummy module
Hints
- Events are generated by iio_dummy_evgen via sysfs (look inside /sys/bus/iio/devices/iio_evgen/)
- send us the commands used to read/generate the events
Generic buffer
Task 05:
Create triggers using configfs interface.
- read Documentation/iio/iio_configfs.txt in order to create a software trigger named t1.
- where in the sysfs hierarchy does the trigger resides?
- sends us the commands used to create the trigger
Task 06:
Read samples from buffer generated by the iio_dummy module.
- compile iio_generic_buffer.c from tools/iio. This program will be used to read data from buffer.
have a look at ./iio_generic_buffer -h options. You will use the trigger t1 created with the previous tasks and iio_dummy_part_no for IIO device.
- send us the full command history