> This driver spends 100 milliseconds to wait for chip data ready every
> time when resuming the chip. It will impact the performance of
> sensorfw. So, I add the autosuspend function can keep the chip awake
> during the period of its data reading. The driver will suspend when
> the gyro data is not read after the autosuspend_delay.

Ok

> -     if (mpu3050_get_power_mode(sensor->client))
> +     if (sensor->is_suspended && !sensor->rpm_resume_is_used) {
>               pm_runtime_get_sync(dev);
> +             sensor->rpm_resume_is_used = 1;
> +     }

Do you actually need to track this - won't always doing
pm_runtime_get_sync()/pm_runtime_put_sync_autosuspend() also do the
right thing anyway ?

> @@ -212,7 +223,10 @@
>  static int mpu3050_input_open(struct input_dev *input)
>  {
>       struct mpu3050_sensor *sensor = input_get_drvdata(input);
> -     pm_runtime_get(sensor->dev);
> +     if (sensor->is_suspended && !sensor->rpm_resume_is_used) {
> +             pm_runtime_get(sensor->dev);
> +             sensor->rpm_resume_is_used = 1;
> +     }

And if you do need to do all that work then you have no looking between
parallel input device open and sysfs changes to is_suspended or
rpm_resume_is_used ?


> -     pm_runtime_set_active(&client->dev);
> -
>       ret = mpu3050_register_input_device(sensor);

I had the order of these the way they were before as in theory you
could open the input device as soon as register_input_device is called
so before pm_runtime_set_active occurred...


Alan
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to