lkml.org 
[lkml]   [2010]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectHow to write driver that needs to call another driver?
From
Date
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



\
 
 \ /
  Last update: 2010-01-26 22:11    [W:0.054 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site