From: Stanislav Brabec <utx@penguin.cz>
To: linux-kernel@vger.kernel.org
Subject: How to write driver that needs to call another driver?
Date: Tue, 26 Jan 2010 22:11:05 +0100 [thread overview]
Message-ID: <1264540265.2411.20.camel@utx.utx.cz> (raw)
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
next reply other threads:[~2010-01-26 21:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 21:11 Stanislav Brabec [this message]
2010-01-26 21:45 ` John Stoffel
2010-01-26 21:46 ` Andreas Mohr
2010-01-27 18:28 ` Russ Dill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264540265.2411.20.camel@utx.utx.cz \
--to=utx@penguin.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®