Re: How to write driver that needs to call another driver?

From: Russ Dill
Date: Wed Jan 27 2010 - 13:29:17 EST


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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/