• Ooi, Joyce's avatar
    iio: magnetometer: separate the values of attributes based on their usage type... · 6f771d0b
    Ooi, Joyce authored
    iio: magnetometer: separate the values of attributes based on their usage type for HID compass sensor
    
    There are 2 usage types (Magnetic Flux and Heading data field) for HID
    compass sensor, thus the values of offset, scale, and sensitivity should
    be separated according to their respective usage type. The changes made
    are as below:
    1. Hysteresis: A struct hid_sensor_common rot_attributes is created in
    struct magn_3d_state to contain the sensitivity for IIO_ROT.
    2. Scale: scale_pre_decml and scale_post_decml are separated for IIO_MAGN
    and IIO_ROT.
    3. Offset: Same as scale, value_offset is separated for IIO_MAGN and
    IIO_ROT.
    
    For sensitivity, HID_USAGE_SENSOR_ORIENT_MAGN_FLUX and
    HID_USAGE_SENSOR_ORIENT_MAGN_HEADING are used for sensivitity fields based
    on the HID Sensor Usages specifications. Hence, these changes are added on
    the sensitivity field.
    Signed-off-by: default avatarOoi, Joyce <joyce.ooi@intel.com>
    Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    6f771d0b
hid-sensor-magn-3d.c 17.2 KB