Messages in this thread |  | | | From | Russ Dill <> | | Subject | Re: How to write driver that needs to call another driver? | | Date | Wed, 27 Jan 2010 18:28:30 +0000 (UTC) |
| |
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.
|  |