linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451
@ 2016-03-14 11:26 Martin Kepplinger
  2016-03-14 11:26 ` [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep Martin Kepplinger
  2016-03-14 11:33 ` [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Kepplinger @ 2016-03-14 11:26 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw; +Cc: linux-iio, linux-kernel, Martin Kepplinger

This was forgotten about and is added for consistency now

Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 305ed0e..d0eeba0 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1535,6 +1535,7 @@ static const struct dev_pm_ops mma8452_pm_ops = {
 };
 
 static const struct i2c_device_id mma8452_id[] = {
+	{ "mma8451", mma8452 },
 	{ "mma8452", mma8452 },
 	{ "mma8453", mma8453 },
 	{ "mma8652", mma8652 },
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep
  2016-03-14 11:26 [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
@ 2016-03-14 11:26 ` Martin Kepplinger
  2016-03-15 22:07   ` Jonathan Cameron
  2016-03-14 11:33 ` [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Kepplinger @ 2016-03-14 11:26 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw; +Cc: linux-iio, linux-kernel, Martin Kepplinger

What is this autosleep?
-----------------------
It slows down the device after x seconds of inactivity. The thing is, we have
really achieved almost the same by runtime pm.

differnces are:

autosleep
 * uses more power during inactivity
 * the first read after inactivity slightly faster
 * complicated to understand for the user
 * no documented sysfs interface (afaik)
 * complicated to read and maintain

runtime pm
 * already merged in mma8452
 * uses less power during inactivity
 * first read after inactivity slower
 * easy to use. well documented.
 * easy to maintain and understand

The two approaches solve the same problem. runtime pm has more advantages
than autosleep and comes quite close to it's behaviour anyways. As I see it,
autosleep, even if somehow supported, would never be used anyways.

So resolve this issue by "ignoring" autosleep.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Reviewed-by: Martina Kepplinger <martina.novakovic@zoho.com>
---
 drivers/iio/accel/mma8452.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index d0eeba0..375e45f 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -17,7 +17,7 @@
  *
  * 7-bit I2C slave address 0x1c/0x1d (pin selectable)
  *
- * TODO: orientation events, autosleep
+ * TODO: orientation events
  */
 
 #include <linux/module.h>
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451
  2016-03-14 11:26 [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
  2016-03-14 11:26 ` [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep Martin Kepplinger
@ 2016-03-14 11:33 ` Martin Kepplinger
  2016-03-15 22:05   ` Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Kepplinger @ 2016-03-14 11:33 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw; +Cc: linux-iio, linux-kernel, Martin Kepplinger

This was forgotten about and is added for consistency now

Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
I'm sorry, I messed up the first patch. Understandable though, given
it's complexity.


 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 305ed0e..6aa2517 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1535,6 +1535,7 @@ static const struct dev_pm_ops mma8452_pm_ops = {
 };
 
 static const struct i2c_device_id mma8452_id[] = {
+	{ "mma8451", mma8451 },
 	{ "mma8452", mma8452 },
 	{ "mma8453", mma8453 },
 	{ "mma8652", mma8652 },
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451
  2016-03-14 11:33 ` [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
@ 2016-03-15 22:05   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2016-03-15 22:05 UTC (permalink / raw)
  To: Martin Kepplinger, knaack.h, lars, pmeerw; +Cc: linux-iio, linux-kernel

On 14/03/16 11:33, Martin Kepplinger wrote:
> This was forgotten about and is added for consistency now
> 
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
> I'm sorry, I messed up the first patch. Understandable though, given
> it's complexity.
Took me a disturbingly long time to notice what was wrong.

Applied to the togreg branch of iio.git - pushed out as testing
for the autobuilders to play with it.

Jonathan
> 
> 
>  drivers/iio/accel/mma8452.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 305ed0e..6aa2517 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1535,6 +1535,7 @@ static const struct dev_pm_ops mma8452_pm_ops = {
>  };
>  
>  static const struct i2c_device_id mma8452_id[] = {
> +	{ "mma8451", mma8451 },
>  	{ "mma8452", mma8452 },
>  	{ "mma8453", mma8453 },
>  	{ "mma8652", mma8652 },
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep
  2016-03-14 11:26 ` [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep Martin Kepplinger
@ 2016-03-15 22:07   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2016-03-15 22:07 UTC (permalink / raw)
  To: Martin Kepplinger, knaack.h, lars, pmeerw; +Cc: linux-iio, linux-kernel

On 14/03/16 11:26, Martin Kepplinger wrote:
> What is this autosleep?
> -----------------------
> It slows down the device after x seconds of inactivity. The thing is, we have
> really achieved almost the same by runtime pm.
> 
> differnces are:
> 
> autosleep
>  * uses more power during inactivity
>  * the first read after inactivity slightly faster
>  * complicated to understand for the user
>  * no documented sysfs interface (afaik)
>  * complicated to read and maintain
> 
> runtime pm
>  * already merged in mma8452
>  * uses less power during inactivity
>  * first read after inactivity slower
>  * easy to use. well documented.
>  * easy to maintain and understand
> 
> The two approaches solve the same problem. runtime pm has more advantages
> than autosleep and comes quite close to it's behaviour anyways. As I see it,
> autosleep, even if somehow supported, would never be used anyways.
> 
> So resolve this issue by "ignoring" autosleep.
> 
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> Reviewed-by: Martina Kepplinger <martina.novakovic@zoho.com>
A good detailed explanation + to be cynical, if anyone actually wants to implement
it and provide numbers showing it is the best thing since sliced bread - the absence
of a comment about it not being done isn't going to stop them!

Applied, thanks,

Jonathan
> ---
>  drivers/iio/accel/mma8452.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index d0eeba0..375e45f 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -17,7 +17,7 @@
>   *
>   * 7-bit I2C slave address 0x1c/0x1d (pin selectable)
>   *
> - * TODO: orientation events, autosleep
> + * TODO: orientation events
>   */
>  
>  #include <linux/module.h>
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-15 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14 11:26 [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
2016-03-14 11:26 ` [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep Martin Kepplinger
2016-03-15 22:07   ` Jonathan Cameron
2016-03-14 11:33 ` [PATCH 1/2] iio: mma8452: add i2c_device_id for mma8451 Martin Kepplinger
2016-03-15 22:05   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).