Re: [PATCH v4] platform/x86: ideapad-laptop: Add sysfs interface for touchpad state
From: Andy Shevchenko
Date: Sun May 07 2017 - 19:07:18 EST
On Wed, May 3, 2017 at 7:11 PM, Darren Hart <dvhart@xxxxxxxxxxxxx> wrote:
> On Wed, May 03, 2017 at 05:42:02PM +0300, Andy Shevchenko wrote:
>> On Wed, May 3, 2017 at 5:36 PM, Ritesh Raj Sarraf <rrs@xxxxxxxxxx> wrote:
>> > Resending again, as Google servers are behaving weird lately.
>> >
>> > On Sun, 2017-04-30 at 15:54 +0300, Andy Shevchenko wrote:
>> >> > > the main issue that driver doesn't
>> >> > > send SW_TABLET_MODE event through input device.
>> >> >
>> >> > Well. Yes. That is one part. If SW_TABLET_MODE is done in the driver, much
>> >> > better. My patch was simply in line with some of the other drivers (hp-wmi
>> >> > and
>> >> > thinkpad_acpi) to get it working for Lenovo Yoga series.
>> >>
>> >> sysfs ABI for drivers that provide input interface is quite strong for
>> >> my opinion. It means I'm not totally objecting, but I would accept it
>> >> if and only if there is nothing else could be done.
>> >
>> > The need we have in the user application is for read-only access.
>>
>> I does not matter at all! You are proposing a part of ABI which will
>> be closer to what is "carved in stone". Here is the problem.
>>
>> So, I'm really trying hard to get avoid such "small things" which
>> would make our lives quite hard in long term prospective while fixing
>> short-term issues in a good will.
>>
>> Please, consider to do it better. For now I didn't hear any proof that
>> there is no other way to achieve your goal.
>
> I spent a day with the Lenovo Yoga 2 11 I have available, and have not yet found
> a reliable means of detecting the tablet mode (reverse engineering these things
> isn't something I'm expert at though). I've reached out to the original author
> for some context, but that didn't lead to any revelations as of yet.
Okay, I have pushed to testing current version and put on top the
separate patch for switching attribute to be RO.
(I just realized it might produce a warning since we have defined and
not used function.)
> Ultimately, this sysfs attribute is no better or worse than others that exist in
> our tree. So until we can provide a better solution, we do need to be careful
> to not inadvertently favor one laptop driver over another while seeking to avoid
> sysfs stable API issues.
>
> I do think we need to start distinguishing between core kernel userspace
> interfaces and leaf node driver sysfs attributes.
More flexibility -- more ways to abuse it OTOH :-)
--
With Best Regards,
Andy Shevchenko