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:
parent
7da98a47a6
commit
966118ee18
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue