KernelNewbies:

These tasks are for you to get familiar with the IIO subsystem. For IIO related questions you can join #linux-iio IRC channel (server irc.oftc.net).

Please email your solutions to daniel.baluta at intel 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/staging/iio:

Dummy modules compilation

You need to select the following config options:

Use the following commands for modules compilation:

Use the following commands for module loading:

Task 01:

Task 02:

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:

Task 04:

Read events using iio_event_monitor

Generic buffer

Task 05:

Create triggers using configfs interface.

Task 06:

Read samples from buffer generated by the iio_dummy module.

Small coding tasks inside the IIO subsystem

Before starting to work on a task make sure that:

Coding task 1:

--- a/drivers/iio/pressure/bmp280.c
+++ b/drivers/iio/pressure/bmp280.c
@@ -69,7 +69,6 @@
 #define BMP280_SOFT_RESET_VAL          0xB6
 
 struct bmp280_data {
-       struct i2c_client *client;
        struct mutex lock;
        struct regmap *regmap;
 
@@ -150,11 +149,12 @@ static s32 bmp280_compensate_temp(struct bmp280_data *data,
        int ret;
        s32 var1, var2;
        __le16 buf[BMP280_COMP_TEMP_REG_COUNT / 2];
+       struct device *dev = regmap_get_device(data->regmap);
 
        ret = regmap_bulk_read(data->regmap, BMP280_REG_COMP_TEMP_START,
                               buf, BMP280_COMP_TEMP_REG_COUNT);
        if (ret < 0) {
-               dev_err(&data->client->dev,
+               dev_err(&dev,
                        "failed to read temperature calibration parameters\n");
                return ret;
        }

KernelNewbies: IIO_tasks (last edited 2016-02-08 15:47:34 by DanielBaluta)