[RFC] What is the preferred way to share ADC unit between hwmon and input(ts) drivers?

Linus Walleij linus.walleij at linaro.org
Sat May 7 14:11:00 EDT 2011


2011/4/25 Ilya Yanok <yanok at emcraft.com>:

> So, to add both input and hwmon drivers we need to serialize the
> register accesses.(...) Should we use a multi-function device driver
> for this

Yes. Use MFD. We use MFD for say drivers/mfd/ab3100-core.c and
what is does is essentially serialize the I2C read/writes using a
mutex, it spawnd MFD cell children for say drivers/regulator/ab3100.c

In your case spawn a foo-hwmon and foo-input MFD cell from your
MFD driver core.

> or just some platform-specific code (as S3C does)?

And where are you going to put that? Into arch/arm/mach-* where
Linus (the other one) is already upset with the prevalence of
driver code not being factored to share common infrastructure?

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list