Re: [PULL-REQUEST] EXTCON Patches (Re: [PATCH v6 0/5] IntroduceExternal Connector Class (extcon))

From: MyungJoo Ham
Date: Fri Mar 09 2012 - 03:26:26 EST


On Mon, Mar 5, 2012 at 9:07 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Mar 05, 2012 at 04:59:42PM +0900, MyungJoo Ham wrote:
>> On Wed, Feb 29, 2012 at 9:35 PM, Mark Brown
>
>> > For things like headphone detection the actual switch they're providing
>> > has issues too even just within the switch API - it's called "h2w" with
>> > magic values.
>
>> Reading an H2W switch device driver
>> (http://git.ziggy471.com/frankenstine.git/plain/arch/arm/mach-msm/htc_headset_mgr.c),
>> I don't see why it won't be compatible after replacing the name from
>
> That's not the only such driver, that's one example of a machine
> specific accessory detection driver.  There's others out there such as
> the sec_jack driver which you converted into the ADC driver in your
> patches (if you look at how that gets deployed the overwhelming majority
> of users are headsets).
>
> The issue is the combination of the naming (h2w isn't very meaningful
> and only works with a single jack) and the magic numbers used for
> reporting state, plus the registration collisions.  Existing code can be
> ported over fairly easily but it's got issues as an ABI which we'd want
> to fix.

The ABI of simply ported (only with API name changes) ex-switch extcon
device won't be changed:

sprintf(buf, "%u\n", edev->state);

is kept used if edev->max_supported == 0, which means that it is not
using extcon-native multi-state features, which is true for any simply
ported ex-switch extcon device drivers because they won't provide
"supported_cable" array with extcon_dev struct.


Or, do you mean that extcon class should support not ex-swtich extcon
device drivers such as adc-jack.c (not ported from oldies) to support
"legacy" userspace application that is aware of only switch interface?

Then, we may simply let state's read ABI to use sprintf(buf, "%u\n",
edev->state); only regardless of device drivers. How do you think
about this?
(simply removing line 119, 121-130 of extcon_class.c)


Cheers!
MyungJoo.
--
MyungJoo Ham, Ph.D.
System S/W Lab, S/W Center, Samsung Electronics
--
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/