mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to write driver that needs to call another driver?
@ 2010-01-26 21:11 Stanislav Brabec
  2010-01-26 21:45 ` John Stoffel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stanislav Brabec @ 2010-01-26 21:11 UTC (permalink / raw)
  To: linux-kernel

My Zaurus SL-C3200 PDA needs a driver that needs to call another driver
from another part of the device tree:

MAX1111 (4 channel A/D) is connected to several other pieces of hardware
(audio player remote keyboard, battery voltage, battery temperature,
external power voltage).

Battery power and charging management needs to read values from MAX1111
during. Also Remote Keyboard input device needs to read MAX1111.

But both drivers also need dedicated GPIO that are allocated on Scoop
chip (different part of the platform device tree).

What is the best way to implement it?

Now it is implemented by a hardcoded static reference. This does not
work well and breaks on suspend. MAX1111 goes to sleep first and attempt
to set-up offline charging fails (see below).

I need to make sure, that MAX1111 is going to suspend after the
battery management and after the audio remote driver (not yet in
vanilla) and resumes before them.

What is the best way to implement it?


Well, in fact, the problem is even worse: Spitz has a dumb charging
management. CPU has to wake-up each few minutes, check the battery,
adjust charging parameters and continue in sleeping.

That is why I either need to disable sleeping of SPI and MAX1111 or
temporarily wake up SPI and MAX111 without going to resume completely.

Is something like this possible?

It was working in past (linux-2.6.26) - MAX1111+SPI driver was hardcoded
into power management and when SPI was probably never suspended. Now it
obviously cannot work.

Thanks.

PM: suspend of devices complete after 549.298 msecs
PM: late suspend of devices complete after 0.359 msecs
max1111 spi2.2: spi_sync failed with -108
max1111 spi2.2: spi_sync failed with -108
max1111 spi2.2: spi_sync failed with -108
max1111 spi2.2: spi_sync failed with -108
max1111 spi2.2: spi_sync failed with -108
sharpsl-pm sharpsl-pm: Error: AC check failed: voltage -108.
sharpsl-pm sharpsl-pm: Offline Charger: Error occurred.
sharpsl-pm sharpsl-pm: Charging Error!
PM: early resume of devices complete after 0.255 msecs


________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx


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

end of thread, other threads:[~2010-01-27 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26 21:11 How to write driver that needs to call another driver? Stanislav Brabec
2010-01-26 21:45 ` John Stoffel
2010-01-26 21:46 ` Andreas Mohr
2010-01-27 18:28 ` Russ Dill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®