]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iio: hmc5843: Add attributes for measurement config of bias current
authorCristina Moraru <cristina.moraru09@gmail.com>
Sun, 14 Feb 2016 22:37:37 +0000 (00:37 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 21 Feb 2016 20:22:21 +0000 (20:22 +0000)
commit1c7be4c260e52deeb2ec3cb22d57e5c997932fc2
tree6c304ddc91323a1620c3555318e68af2a601de69
parent0d43b3468871f5d5194edfe7052b6a49691eb6fd
iio: hmc5843: Add attributes for measurement config of bias current

Change static attribute meas_conf for bias current configuration
to channel attribute in_magn_meas_conf and also add
in_magn_meas_conf_available attribute to view available configurations.

This patch solves functionality bug: driver was using same function
hmc5843_set_measurement_configuration for setting bias current config
for all device types but the function was returning -EINVAL for any
setting >= 0x03 although, for sensor HMC5983, value 3 is valid.

API for setting bias measurement configuration:

normal -  Normal measurement configuration (default):
In normal measurement configuration the device
follows normal measurement flow. Pins BP and BN
are left floating and high impedance.

positivebias -  Positive bias configuration: In positive bias
configuration, a positive current is forced across
the resistive load on pins BP and BN.

negativebias -  Negative bias configuration. In negative bias
configuration, a negative current is forced across
the resistive load on pins BP and BN.

disabled     -  Only available on HMC5983. Magnetic sensor is disabled.
Temperature sensor is enabled.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/magnetometer/hmc5843_core.c