Hero work: Saved HMC5843 from Staging

Hi !

Recently I have done some work to solve issues of driver HMC5843 in order to move it from staging directory to the main tree.

This is HMC5843:

hmc

HMC5843 is a Honeywell triple-axis digital compass, that already had a driver in the staging directory. The staging directory contains drivers that are incomplete or unstable or simply do not comply with the standard. My task was to figure out why HMC5843 driver was still in staging and solve its issues.

The driver provides support for both I2C and SPI protocols but the sensor I used communicates on I2C, so the setup was very similar to the one of the previous driver, TH06.

20160310_115349

20160310_115237

This sensor has a hardware particularity: it generates a bias current, namely a correction DC current that sets the direction of the magnetic field on X, Y, Z axis. The driver declared a non-standard attribute for configuring this bias current but I switched the implementation to the standard kernel ABI and added an extra attribute to present the available configurations for it. Also, the driver supports a family of sensors not only HMC5843 and there was a particular value that was valid for one sensor but invalid for the rest of them and the driver was rejecting it as invalid for all of them. Moreover, I added documentation for the newly added attributes. Another issue was that implementations of functions suspend and resume were switched and the sensor was put in the complementary state when these functions were called.

All patches got accepted and you can review them. Check the patches that start with iio:hmc5843 from the list.

It’s true that hero work is tough but somebody has to do it. Until next time ! 🙂

knight

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s