[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120331101953.GA3163@opensource.wolfsonmicro.com>
Date: Sat, 31 Mar 2012 11:19:54 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Erik Gilling <konkers@...gle.com>
Cc: MyungJoo Ham <myungjoo.ham@...sung.com>,
Arnd Bergmann <arnd@...db.de>, NeilBrown <neilb@...e.de>,
gregkh@...uxfoundation.org,
Linus Walleij <linus.walleij@...aro.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Arve Hjønnevag <arve@...roid.com>,
linux-kernel@...r.kernel.org, Randy Dunlap <rdunlap@...otime.net>,
myungjoo.ham@...il.com, John Stultz <john.stultz@...aro.org>,
linux-arm-kernel@...ts.infradead.org,
Joerg Roedel <joerg.roedel@....com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Morten CHRISTIANSEN <morten.christiansen@...ricsson.com>,
Mike Lockwood <lockwood@...roid.com>,
Dima Zavin <dmitriyz@...gle.com>
Subject: Re: [PATCH v6 1/5] Extcon (external connector): import Android's
switch class and modify.
On Fri, Mar 30, 2012 at 10:29:27AM -0700, Erik Gilling wrote:
> I'm also not in favor of having functionality conditionally compiled
> based on CONFIG_ANDROID. If fact, going through the patch stack
> there's much more that changes the ABI from the switch driver than
> just the name. Android asumes that there is a single "switch" for
> each logical entity (called cable types in extcon) each with a binary
> state (0,1). Here things have changed to have a single extcon
> instance that can have a bitmask of states which are sent as strings
> in the uevent.
The binary status thing isn't true for the original Android switch API,
at least not in all cases - for headsets it's a tristate indicating if
there's nothing, a headphone or headset plugged in. This does wind up
being a bitmask because the numbers are 0, 1 and 2 but it isn't really
clear to me if this is intentional or just an effect of counting.
> As it stands, this patch does not solve the cases where we use switch
> today and we'll probably continue to carry the switch driver in the
> common android tree. If, instead, we got rid of the idea of multiple
> states and mutual exclusivity and relied on the driver that uses
> extcon to have multiple instances for each logical entity and deal
> with mutual exclusion itself, we'd have a driver that would be pretty
> easy to support in android.
What's the advantage in not having information about mutual exclusion in
the core, and why would a userspace that isn't interested in this care?
It seems like this could be used by userspace to do interesting things,
and I rather suspect you'll find some vendors have added features along
those lines in their Android devices. For example, having different
configurations for desk docks and car docks even if both end up
connecting the same things up.
Even if the userspace ABI doesn't expose the information it seems
sensible to factor out the code for handling this into the core so
there's less work to do in individual drivers.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists