Skip to content

Commit 2861be4

Browse files
gwendalcrEnric Balletbo i Serra
authored andcommitted
iio: cros_ec: Remove pm function
Since cros_ec_sensorhub is shutting down the FIFO when the device suspends, no need to slow down the EC sampling period rate. It was necesseary to do that before command CMD_FIFO_INT_ENABLE was introduced, but now all supported chromebooks have it. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
1 parent aa984f1 commit 2861be4

File tree

5 files changed

+0
-55
lines changed

5 files changed

+0
-55
lines changed

drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ MODULE_DEVICE_TABLE(platform, cros_ec_lid_angle_ids);
127127
static struct platform_driver cros_ec_lid_angle_platform_driver = {
128128
.driver = {
129129
.name = DRV_NAME,
130-
.pm = &cros_ec_sensors_pm_ops,
131130
},
132131
.probe = cros_ec_lid_angle_probe,
133132
.id_table = cros_ec_lid_angle_ids,

drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ MODULE_DEVICE_TABLE(platform, cros_ec_sensors_ids);
314314
static struct platform_driver cros_ec_sensors_platform_driver = {
315315
.driver = {
316316
.name = "cros-ec-sensors",
317-
.pm = &cros_ec_sensors_pm_ops,
318317
},
319318
.probe = cros_ec_sensors_probe,
320319
.id_table = cros_ec_sensors_ids,

drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -738,52 +738,5 @@ int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
738738
}
739739
EXPORT_SYMBOL_GPL(cros_ec_sensors_core_write);
740740

741-
static int __maybe_unused cros_ec_sensors_prepare(struct device *dev)
742-
{
743-
struct iio_dev *indio_dev = dev_get_drvdata(dev);
744-
struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
745-
746-
if (st->curr_sampl_freq == 0)
747-
return 0;
748-
749-
/*
750-
* If the sensors are sampled at high frequency, we will not be able to
751-
* sleep. Set sampling to a long period if necessary.
752-
*/
753-
if (st->curr_sampl_freq < CROS_EC_MIN_SUSPEND_SAMPLING_FREQUENCY) {
754-
mutex_lock(&st->cmd_lock);
755-
st->param.cmd = MOTIONSENSE_CMD_EC_RATE;
756-
st->param.ec_rate.data = CROS_EC_MIN_SUSPEND_SAMPLING_FREQUENCY;
757-
cros_ec_motion_send_host_cmd(st, 0);
758-
mutex_unlock(&st->cmd_lock);
759-
}
760-
return 0;
761-
}
762-
763-
static void __maybe_unused cros_ec_sensors_complete(struct device *dev)
764-
{
765-
struct iio_dev *indio_dev = dev_get_drvdata(dev);
766-
struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
767-
768-
if (st->curr_sampl_freq == 0)
769-
return;
770-
771-
if (st->curr_sampl_freq < CROS_EC_MIN_SUSPEND_SAMPLING_FREQUENCY) {
772-
mutex_lock(&st->cmd_lock);
773-
st->param.cmd = MOTIONSENSE_CMD_EC_RATE;
774-
st->param.ec_rate.data = st->curr_sampl_freq;
775-
cros_ec_motion_send_host_cmd(st, 0);
776-
mutex_unlock(&st->cmd_lock);
777-
}
778-
}
779-
780-
const struct dev_pm_ops cros_ec_sensors_pm_ops = {
781-
#ifdef CONFIG_PM_SLEEP
782-
.prepare = cros_ec_sensors_prepare,
783-
.complete = cros_ec_sensors_complete
784-
#endif
785-
};
786-
EXPORT_SYMBOL_GPL(cros_ec_sensors_pm_ops);
787-
788741
MODULE_DESCRIPTION("ChromeOS EC sensor hub core functions");
789742
MODULE_LICENSE("GPL v2");

drivers/iio/light/cros_ec_light_prox.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ MODULE_DEVICE_TABLE(platform, cros_ec_light_prox_ids);
255255
static struct platform_driver cros_ec_light_prox_platform_driver = {
256256
.driver = {
257257
.name = "cros-ec-light-prox",
258-
.pm = &cros_ec_sensors_pm_ops,
259258
},
260259
.probe = cros_ec_light_prox_probe,
261260
.id_table = cros_ec_light_prox_ids,

include/linux/iio/common/cros_ec_sensors_core.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ enum {
3030
*/
3131
#define CROS_EC_SAMPLE_SIZE (sizeof(s64) * 2)
3232

33-
/* Minimum sampling period to use when device is suspending */
34-
#define CROS_EC_MIN_SUSPEND_SAMPLING_FREQUENCY 1000 /* 1 second */
35-
3633
typedef irqreturn_t (*cros_ec_sensors_capture_t)(int irq, void *p);
3734

3835
/**
@@ -117,8 +114,6 @@ int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
117114
struct iio_chan_spec const *chan,
118115
int val, int val2, long mask);
119116

120-
extern const struct dev_pm_ops cros_ec_sensors_pm_ops;
121-
122117
/* List of extended channel specification for all sensors */
123118
extern const struct iio_chan_spec_ext_info cros_ec_sensors_ext_info[];
124119

0 commit comments

Comments
 (0)