Skip to contentSkip to conversation

iio: mma8452: add i2c_device_id for mma8451

PATCH Applied Martin Kepplinger 2 participants 5 messages Mar 14, 2016 – Mar 15, 2016 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 iio: mma8452: add i2c_device_id for mma8451

This was forgotten about and is added for consistency now

---
 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/mma8452.c +1 -0
index 305ed0e..d0eeba0 100644
@@ -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 },
Signature · 1 line
2.1.4
#3 lore raw

PATCH 2/2 iio: mma8452: use runtime pm instead of device specific autosleep

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.

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

PATCH 1/2 iio: mma8452: add i2c_device_id for mma8451

In reply to Martin Kepplinger

This was forgotten about and is added for consistency now

---
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(+)
drivers/iio/accel/mma8452.c +1 -0
index 305ed0e..6aa2517 100644
@@ -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 },
Signature · 1 line
2.1.4
maintainer
#2 lore raw
Quoted 6 lines · Martin Kepplinger

This was forgotten about and is added for consistency now

---
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

Quoted 18 lines

 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/mma8452.c +1 -0
index 305ed0e..6aa2517 100644
@@ -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 },
maintainer Applied
#4 lore raw

Re: [PATCH 2/2] iio: mma8452: use runtime pm instead of device specific autosleep

In reply to Martin Kepplinger
Quoted 21 lines · 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

Quoted 8 lines

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.

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

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