Skip to contentSkip to conversation

apm for individual devices

DISCUSSION Tehn Yit Chin 4 participants 6 messages Mar 7, 2006 – Mar 8, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

How does one use the sysfs entry of power/state that I can find for each registered device? Eg, for the i2c device on my s3c2410 cpu, I find the following entry,

/sys/devices/platform/s3c2410-i2c/power/state

I tried echoing "mem" into it, but nothing seems to happen.

What I am looking for is a way of suspending and resuming individual devices within the PM architecture?

Any pointers would be greatly appreciated.

Signature · 2 lines
Tehn Yit Chin
Software Engineer, Grey Innovation Pty. Ltd.
#1 lore raw
Quoted 11 lines · Tehn Yit Chin

Hi all,

How does one use the sysfs entry of power/state that I can find for each registered device? Eg, for the i2c device on my s3c2410 cpu, I find the following entry,

/sys/devices/platform/s3c2410-i2c/power/state

I tried echoing "mem" into it, but nothing seems to happen.

What I am looking for is a way of suspending and resuming individual devices within the PM architecture?

Any pointers would be greatly appreciated.

After reading through the mailing list archives, I sort of work it out. ie

echo -n 1 > /sys/devices/platform/s3c2410-i2c/power/state

puts the device into suspend mode.

However, the driver's behaviour doesn't change if I echo a different number into it. What does this number suppose to do?

Tehn Yit Chin
Software Engineer, Grey Innovation Pty. Ltd.

#2 lore raw
Quoted 8 lines · Tehn Yit Chin

After reading through the mailing list archives, I sort of work it out. ie

echo -n 1 > /sys/devices/platform/s3c2410-i2c/power/state

puts the device into suspend mode.

However, the driver's behaviour doesn't change if I echo a different number into it. What does this number suppose to do?

It depends on how the i2c subsystem (and possibly the driver) treats the number. It might have only 2 states - on (0) and off (1). But, you'll have to check the i2c documentation, the code, and possibly the developers to know for sure..

Thanks,

Patrick

#3 lore raw
In reply to Tehn Yit Chin
Quoted 12 lines · Tehn Yit Chin
Quoted 10 lines · Tehn Yit Chin

Hi all,

How does one use the sysfs entry of power/state that I can find for each registered device? Eg, for the i2c device on my s3c2410 cpu, I find the following entry,

/sys/devices/platform/s3c2410-i2c/power/state

I tried echoing "mem" into it, but nothing seems to happen.

Quoted 8 lines
Quoted 4 lines

What I am looking for is a way of suspending and resuming individual devices within the PM architecture?

Any pointers would be greatly appreciated.

After reading through the mailing list archives, I sort of work it out. ie

echo -n 1 > /sys/devices/platform/s3c2410-i2c/power/state

Actually, it is controlled by 0 and 3 these days. (0 == on, 3 == off).

Pavel

Signature · 1 line
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...
#4 lore raw
In reply to Tehn Yit Chin
Quoted 8 lines · Tehn Yit Chin

Hi all,

How does one use the sysfs entry of power/state that I can find for each registered device? Eg, for the i2c device on my s3c2410 cpu, I find the following entry,

/sys/devices/platform/s3c2410-i2c/power/state

Quoted 7 lines

I tried echoing "mem" into it, but nothing seems to happen.

What I am looking for is a way of suspending and resuming individual devices within the PM architecture?

Any pointers would be greatly appreciated.
--

Out of curiousity, why do you need to suspend this individual device? In other words, what practical runtime power management gains would this sort of low level and specific power management control provide for your purposes?

Thanks,
Adam

#5 lore raw
Quoted 16 lines · Adam Belay
Quoted 4 lines · Tehn Yit Chin

Hi all,

How does one use the sysfs entry of power/state that I can find for each registered device? Eg, for the i2c device on my s3c2410 cpu, I find the following entry,

Quoted 8 lines

/sys/devices/platform/s3c2410-i2c/power/state

I tried echoing "mem" into it, but nothing seems to happen.

What I am looking for is a way of suspending and resuming individual devices within the PM architecture?

Any pointers would be greatly appreciated.
--

Quoted 9 lines

Out of curiousity, why do you need to suspend this individual device? In other words, what practical runtime power management gains would this sort of low level and specific power management control provide for your purposes?

Thanks,
Adam

The example that I use is probably a bad example.

We are developing a consumer electronic product where we need to shut down various devices in the product's several operating mode to maximise battery life. Eg: in one of its operating mode, we are not using the audio codec so we should suspend it to maximise battery life. There are also several similar scenarios where this could apply.

A better example might have been

echo -n 1 > /dev/devices/platform/product-codec/power/state

cheers,
tyc