Messages in this thread | | | Date | Mon, 03 Jul 2006 15:25:14 +0200 | From | Stefan Richter <> | Subject | Re: [RFC] Apple Motion Sensor driver |
| |
Michael Hanselmann wrote: > On Mon, Jul 03, 2006 at 12:12:47PM +0200, Stelian Pop wrote: >> > + >> > +static DEVICE_ATTR(mouse, S_IRUGO | S_IWUSR, >> > + ams_mouse_show_mouse, ams_mouse_store_mouse);
[I think the following discussion is about ams_show_xyz, not ams_mouse_show_mouse.]
>> I would prefer three different files for x, y and z instead of a single >> one... > > Because of the way the values are calculated with orientation, that > would mean that if a program needs all three, either all values are read > three times or the ams_sensors function gets much more complicated. > > To prevent it from having to read them three times in a row, I joined > all three values.
I don't know what a software will be doing with it, but "displacement" (and its time derivatives "velocity", "acceleration", "jerk") is a vector. Why not write the component-wise representation of the vector into a single sysfs attribute? Especially if this keeps the kernel code simple and small. I suppose even userspace code which evaluates the attribute is in many cases simpler (and more precise anyway) if only a single attribute is used. -- Stefan Richter -=====-=-==- -==- ===-- http://arcgraph.de/sr/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |