lkml.org 
[lkml]   [2012]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 4/5] Extcon: support mutually exclusive relation between cables.
Date
On Wednesday 22 February 2012, MyungJoo Ham wrote:
>
> On Mon, Feb 20, 2012 at 11:27 AM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
> > On Fri, Feb 10, 2012 at 03:40:37PM +0900, MyungJoo Ham wrote:
> >
> >> +What: /sys/class/extcon/.../mutually_exclusive
> >> +Date: December 2011
> >> +Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
> >> +Description:
> >> + Shows the relations of mutually exclusiveness. For example,
> >> + if the mutually_exclusive array of extcon_dev is
> >> + {0x3, 0x5, 0xC, 0x0}, the, the output is:
> >> + # cat mutually_exclusive
> >> + 0x3
> >> + 0x5
> >> + 0xC
> >> + #
> >
> > sysfs really isn't supposed to have more than one value per file so this
> > should be something like a directory with one array element per file.
> > It'd kind of be cheating but the values could be used as the filenames,
> > though serial numbers would be more idiomatic.
>
> Hmm.. I'll either use multiple files with a sub-directory or bin-attr
> to inhabit the values. Or I'll search for any other convinient way to
> express such an array thru sysfs.

How about having one file for each cable and list the ones that it
cannot coexist with. In the above example, that would become

mutually_exclusive/0: "0x6"
mutually_exclusive/1: "0x1"
mutually_exclusive/2: "0x9"
mutually_exclusive/3: "0x4"

The information here is a bit redundant, but this would be much easier
to understand for human readers. I also wouldn't mind having a list
of exclusive cable names in each file, while would make it slightly
harder to parse but very easy for humans:

mutually_exclusive/Video-in: "VGA"
mutually_exclusive/Video-out: "VGA"
mutually_exclusive/VGA: "Video-out Video-in"

Arnd


\
 
 \ /
  Last update: 2012-02-22 11:03    [W:0.061 / U:1.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site