* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device [not found] ` <CAGdLNWGhdQU3Fpud9Zgvx3AQ5Lb=WdEkJb_wWTb1hJoHxXPXpQ@mail.gmail.com> @ 2014-09-09 0:04 ` Darren Hart 2014-09-09 1:35 ` Greg Kroah-Hartman 2014-09-17 16:36 ` Jonathan Cameron 0 siblings, 2 replies; 7+ messages in thread From: Darren Hart @ 2014-09-09 0:04 UTC (permalink / raw) To: Azael Avalos, Greg Kroah-Hartman, Jonathan Cameron Cc: Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On Fri, Sep 05, 2014 at 11:04:18PM -0600, Azael Avalos wrote: > Hi there, > > 2014-09-05 20:42 GMT-06:00 Darren Hart <dvhart@infradead.org>: > > On Fri, Sep 05, 2014 at 11:14:05AM -0600, Azael Avalos wrote: > >> The accelerometer sensor is very sensitive, and having userspace > >> poll the sysfs position entry is not very battery friendly. > >> > >> This patch removes the sysfs entry and instead, it creates an > >> input polled device (joystick) for the built-in accelerometer. > > > > Hrm, while sysfs details can change across kernel versions, usually due to > > driver core changes, we try to keep them as consistent as possible so as not to > > break userspace. > > > > That said, if we are going to try and come up with a better model for > > representing an accelerometer, wouldn't treating it as an IIO device be the more > > logical approach? > > Yes of course, but the actual accelerometer device (sensor?) is not > really exposed, > only certain "functions" it provides, and they are divided across two > different ACPI devices, > TOS620A exposes the protection, and the TOS1900 (and et. al.) only > exposes the axes. As I understand it, IIO defines an interface to a device, a standard sysfs set of properties. I should think we could provide the appropriate callbacks even for a partially implemented (or a pair of) accelerometer. Jonathan, what are your thoughts here. Is such a "device" (ACPI accessors to axis and threshold) a candidate for IIO, or is this input polled device more appropriate? > > I see your point in breaking userspace, but given the fact that it was > recently introduced, > I didn't thought it was already "adopted", that's why I decided to > remove the sysfs entry. Looks like since 3.15 if I read the log correctly. That is fairly recent and this is not one of the "defined interfaces" in the sysfs documentation. Greg, can you weigh in here - does this change count as "breaking userspace", or is this more inline with the scheduler knobs in /proc/sched_debug which can change from version to version. > > Then we might as well keep the sysfs entry and have the input polled > device as well. Let's see what Greg has to say. If he isn't bothered by the change, I won't push the issue. -- Darren Hart Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-09 0:04 ` [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device Darren Hart @ 2014-09-09 1:35 ` Greg Kroah-Hartman 2014-09-10 3:35 ` Darren Hart 2014-09-17 16:36 ` Jonathan Cameron 1 sibling, 1 reply; 7+ messages in thread From: Greg Kroah-Hartman @ 2014-09-09 1:35 UTC (permalink / raw) To: Darren Hart Cc: Azael Avalos, Jonathan Cameron, Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On Mon, Sep 08, 2014 at 05:04:30PM -0700, Darren Hart wrote: > On Fri, Sep 05, 2014 at 11:04:18PM -0600, Azael Avalos wrote: > > Hi there, > > > > 2014-09-05 20:42 GMT-06:00 Darren Hart <dvhart@infradead.org>: > > > On Fri, Sep 05, 2014 at 11:14:05AM -0600, Azael Avalos wrote: > > >> The accelerometer sensor is very sensitive, and having userspace > > >> poll the sysfs position entry is not very battery friendly. > > >> > > >> This patch removes the sysfs entry and instead, it creates an > > >> input polled device (joystick) for the built-in accelerometer. > > > > > > Hrm, while sysfs details can change across kernel versions, usually due to > > > driver core changes, we try to keep them as consistent as possible so as not to > > > break userspace. > > > > > > That said, if we are going to try and come up with a better model for > > > representing an accelerometer, wouldn't treating it as an IIO device be the more > > > logical approach? > > > > Yes of course, but the actual accelerometer device (sensor?) is not > > really exposed, > > only certain "functions" it provides, and they are divided across two > > different ACPI devices, > > TOS620A exposes the protection, and the TOS1900 (and et. al.) only > > exposes the axes. > > As I understand it, IIO defines an interface to a device, a standard sysfs set > of properties. I should think we could provide the appropriate callbacks even > for a partially implemented (or a pair of) accelerometer. > > Jonathan, what are your thoughts here. Is such a "device" (ACPI accessors to > axis and threshold) a candidate for IIO, or is this input polled device more > appropriate? > > > > > I see your point in breaking userspace, but given the fact that it was > > recently introduced, > > I didn't thought it was already "adopted", that's why I decided to > > remove the sysfs entry. > > Looks like since 3.15 if I read the log correctly. That is fairly recent and > this is not one of the "defined interfaces" in the sysfs documentation. > > Greg, can you weigh in here - does this change count as "breaking userspace", or > is this more inline with the scheduler knobs in /proc/sched_debug which can > change from version to version. > > > > > Then we might as well keep the sysfs entry and have the input polled > > device as well. > > Let's see what Greg has to say. If he isn't bothered by the change, I won't push > the issue. If it should be an IIO device, great, make it an IIO device, and move away from a custom sysfs interface that matches nothing else. But I really doubt it should be a joystick device, that just doesn't make sense at all. thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-09 1:35 ` Greg Kroah-Hartman @ 2014-09-10 3:35 ` Darren Hart 2014-09-10 15:28 ` Azael Avalos 0 siblings, 1 reply; 7+ messages in thread From: Darren Hart @ 2014-09-10 3:35 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: Azael Avalos, Jonathan Cameron, Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On Mon, Sep 08, 2014 at 06:35:53PM -0700, Greg Kroah-Hartman wrote: > On Mon, Sep 08, 2014 at 05:04:30PM -0700, Darren Hart wrote: > > On Fri, Sep 05, 2014 at 11:04:18PM -0600, Azael Avalos wrote: > > > Hi there, > > > > > > 2014-09-05 20:42 GMT-06:00 Darren Hart <dvhart@infradead.org>: > > > > On Fri, Sep 05, 2014 at 11:14:05AM -0600, Azael Avalos wrote: > > > >> The accelerometer sensor is very sensitive, and having userspace > > > >> poll the sysfs position entry is not very battery friendly. > > > >> > > > >> This patch removes the sysfs entry and instead, it creates an > > > >> input polled device (joystick) for the built-in accelerometer. > > > > > > > > Hrm, while sysfs details can change across kernel versions, usually due to > > > > driver core changes, we try to keep them as consistent as possible so as not to > > > > break userspace. > > > > > > > > That said, if we are going to try and come up with a better model for > > > > representing an accelerometer, wouldn't treating it as an IIO device be the more > > > > logical approach? > > > > > > Yes of course, but the actual accelerometer device (sensor?) is not > > > really exposed, > > > only certain "functions" it provides, and they are divided across two > > > different ACPI devices, > > > TOS620A exposes the protection, and the TOS1900 (and et. al.) only > > > exposes the axes. > > > > As I understand it, IIO defines an interface to a device, a standard sysfs set > > of properties. I should think we could provide the appropriate callbacks even > > for a partially implemented (or a pair of) accelerometer. > > > > Jonathan, what are your thoughts here. Is such a "device" (ACPI accessors to > > axis and threshold) a candidate for IIO, or is this input polled device more > > appropriate? > > > > > > > > I see your point in breaking userspace, but given the fact that it was > > > recently introduced, > > > I didn't thought it was already "adopted", that's why I decided to > > > remove the sysfs entry. > > > > Looks like since 3.15 if I read the log correctly. That is fairly recent and > > this is not one of the "defined interfaces" in the sysfs documentation. > > > > Greg, can you weigh in here - does this change count as "breaking userspace", or > > is this more inline with the scheduler knobs in /proc/sched_debug which can > > change from version to version. > > > > > > > > Then we might as well keep the sysfs entry and have the input polled > > > device as well. > > > > Let's see what Greg has to say. If he isn't bothered by the change, I won't push > > the issue. > > If it should be an IIO device, great, make it an IIO device, and move > away from a custom sysfs interface that matches nothing else. > > But I really doubt it should be a joystick device, that just doesn't > make sense at all. I immediately went to a tablet with a marble maze game and it didn't seem too crazy, but I don't suppose that is what people are actually doing with it... What are people actually doing with this thing Azael? -- Darren Hart Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-10 3:35 ` Darren Hart @ 2014-09-10 15:28 ` Azael Avalos 2014-09-10 16:08 ` Greg Kroah-Hartman 0 siblings, 1 reply; 7+ messages in thread From: Azael Avalos @ 2014-09-10 15:28 UTC (permalink / raw) To: Darren Hart Cc: Greg Kroah-Hartman, Jonathan Cameron, Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio Hi there, 2014-09-09 21:35 GMT-06:00 Darren Hart <dvhart@infradead.org>: > > I immediately went to a tablet with a marble maze game and it didn't seem too > crazy, but I don't suppose that is what people are actually doing with it... > > What are people actually doing with this thing Azael? Gaming mostly (supertuxkart anyone?), but some others (including myself) want to use it as a movement detection (one exists for the IBM/Lenovo Thinkpads). Digging into platform drivers, I've found that the hdaps and also the lis3lv02d drivers report the axes via polldev, and since I don't want to break userspace, I'm left with two choices: 1 - Keep sysfs entry and adapt it to properly report direction, and no polled device. 2 - Keep sysfs entry and adapt it to properly report direction, and also a polled device. Let me know your decision so I can send an updated patch. > > -- > Darren Hart > Intel Open Source Technology Center Cheers Azael -- -- El mundo apesta y vosotros apestais tambien -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-10 15:28 ` Azael Avalos @ 2014-09-10 16:08 ` Greg Kroah-Hartman 0 siblings, 0 replies; 7+ messages in thread From: Greg Kroah-Hartman @ 2014-09-10 16:08 UTC (permalink / raw) To: Azael Avalos Cc: Darren Hart, Jonathan Cameron, Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On Wed, Sep 10, 2014 at 09:28:44AM -0600, Azael Avalos wrote: > Hi there, > > 2014-09-09 21:35 GMT-06:00 Darren Hart <dvhart@infradead.org>: > > > > I immediately went to a tablet with a marble maze game and it didn't seem too > > crazy, but I don't suppose that is what people are actually doing with it... > > > > What are people actually doing with this thing Azael? > > Gaming mostly (supertuxkart anyone?), but some others (including myself) > want to use it as a movement detection (one exists for the IBM/Lenovo > Thinkpads). > > Digging into platform drivers, I've found that the hdaps and also the lis3lv02d > drivers report the axes via polldev, and since I don't want to break userspace, > I'm left with two choices: > > 1 - Keep sysfs entry and adapt it to properly report direction, and no > polled device. > > 2 - Keep sysfs entry and adapt it to properly report direction, and also > a polled device. > > Let me know your decision so I can send an updated patch. 3 - use the correct api and change it to iio so that all userspace tools can correctly interact with it, instead of dealing with a driver-specific sysfs file. thanks, greg k-h ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-09 0:04 ` [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device Darren Hart 2014-09-09 1:35 ` Greg Kroah-Hartman @ 2014-09-17 16:36 ` Jonathan Cameron 2014-09-17 18:38 ` Darren Hart 1 sibling, 1 reply; 7+ messages in thread From: Jonathan Cameron @ 2014-09-17 16:36 UTC (permalink / raw) To: Darren Hart, Azael Avalos, Greg Kroah-Hartman Cc: Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On September 9, 2014 1:04:30 AM GMT+01:00, Darren Hart <dvhart@infradead.org> wrote: >On Fri, Sep 05, 2014 at 11:04:18PM -0600, Azael Avalos wrote: >> Hi there, >> >> 2014-09-05 20:42 GMT-06:00 Darren Hart <dvhart@infradead.org>: >> > On Fri, Sep 05, 2014 at 11:14:05AM -0600, Azael Avalos wrote: >> >> The accelerometer sensor is very sensitive, and having userspace >> >> poll the sysfs position entry is not very battery friendly. >> >> >> >> This patch removes the sysfs entry and instead, it creates an >> >> input polled device (joystick) for the built-in accelerometer. >> > >> > Hrm, while sysfs details can change across kernel versions, usually >due to >> > driver core changes, we try to keep them as consistent as possible >so as not to >> > break userspace. >> > >> > That said, if we are going to try and come up with a better model >for >> > representing an accelerometer, wouldn't treating it as an IIO >device be the more >> > logical approach? >> >> Yes of course, but the actual accelerometer device (sensor?) is not >> really exposed, >> only certain "functions" it provides, and they are divided across two >> different ACPI devices, >> TOS620A exposes the protection, and the TOS1900 (and et. al.) only >> exposes the axes. > >As I understand it, IIO defines an interface to a device, a standard >sysfs set >of properties. I should think we could provide the appropriate >callbacks even >for a partially implemented (or a pair of) accelerometer. > >Jonathan, what are your thoughts here. Is such a "device" (ACPI >accessors to >axis and threshold) a candidate for IIO, or is this input polled device >more >appropriate? Absolutely fine in IIO. Sorry I took so long to reply. Read the title and expected more detailed issue so queued it up for when I had more time. Oops. Only slight gotcha is that there is some debate over the iio timer trigger configuration interface which would be equivalent of a polled input device. Hence it hasn't merged yet. Comes down to how these are instantiated. Lars-Peter Clausen is planning a configfs proposal rather than how we do the user space trigger creation currently. A user space trigger would work but then you loose lack of hitting sysfs files. > >> >> I see your point in breaking userspace, but given the fact that it >was >> recently introduced, >> I didn't thought it was already "adopted", that's why I decided to >> remove the sysfs entry. > >Looks like since 3.15 if I read the log correctly. That is fairly >recent and >this is not one of the "defined interfaces" in the sysfs documentation. > >Greg, can you weigh in here - does this change count as "breaking >userspace", or >is this more inline with the scheduler knobs in /proc/sched_debug which >can >change from version to version. > >> >> Then we might as well keep the sysfs entry and have the input polled >> device as well. > >Let's see what Greg has to say. If he isn't bothered by the change, I >won't push >the issue. -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device 2014-09-17 16:36 ` Jonathan Cameron @ 2014-09-17 18:38 ` Darren Hart 0 siblings, 0 replies; 7+ messages in thread From: Darren Hart @ 2014-09-17 18:38 UTC (permalink / raw) To: Jonathan Cameron Cc: Azael Avalos, Greg Kroah-Hartman, Matthew Garrett, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio On Wed, Sep 17, 2014 at 05:36:31PM +0100, Jonathan Cameron wrote: > > > On September 9, 2014 1:04:30 AM GMT+01:00, Darren Hart <dvhart@infradead.org> wrote: > >On Fri, Sep 05, 2014 at 11:04:18PM -0600, Azael Avalos wrote: > >> Hi there, > >> > >> 2014-09-05 20:42 GMT-06:00 Darren Hart <dvhart@infradead.org>: > >> > On Fri, Sep 05, 2014 at 11:14:05AM -0600, Azael Avalos wrote: > >> >> The accelerometer sensor is very sensitive, and having userspace > >> >> poll the sysfs position entry is not very battery friendly. > >> >> > >> >> This patch removes the sysfs entry and instead, it creates an > >> >> input polled device (joystick) for the built-in accelerometer. > >> > > >> > Hrm, while sysfs details can change across kernel versions, usually > >due to > >> > driver core changes, we try to keep them as consistent as possible > >so as not to > >> > break userspace. > >> > > >> > That said, if we are going to try and come up with a better model > >for > >> > representing an accelerometer, wouldn't treating it as an IIO > >device be the more > >> > logical approach? > >> > >> Yes of course, but the actual accelerometer device (sensor?) is not > >> really exposed, > >> only certain "functions" it provides, and they are divided across two > >> different ACPI devices, > >> TOS620A exposes the protection, and the TOS1900 (and et. al.) only > >> exposes the axes. > > > >As I understand it, IIO defines an interface to a device, a standard > >sysfs set > >of properties. I should think we could provide the appropriate > >callbacks even > >for a partially implemented (or a pair of) accelerometer. > > > >Jonathan, what are your thoughts here. Is such a "device" (ACPI > >accessors to > >axis and threshold) a candidate for IIO, or is this input polled device > >more > >appropriate? > Absolutely fine in IIO. > > Sorry I took so long to reply. Read the title and expected more detailed issue so queued > it up for when I had more time. Oops. > > Only slight gotcha is that there is some debate over the iio timer trigger > configuration interface which would be equivalent of a polled input device. > > Hence it hasn't merged yet. > Comes down to how these are instantiated. Lars-Peter Clausen is planning a configfs > proposal rather than how we do the user space trigger creation currently. > > A user space trigger would work but then you loose lack of hitting sysfs files. Thanks Jonathan, Azael, please follow-up with the IIO folks and if you want to modify the interface, please do so via IIO so it uses a consistent interface and we can eliminate these custom sysfs files. Thanks, -- Darren Hart Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-17 18:38 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1409937247-2525-1-git-send-email-coproscefalo@gmail.com> [not found] ` <1409937247-2525-4-git-send-email-coproscefalo@gmail.com> [not found] ` <20140906024253.GB11389@vmdeb7> [not found] ` <CAGdLNWGhdQU3Fpud9Zgvx3AQ5Lb=WdEkJb_wWTb1hJoHxXPXpQ@mail.gmail.com> 2014-09-09 0:04 ` [PATCH 3/5] toshiba_acpi: Add accelerometer input polled device Darren Hart 2014-09-09 1:35 ` Greg Kroah-Hartman 2014-09-10 3:35 ` Darren Hart 2014-09-10 15:28 ` Azael Avalos 2014-09-10 16:08 ` Greg Kroah-Hartman 2014-09-17 16:36 ` Jonathan Cameron 2014-09-17 18:38 ` Darren Hart
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).