[RFC] IIO event naming.

From: J.I. Cameron
Date: Sun Mar 07 2010 - 07:39:34 EST

Dear All,

Whilst converting the current mainline IIO accelerometer drivers over to
the new api proposed (latest version http://lkml.org/lkml/2010/2/5/205 )
it has become apparent that the suggested naming choices for accelerometer
threshold events (will also be relevant to other senor types) are unclear.

We proposed control interfaces named as:

Firstly with hindsight the high / low designation isn't clear. Does it refer to the direction of the threshold? (value falling or rising) or
to the actual value lying on either side of the origin? (what I actually
meant) Secondly how do we indicate a threshold based on magnitude rather
than absolute value?

What I have come up with is:


By defining the threshold in terms of a magnitude in conjunction with
terms specifying which magnitude it refers to, is the only simply way
I can think of covering all the cases.

[_pos|_neg|_either] refers to the two directions of acceleration where
_either covers the general magnitude case.

[_rising|_falling|_crossing] refers to whether our threshold is on the
acceleration magnitude in the specified direction triggering an interrupt
if it is rising, falling or either of the above.

What do people think about this naming convention? Are there any similar
situations elsewhere in the kernel from which we can learn?

Obviously all of the above will apply to the different event types, it is
merely easier in someways to grasp the issue when dealing with something
as concrete as acceleration.



p.s. Sorry I haven't cc'd those who have previously expressed interest in
these areas. I don't have access to my address book from this machine.
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/