summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wylder <jwylder@motorola.com>2014-08-10 11:25:48 -0500
committerJames Wylder <jwylder@motorola.com>2014-08-10 18:06:44 +0000
commit1783f64df065fd7496bce680485b1c4259fe372f (patch)
tree418e8727c251ce97e17d2b3f7f521900b84392aa
parentaf33de0af5b5803582d572f36a942b031c86540f (diff)
downloadolio-linux-3.10-1783f64df065fd7496bce680485b1c4259fe372f.tar.xz
olio-linux-3.10-1783f64df065fd7496bce680485b1c4259fe372f.zip
IKXCLOCK-3468 m4sensorhub: Use freezable workqueue
The update of the sensorhub to use polling was based on the belief that the workqueue would be frozen before suspend and thawed afterwards. Unfortunately the system_wq used by schedule_delayed_work, is not freezable. Update the changes to use the system_freezable_wq. Change-Id: Ib759664a5bc61dad72207f59d2c8c672cd0f7c9b Signed-off-by: Jim Wylder <jwylder@motorola.com>
-rw-r--r--drivers/misc/m4sensorhub_als.c6
-rw-r--r--drivers/misc/m4sensorhub_fusion.c6
-rw-r--r--drivers/misc/m4sensorhub_heartrate.c6
-rw-r--r--drivers/misc/m4sensorhub_mpu9150.c25
-rw-r--r--drivers/misc/m4sensorhub_pedometer.c12
5 files changed, 30 insertions, 25 deletions
diff --git a/drivers/misc/m4sensorhub_als.c b/drivers/misc/m4sensorhub_als.c
index 84cb2ee8cfa..3f61edefff2 100644
--- a/drivers/misc/m4sensorhub_als.c
+++ b/drivers/misc/m4sensorhub_als.c
@@ -84,7 +84,7 @@ static void m4als_work_func(struct work_struct *work)
input_event(dd->indev, EV_MSC, MSC_RAW, dd->luminosity);
input_sync(dd->indev);
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4als_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4als_work),
msecs_to_jiffies(dd->samplerate));
m4als_isr_fail:
@@ -133,7 +133,7 @@ static int m4als_set_samplerate(struct m4als_driver_data *dd, int16_t rate)
cancel_delayed_work(&(dd->m4als_work));
dd->samplerate = rate;
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4als_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4als_work),
msecs_to_jiffies(rate));
m4als_set_samplerate_fail:
@@ -286,7 +286,7 @@ static void m4als_panic_restore(struct m4sensorhub_data *m4sensorhub,
}
cancel_delayed_work(&(dd->m4als_work));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4als_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4als_work),
msecs_to_jiffies(dd->samplerate));
mutex_unlock(&(dd->mutex));
}
diff --git a/drivers/misc/m4sensorhub_fusion.c b/drivers/misc/m4sensorhub_fusion.c
index f1ce277f2fe..e1330f56263 100644
--- a/drivers/misc/m4sensorhub_fusion.c
+++ b/drivers/misc/m4sensorhub_fusion.c
@@ -133,7 +133,7 @@ static void m4fus_work_func(struct work_struct *work)
*/
iio_push_to_buffers(iio, (unsigned char *)&(dd->iiodat[0]));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4fus_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4fus_work),
msecs_to_jiffies(dd->samplerate));
m4fus_isr_fail:
@@ -174,7 +174,7 @@ static int m4fus_set_samplerate(struct iio_dev *iio, int16_t rate)
dd->samplerate = rate;
cancel_delayed_work(&(dd->m4fus_work));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4fus_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4fus_work),
msecs_to_jiffies(rate));
m4fus_set_samplerate_fail:
@@ -372,7 +372,7 @@ static void m4fus_panic_restore(struct m4sensorhub_data *m4sensorhub,
cancel_delayed_work(&(dd->m4fus_work));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4fus_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4fus_work),
msecs_to_jiffies(dd->samplerate));
mutex_unlock(&(dd->mutex));
}
diff --git a/drivers/misc/m4sensorhub_heartrate.c b/drivers/misc/m4sensorhub_heartrate.c
index 01fc5f210b7..02327cbc958 100644
--- a/drivers/misc/m4sensorhub_heartrate.c
+++ b/drivers/misc/m4sensorhub_heartrate.c
@@ -95,7 +95,7 @@ static void m4hrt_work_func(struct work_struct *work)
dd->iiodat.timestamp = iio_get_time_ns();
iio_push_to_buffers(iio, (unsigned char *)&(dd->iiodat));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4hrt_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4hrt_work),
msecs_to_jiffies(dd->samplerate));
m4hrt_isr_fail:
@@ -137,7 +137,7 @@ static int m4hrt_set_samplerate(struct iio_dev *iio, int32_t rate)
cancel_delayed_work(&(dd->m4hrt_work));
dd->samplerate = rate;
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4hrt_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4hrt_work),
msecs_to_jiffies(dd->samplerate));
m4hrt_set_samplerate_fail:
return err;
@@ -491,7 +491,7 @@ static void m4hrt_panic_restore(struct m4sensorhub_data *m4sensorhub,
}
cancel_delayed_work(&(dd->m4hrt_work));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4hrt_work),
+ queue_delayed_work(system_freezable_wq, &(dd->m4hrt_work),
msecs_to_jiffies(dd->samplerate));
mutex_unlock(&(dd->mutex));
}
diff --git a/drivers/misc/m4sensorhub_mpu9150.c b/drivers/misc/m4sensorhub_mpu9150.c
index 52de21885d4..55d160bc607 100644
--- a/drivers/misc/m4sensorhub_mpu9150.c
+++ b/drivers/misc/m4sensorhub_mpu9150.c
@@ -178,8 +178,9 @@ static void m4_set_mpu9150_delay(struct mpu9150_client *mpu9150_client_data,
cancel_delayed_work(&(dd->mpu9150_work[type]));
dd->samplerate[type] = delay;
if (dd->samplerate[type] > 0)
- schedule_delayed_work(&(dd->mpu9150_work[type]),
- msecs_to_jiffies(delay));
+ queue_delayed_work(system_freezable_wq,
+ &(dd->mpu9150_work[type]),
+ msecs_to_jiffies(delay));
}
}
@@ -250,8 +251,9 @@ static void m4gyro_work_func(struct work_struct *work)
m4_report_mpu9150_inputevent(dd, TYPE_GYRO);
rate = dd->samplerate[TYPE_GYRO];
if (rate > 0)
- schedule_delayed_work(&(dd->mpu9150_work[TYPE_GYRO]),
- msecs_to_jiffies(rate));
+ queue_delayed_work(system_freezable_wq,
+ &(dd->mpu9150_work[TYPE_GYRO]),
+ msecs_to_jiffies(rate));
mutex_unlock(&(dd->mutex));
}
@@ -269,8 +271,9 @@ static void m4accel_work_func(struct work_struct *work)
m4_report_mpu9150_inputevent(dd, TYPE_ACCEL);
rate = dd->samplerate[TYPE_ACCEL];
if (rate > 0)
- schedule_delayed_work(&(dd->mpu9150_work[TYPE_ACCEL]),
- msecs_to_jiffies(rate));
+ queue_delayed_work(system_freezable_wq,
+ &(dd->mpu9150_work[TYPE_ACCEL]),
+ msecs_to_jiffies(rate));
mutex_unlock(&(dd->mutex));
}
@@ -287,8 +290,9 @@ static void m4compass_work_func(struct work_struct *work)
m4_report_mpu9150_inputevent(dd, TYPE_COMPASS);
rate = dd->samplerate[TYPE_COMPASS];
if (rate > 0)
- schedule_delayed_work(&(dd->mpu9150_work[TYPE_COMPASS]),
- msecs_to_jiffies(rate));
+ queue_delayed_work(system_freezable_wq,
+ &(dd->mpu9150_work[TYPE_COMPASS]),
+ msecs_to_jiffies(rate));
mutex_unlock(&(dd->mutex));
}
@@ -567,8 +571,9 @@ static void mpu9150_panic_restore(struct m4sensorhub_data *m4sensorhub,
m4_set_mpu9150_delay(dd, rate, type);
cancel_delayed_work(&(dd->mpu9150_work[type]));
if (rate > 0)
- schedule_delayed_work(&(dd->mpu9150_work[type]),
- msecs_to_jiffies(rate));
+ queue_delayed_work(system_freezable_wq,
+ &(dd->mpu9150_work[type]),
+ msecs_to_jiffies(rate));
}
mutex_unlock(&(dd->mutex));
}
diff --git a/drivers/misc/m4sensorhub_pedometer.c b/drivers/misc/m4sensorhub_pedometer.c
index 56b2d912f7a..cf326454bea 100644
--- a/drivers/misc/m4sensorhub_pedometer.c
+++ b/drivers/misc/m4sensorhub_pedometer.c
@@ -175,8 +175,8 @@ static void m4ped_work_func(struct work_struct *work)
if (err < 0)
m4ped_err("%s: Failed with error code %d.\n", __func__, err);
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4ped_work),
- msecs_to_jiffies(dd->samplerate));
+ queue_delayed_work(system_freezable_wq, &(dd->m4ped_work),
+ msecs_to_jiffies(dd->samplerate));
mutex_unlock(&(dd->mutex));
return;
}
@@ -195,8 +195,8 @@ static int m4ped_set_samplerate(struct iio_dev *iio, int16_t rate)
cancel_delayed_work(&(dd->m4ped_work));
dd->samplerate = rate;
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4ped_work),
- msecs_to_jiffies(rate));
+ queue_delayed_work(system_freezable_wq, &(dd->m4ped_work),
+ msecs_to_jiffies(dd->samplerate));
m4ped_set_samplerate_fail:
return err;
}
@@ -633,8 +633,8 @@ static void m4ped_panic_restore(struct m4sensorhub_data *m4sensorhub,
}
cancel_delayed_work(&(dd->m4ped_work));
if (dd->samplerate > 0)
- schedule_delayed_work(&(dd->m4ped_work),
- msecs_to_jiffies(dd->samplerate));
+ queue_delayed_work(system_freezable_wq, &(dd->m4ped_work),
+ msecs_to_jiffies(dd->samplerate));
m4ped_panic_restore_fail:
mutex_unlock(&(dd->mutex));