mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jafar Akhondali <jafar.akhoondali@gmail.com>,
	jlee@suse.com, mgross@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: acer-wmi: Add support for Acer Helios 300 RGB keyboard backlight
Date: Wed, 19 May 2021 13:05:42 +0200	[thread overview]
Message-ID: <20210519110542.GA24621@duo.ucw.cz> (raw)
In-Reply-To: <e933a326-830c-4df8-eeb0-f8e48a4b9627@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3589 bytes --]

Hi!
> >>> The Acer helios 300 provides gaming functions WMI that is available in
> >>> Windows, however this was not implemented in Linux. The process of finding
> >>> the related method was done by decompiling PredatorSense(official Acer
> >>> gaming functions software for Predator series) and decompiling WQ
> >>> buffers. This patch provides a gaming interface which will then expose a
> >>> character device named "acer-gkbbl". This character device accepts 16
> >>> bytes long config, which is specific for the backlight method. The
> >>> meaning of each bytes ordered by bit position is as follows:
> >>>
> >>> Bit 0 -> Backlight modes:
> >>> 1: Breath
> >>> 2: Neon
> >>> 3: Wave
> >>> 4: Shifting
> >>> 5: Zoom
> >>> Bit 1 -> Animation Speed: from 1 to 9 ( 1 is slowest, 9 is fastest)
> >>> Bit 2 -> Brightness from 0 to 100 ( 0 is no backlight, 100 is brightest)
> >>> Bit 3 -> Unknown. Wave effect uses 8, other modes must use 0
> >>> Bit 4 -> Animation Direction:
> >>> 1: Right-to-Left
> >>> 2: Left-to-Right
> >>> Bit 5 -> Red Color Selection
> >>> Bit 6 -> Green Color Selection
> >>> Bit 7 -> Blue Color Selection
> >>> Bit 8 -> Currently unknown, or not used in known model
> >>> Bit 9 -> Currently unknown, or not used in known model
> >>> Bit 10 -> Currently unknown, or not used in known model
> >>> Bit 11 -> Currently unknown, or not used in known model
> >>> Bit 12 -> Currently unknown, or not used in known model
> >>> Bit 13 -> Currently unknown, or not used in known model
> >>> Bit 14 -> Currently unknown, or not used in known model
> >>> Bit 15 -> Currently unknown, or not used in known model
> >>>
> >>> Filling this config is out of scope for the kernel module, and this module
> >>> only acts as an interface.
> >>>
> >>> Currently, I'm not sure with the method for communicating with user-space,
> >>> but since leds.h subsystem wouldn't fit for complex actions such as this
> >>> complex config, I couldn't find any better method than char dev.
> >>
> >> Thank you for your patch, given that there is no existing kernel
> >> interface which is a good match for the features exported by this
> >> keyboard I'm fine with just having a raw interface where userspace
> >> writes GAMING_KBBL_CONFIG_LEN bytes as you suggest.
> > 
> > Keyboard backlight goes through LED interface (so please cc the mailing list) and
> > no, passing raw bytes to hardware is not an acceptable interface.
> > 
> >> But lets not use a classdev + chardev for this please, you can
> >> just add a binary write-only sysfs-atrribute under the wmi-dev for
> >> this with a name like (for example) gaming_kbd_backlight_config
> >> and then userspace can write to that without needing a class + char
> >> dev just for this single write.
> > 
> > NAK. We have existing interfaces for this.
> 
> I don't think we have existing interfaces for things like wave / zoom /
> neon effects.  I guess this could use the new CONFIG_LEDS_CLASS_MULTICOLOR
> API to set the color + overall brightness, combined with a custom sysfs attribute
> under the led_classdev's device's dir for selecting the things for which there
> is no standard API ?

We do have RGB LEDs, and some of them can do hardware-accelerated
effects. We do have pattern trigger.

We do have other hardware (Mauro is just trying to merge support) that
has limited set of effects.

Yes, some work remains to be done. But no, introducing custom
interface for this is not acceptable.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2021-05-19 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 12:06 Jafar Akhondali
2021-05-14 19:49 ` Hans de Goede
2021-05-19  8:54   ` Pavel Machek
2021-05-19  9:23     ` Hans de Goede
2021-05-19 11:05       ` Pavel Machek [this message]
2021-05-19 11:23         ` Hans de Goede

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=20210519110542.GA24621@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=hdegoede@redhat.com \
    --cc=jafar.akhoondali@gmail.com \
    --cc=jlee@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --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

all inboxes | Powered by JetHome®