diff options
| author | Eric Tashakkor <w36098@motorola.com> | 2014-05-09 14:19:31 -0500 |
|---|---|---|
| committer | Heather Lee Wilson <hwilson@google.com> | 2014-05-12 13:19:36 -0700 |
| commit | 09f2540f8b92c98f0c8a288ea270051070527b69 (patch) | |
| tree | f792fecc041b4985a45b92c371f117e47070875e /drivers/misc/m4sensorhub_pedometer.c | |
| parent | 0b5306046b7d96f6f641ae390048266639d92d5b (diff) | |
| download | olio-linux-3.10-09f2540f8b92c98f0c8a288ea270051070527b69.tar.xz olio-linux-3.10-09f2540f8b92c98f0c8a288ea270051070527b69.zip | |
IKXCLOCK-1224 Update M4 Memory Map and Drivers
Updated M4 memory map based on pending firmware.
Updated the heartrate driver to use new M4 names and interrupt.
Updated the passive driver to pull new data.
Updated the pedometer driver to pull different data and use updated sizes.
Fixed an IIO-related bug in the passive driver.
Change-Id: I96d6a248fc393dfd5d5b0b8b0a00931e3be7bed9
Signed-off-by: Eric Tashakkor <w36098@motorola.com>
Diffstat (limited to 'drivers/misc/m4sensorhub_pedometer.c')
| -rw-r--r-- | drivers/misc/m4sensorhub_pedometer.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/misc/m4sensorhub_pedometer.c b/drivers/misc/m4sensorhub_pedometer.c index 68b2299e1ac..87fd15be3f3 100644 --- a/drivers/misc/m4sensorhub_pedometer.c +++ b/drivers/misc/m4sensorhub_pedometer.c @@ -74,8 +74,8 @@ static int m4ped_read_report_data(struct iio_dev *iio, } size = m4sensorhub_reg_getsize(dd->m4, - M4SH_REG_PEDOMETER_TOTATDISTANCE); - err = m4sensorhub_reg_read(dd->m4, M4SH_REG_PEDOMETER_TOTATDISTANCE, + M4SH_REG_PEDOMETER_TOTALDISTANCE); + err = m4sensorhub_reg_read(dd->m4, M4SH_REG_PEDOMETER_TOTALDISTANCE, (char *)&(dd->iiodat.total_distance)); if (err < 0) { m4ped_err("%s: Failed to read total_distance data.\n", @@ -115,17 +115,16 @@ static int m4ped_read_report_data(struct iio_dev *iio, goto m4ped_read_fail; } - size = m4sensorhub_reg_getsize(dd->m4, - M4SH_REG_PEDOMETER_FLOORSCLIMBED); - err = m4sensorhub_reg_read(dd->m4, M4SH_REG_PEDOMETER_FLOORSCLIMBED, - (char *)&(dd->iiodat.floors_climbed)); + size = m4sensorhub_reg_getsize(dd->m4, M4SH_REG_METS_HEALTHYMINUTES); + err = m4sensorhub_reg_read(dd->m4, M4SH_REG_METS_HEALTHYMINUTES, + (char *)&(dd->iiodat.healthy_minutes)); if (err < 0) { - m4ped_err("%s: Failed to read floors_climbed data.\n", + m4ped_err("%s: Failed to read healthy_minutes data.\n", __func__); goto m4ped_read_fail; } else if (err != size) { m4ped_err("%s: Read %d bytes instead of %d for %s.\n", - __func__, err, size, "floors_climbed"); + __func__, err, size, "healthy_minutes"); err = -EBADE; goto m4ped_read_fail; } @@ -301,12 +300,12 @@ static ssize_t m4ped_iiodata_show(struct device *dev, mutex_lock(&(dd->mutex)); size = snprintf(buf, PAGE_SIZE, - "%s%hhu\n%s%u\n%s%hu\n%s%u\n%s%hu\n%s%u\n", + "%s%hhu\n%s%u\n%s%u\n%s%hu\n%s%u\n%s%u\n", "ped_activity: ", dd->iiodat.ped_activity, "total_distance: ", dd->iiodat.total_distance, "total_steps: ", dd->iiodat.total_steps, "current_speed: ", dd->iiodat.current_speed, - "floors_climbed: ", dd->iiodat.floors_climbed, + "healthy_minutes: ", dd->iiodat.healthy_minutes, "calories: ", dd->iiodat.calories); mutex_unlock(&(dd->mutex)); return size; |