Re: [PATCH 11/11] misc: Add slave driver for bma085 pressure sensor

From: Alan Cox
Date: Fri Jul 01 2011 - 12:59:22 EST


> > It's a hot pluggable bus - no different to an i2c bus on a hot pluggable
> > device.
>
> Can such a hot pluggable device maintain state while "unplugged"?

The hardware or the driver ?

As far as the OS is concerned it would have gone away.

> e.g. if the system is going to suspend, we need to pause the MPU,
> switch it back to pass-through mode, then send commands to suspend the
> slave on that bus. I took that to mean we wanted the secondary bus to
> have a normal device on it, which is still considered plugged in, but
> temporarily inaccessible from the CPU.

Thats a bit messier but we'd still want them to be normal iÂc drivers
when on the slave bus and being driven by Linux. Possibly you end up with
a little helper to send iÂc commands directly to the bus in the "smart"
mode.

> A) special-purpose code in the mpu3050 driver for each possible slave;
> or B) normal drivers and platform data which cope with B1) the kernel
> relaying their data to the MPU and B2) being disconnected from the CPU
> while the MPU reads from the device directly.

If it's operating as a normal iÂc device then it'll behave like any
normal kernel device, and really ought to be using runtime pm anyway.

In "smart" mode its really up to the driver how it does it but two
versions of every device is not a good answer !

>
> >> The other note that may not have been made explicit yet is that the
> >> 3050 will happily provide unprocessed gyro and slave data without
> >> firmware loaded. The firmware sets up some additional processing
> >> capabilities of the chip, which are used by InvenSense's user-space
> >> products.
> >
> > Yes - and the current mpu3050 driver provides just these interfaces.
>
> Ah, great. Sorry for missing them. In scanning the ioctls, it looked
> like dev-i2c was still a similar level of abstraction :)

Sorry may not have been clear "just those" as in "just those which can be
used without loading firmware and running non-free stuff"

And really until that area is sorted it may be premature to worry about
the rest - if its going to need proprietary bits to use the smart mode,
then the kernel just needs an i2c slave bus implementation, a few drivers
(we have most listed already it seems), and we are done.

Alan
--
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/