X86 platform drivers
 help / color / mirror / Atom feed
From: Lorenz Brun <lorenz@brun.one>
To: Armin Wolf <W_Armin@gmx.de>,
	platform-driver-x86 <platform-driver-x86@vger.kernel.org>
Subject: Re: Upstreaming Lenovo tablet switch driver
Date: Sun, 16 Oct 2022 00:25:48 +0200	[thread overview]
Message-ID: <0NFTJR.N3ZFSHV6AM7A2@brun.one> (raw)
In-Reply-To: <7896b326-22d1-c80b-9fa5-cc0f31d980ef@gmx.de>

Hi Armin,

Thanks for your input. While looking at new WMI drivers which I could 
use as a reference, I stumbled upon 
https://patchwork.kernel.org/project/platform-driver-x86/patch/20221004214332.35934-1-soyer@irl.hu/ 
which was sent last week and implements a driver for the same WMI 
interface. So I guess there is not much left for me to implement here, 
I'll just follow that patch.

Regards,
Lorenz

On Sat, Oct 15 2022 at 03:26:50 +02:00:00, Armin Wolf <W_Armin@gmx.de> 
wrote:
> Am 15.10.22 um 00:12 schrieb Lorenz Brun:
> 
>> Hi x86 platform list,
>> 
>> I'm considering contributing support for the usage mode/tablet mode
>> switch for some Lenovo laptops (including the popular IdeaPad Flex
>> series).
>> There is already an out-of-tree driver at
>> https://github.com/lukas-w/yoga-usage-mode which works well,
>> but I'd like to get this support upstream.
>> 
>> I have a few questions regarding the best approach:
>> 1. There is the ideapad-laptop module already which deals with a 
>> bunch
>> of functionality related to these laptops, but not the mode switch. 
>> Do
>> you prefer a separate driver or should the functionality be added to
>> ideapad-laptop?
>> 2. The existing out-of-tree driver uses a WMI interface to access 
>> mode
>> information. Should I work on the WMI layer or should I figure out
>> which EC registers to use to get the functionality independently? If
>> yes, how do we want to identify support for this type of mode switch?
>> 
>> Regards,
>> Lorenz
>> 
>> 
> Hi,
> 
> 1) In my opinion, the ideapad-laptop driver uses a totally different 
> interface than the out of tree driver, so it would make sense to 
> create a separate driver.
> 2) You should stick to the WMI interface. The vendor could change the 
> internal EC registers at any time, which would drastically limit the 
> portability and
> reliability of the driver in question. Also, there exists a whole WMI 
> subsystem inside the linux kernel, which for example supports 
> automatic discovery of
> WMI devices, etc.
> 
> Looking at the out-of-tree driver in question, it seems that it does 
> not fully utilize the WMI subsystem. If you want to upstream it, i 
> suggest a rewrite
> to fix this. Since the driver is quite small, it should be relatively 
> easy. Optionally, you could also add support for LENOVO_GSENSOR_DATA, 
> since it also
> has some interesting methods. However, the scope of the driver is 
> completely up to you.
> 
> There are already some WMI-based drivers inside the kernel, maybe 
> they can serve as an inspiration?
> 
> Armin Wolf
> 



      reply	other threads:[~2022-10-15 22:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 22:12 Upstreaming Lenovo tablet switch driver Lorenz Brun
2022-10-15  1:26 ` Armin Wolf
2022-10-15 22:25   ` Lorenz Brun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0NFTJR.N3ZFSHV6AM7A2@brun.one \
    --to=lorenz@brun.one \
    --cc=W_Armin@gmx.de \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox