Mag sample rate was not actually changed by an ioctl

This commit is contained in:
Julian Oes
2013-04-09 23:34:19 +02:00
committed by Lorenz Meier
parent eb3d6f228c
commit 1d327c42a6
+4 -3
View File
@@ -718,7 +718,7 @@ LSM303D::mag_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSOR_POLLRATE_MAX: case SENSOR_POLLRATE_MAX:
case SENSOR_POLLRATE_DEFAULT: case SENSOR_POLLRATE_DEFAULT:
/* 50 Hz is max for mag */ /* 50 Hz is max for mag */
return mag_ioctl(filp, SENSORIOCSPOLLRATE, 50); return mag_ioctl(filp, SENSORIOCSPOLLRATE, 100);
/* adjust to a legal polling interval in Hz */ /* adjust to a legal polling interval in Hz */
default: { default: {
@@ -732,12 +732,13 @@ LSM303D::mag_ioctl(struct file *filp, int cmd, unsigned long arg)
if (ticks < 1000) if (ticks < 1000)
return -EINVAL; return -EINVAL;
/* adjust sample rate of sensor */
mag_set_samplerate(arg);
/* update interval for next measurement */ /* update interval for next measurement */
/* XXX this is a bit shady, but no other way to adjust... */ /* XXX this is a bit shady, but no other way to adjust... */
_mag_call.period = _call_mag_interval = ticks; _mag_call.period = _call_mag_interval = ticks;
/* if we need to start the poll state machine, do it */ /* if we need to start the poll state machine, do it */
if (want_start) if (want_start)
start(); start();