mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russ Dill <Russ.Dill@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: How to write driver that needs to call another driver?
Date: Wed, 27 Jan 2010 18:28:30 +0000 (UTC)	[thread overview]
Message-ID: <loom.20100127T192218-294@post.gmane.org> (raw)
In-Reply-To: <1264540265.2411.20.camel@utx.utx.cz>

Stanislav Brabec <utx <at> penguin.cz> writes:

>
> 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).
>

GPIO already has a generic API that can be used. I've had similar problems with
I2C devices. I've always implemented as adding in .command support to the I2C
driver in question, using i2c_use_client and then try_module_get. I'm not sure
if it is the proper way of doing things, it's always bugged me that there
doesn't seem to programatically access things like I2C eeproms and HW monitoring
devices. They seem to only be exposed though sysfs.


      parent reply	other threads:[~2010-01-27 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 21:11 Stanislav Brabec
2010-01-26 21:45 ` John Stoffel
2010-01-26 21:46 ` Andreas Mohr
2010-01-27 18:28 ` Russ Dill [this message]

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=loom.20100127T192218-294@post.gmane.org \
    --to=russ.dill@gmail.com \
    --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®