From: Sakari Ailus <sakari.ailus@linux.intel.com> Date: 2016-11-29 17:28:58
Power on the sensor when the module is loaded and power it off when it is
removed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Alan and Laurent,
I hope this should be good then. I'm only enabling runtime PM at the end
of probe() when all is well, which reduces need for error handling.
Regards,
Sakari
drivers/media/i2c/smiapp/smiapp-core.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
Hi Sakari,
Thank you for the patch.
On Tuesday 29 Nov 2016 19:28:53 Sakari Ailus wrote:
quoted hunk
Power on the sensor when the module is loaded and power it off when it is
removed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Alan and Laurent,
I hope this should be good then. I'm only enabling runtime PM at the end
of probe() when all is well, which reduces need for error handling.
Regards,
Sakari
drivers/media/i2c/smiapp/smiapp-core.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
This looks better to me, although these 6 lines really call for a new helper
function.
However, I still believe a helper that calls the runtime PM handlers directly
when CONFIG_PM=n and rely on runtime PM when CONFIG_PM=y would be the cleanest
solution from a driver point of view.
From: Sakari Ailus <sakari.ailus@iki.fi> Date: 2016-11-30 11:30:09
Hi Laurent,
On Tue, Nov 29, 2016 at 07:35:17PM +0200, Laurent Pinchart wrote:
Hi Sakari,
Thank you for the patch.
On Tuesday 29 Nov 2016 19:28:53 Sakari Ailus wrote:
quoted
Power on the sensor when the module is loaded and power it off when it is
removed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Alan and Laurent,
I hope this should be good then. I'm only enabling runtime PM at the end
of probe() when all is well, which reduces need for error handling.
Regards,
Sakari
drivers/media/i2c/smiapp/smiapp-core.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
This looks better to me, although these 6 lines really call for a new helper
function.
They're somewhat unrelated, especially the autosuspend part. Few drivers use
it.
However, I still believe a helper that calls the runtime PM handlers directly
when CONFIG_PM=n and rely on runtime PM when CONFIG_PM=y would be the cleanest
solution from a driver point of view.
Good point.
The autosuspend must be explicitly disabled as well which wasn't previously
done. I'll add another patch for that.
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
From: Sakari Ailus <sakari.ailus@linux.intel.com> Date: 2016-11-30 16:11:42
Power on the sensor when the module is loaded and power it off when it is
removed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
since v2.1:
- Power off conditionally, i.e. only if the device was powered.
pm_runtime_status_suspended() returns false if CONFIG_PM is not set.
drivers/media/i2c/smiapp/smiapp-core.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)