sensor: hmc5883l: fix data sample axis order

The data sample registers are ordered as X, Z, Y (not X, Y, Z), so the
driver also needs to extract the sample components in this order.

Jira: ZEP-679

Change-Id: I317994bb545539b049e2ebf3d2af94e63c7d2511
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
This commit is contained in:
Bogdan Davidoaia 2016-08-11 11:35:35 +03:00 committed by Inaky Perez-Gonzalez
commit 966118ee18

View file

@ -74,8 +74,8 @@ static int hmc5883l_sample_fetch(struct device *dev, enum sensor_channel chan)
}
drv_data->x_sample = sys_be16_to_cpu(buf[0]);
drv_data->y_sample = sys_be16_to_cpu(buf[1]);
drv_data->z_sample = sys_be16_to_cpu(buf[2]);
drv_data->z_sample = sys_be16_to_cpu(buf[1]);
drv_data->y_sample = sys_be16_to_cpu(buf[2]);
return 0;
}