Skip to contentSkip to conversation

Using POWER or APM for battery handling

DISCUSSION Kristoffer Ericson 2 participants 5 messages Mar 27, 2009

lore
Share & tools
lore
#0 lore raw

Hey Anton,

My machines (HP Jornada 600-series and HP Jornada 700-series) both rely on batteries for power. Now, in the past it has all been handled by an APM_EMULATION driver that essentially detects the current state (loading YES/NO, POWER_LEFT, ESTIMATED TIME LEFT,...) and adjusts
the state of the machine.

My question is should I port this to instead
use the power class (drivers/power) or not.

The batteries are same for both 600/700 but
contain no internal chip so I would need
seperate battery drivers for both machines.

Best wishes
Kristoffer Ericson

Signature · 1 line
Kristoffer Ericson <[email protected]>
#1 lore raw

Hello Kristoffer,

Quoted 11 lines · Kristoffer Ericson

Hey Anton,

My machines (HP Jornada 600-series and HP Jornada 700-series) both rely on batteries for power. Now, in the past it has all been handled by an APM_EMULATION driver that essentially detects the current state (loading YES/NO, POWER_LEFT, ESTIMATED TIME LEFT,...) and adjusts
the state of the machine.

My question is should I port this to instead
use the power class (drivers/power) or not.

The driver is already there:
drivers/power/apm_power.c

So all you need is Jornada driver for the power supply class, and then apm_power.c will work for your battery driver.

Feel free to ask if there is anything still not clear.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#2 lore raw
Quoted 15 lines · On Fri, 27 Mar 2009 22:29:47 +0300 Anton Vorontsov <[email protected]>…

Hello Kristoffer,

Quoted 11 lines · Kristoffer Ericson

Hey Anton,

My machines (HP Jornada 600-series and HP Jornada 700-series) both rely on batteries for power. Now, in the past it has all been handled by an APM_EMULATION driver that essentially detects the current state (loading YES/NO, POWER_LEFT, ESTIMATED TIME LEFT,...) and adjusts
the state of the machine.

My question is should I port this to instead
use the power class (drivers/power) or not.

Quoted 7 lines

The driver is already there:
drivers/power/apm_power.c

So all you need is Jornada driver for the power supply class, and then apm_power.c will work for your battery driver.

Feel free to ask if there is anything still not clear.

Great!

I think I understand, but should I create this driver
inside /drivers/power or inside the mach folder (in this case arch/arm/mach-sa1100)?

Quoted 7 lines

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
Signature · 1 line
Kristoffer Ericson <[email protected]>
#3 lore raw

On Fri, Mar 27, 2009 at 09:41:06PM +0100, Kristoffer Ericson wrote:
[...]

Quoted 6 lines
Quoted 6 lines

The driver is already there:
drivers/power/apm_power.c

So all you need is Jornada driver for the power supply class, and then apm_power.c will work for your battery driver.

Quoted 6 lines
Quoted 1 line

Feel free to ask if there is anything still not clear.

Great!

I think I understand, but should I create this driver
inside /drivers/power or inside the mach folder (in this case arch/arm/mach-sa1100)?

I would prefer drivers/power/.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#4 lore raw
Quoted 8 lines · On Fri, 27 Mar 2009 23:55:13 +0300 Anton Vorontsov <[email protected]>…

On Fri, Mar 27, 2009 at 09:41:06PM +0100, Kristoffer Ericson wrote:
[...]

Quoted 6 lines
Quoted 6 lines

The driver is already there:
drivers/power/apm_power.c

So all you need is Jornada driver for the power supply class, and then apm_power.c will work for your battery driver.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Feel free to ask if there is anything still not clear.

Great!

I think I understand, but should I create this driver
inside /drivers/power or inside the mach folder (in this case arch/arm/mach-sa1100)?

I would prefer drivers/power/.

roger, big thanks for help.

Quoted 7 lines

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
Signature · 1 line
Kristoffer Ericson <[email protected]>