Message ID | 20230220115203.76154-1-orlandoch.dev@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1264651wrn; Mon, 20 Feb 2023 03:59:16 -0800 (PST) X-Google-Smtp-Source: AK7set+8Iodc4JwxUUZgfTjKiGnahrfRSyrsB0UY2KaYrdoD0IDSpdz3RjBpQHWWL+x1bKtOyEEf X-Received: by 2002:a05:6402:358a:b0:4ae:e5c7:51bc with SMTP id y10-20020a056402358a00b004aee5c751bcmr2557452edc.7.1676894356195; Mon, 20 Feb 2023 03:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676894356; cv=none; d=google.com; s=arc-20160816; b=lX4RcwPGSQr1fhwhegF+qTdDeFEDLSD1jlSc/uJaePRm2wJbLWqKvhlLGexkuptZ1l vkPu28ZhfrcFyfzLRcvzXU0jq6Z4TRRMtxtBEINq1nguL7rz3lno7FCXzvTGFf1inU7+ ZIVTTVE1CxClrE3mifvAXlxNZg2Nqcow6elM1vkQQHQXmtav9vF+nL6eTgWViLHerl0i vexFau+SvIKSTW8Qr9gHgxmncXDAVmGrxd7ZIRl/QEdV2b/9I2EnaNZXQIzBluTSJLZD TLOIPxcP0BVZyjfE5M+WxmL6MTJbCfjunduNJa/PcE1s5AzAerDqKQN9169didjXF13H 7RPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2TPfbnlNgSvn1ZvA1J1UerZgXPq6+WBvVASakrBm5D8=; b=fqPFaSAtQN286aw4cdnu+ihA/CCX+1Y/jUlBrjCMFlXcM6Q5dVsTgRK56sT9X/WoTy ccmo9unBDfslpm3++kpMwfm8BXM4Jtz7HzvUq86nL8zZR1J5/KXvy5lBWFSbbBDfamKd np8T0uCsQ8nW9/QfT6FEJn33BmVBIADXUQjPVJJlZ7Wrj4ZBZl/nQ8KybATWgE/Xubq2 auNdAviJ5MBmfHHOnuio+2COi5krO7lfS/paC5agqomV1OO8s+VWcmxviL+GWmZbrdqB s0CCmSLQ8m0/mSN03j7b0K1YVNqqXAtzGC8a6LSdwx5v1akc5AHb56yD/+pZQYOSNSNo 10fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UzTKs9k0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020aa7c78f000000b004acd080ecc5si13581820eds.98.2023.02.20.03.58.53; Mon, 20 Feb 2023 03:59:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UzTKs9k0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbjBTLw3 (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 20 Feb 2023 06:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbjBTLw2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Feb 2023 06:52:28 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22AC419F1C; Mon, 20 Feb 2023 03:52:27 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id pt11so1721649pjb.1; Mon, 20 Feb 2023 03:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2TPfbnlNgSvn1ZvA1J1UerZgXPq6+WBvVASakrBm5D8=; b=UzTKs9k0xcxuS/x5awRg4ZuYmEF+nloykjmTIywOe5k8fLm/CPfzsCH6pl1m2zE/zo 6Nh7bG/iEcbF4ocMe2agfNVtnchwlsRELooKQV70IjwFr8gNNDuOAZE5yg4+nRE5C4fC /+1Q17Y93dx0VcPv4/qo5PTL/TZbWkII6Q7Mxp+P7UPVUTXj/47PgIErwtLl/qKBeoL2 qZqJp+ggnuMN0KEY2oDmVfr/c30DKtw9ug85d5h5MZWtU6OQt9uqIR77jqeDuGXHl2K0 hnKbRqwvO2ccYq5AUdR12jaMS6mFe2NcNMOWiiOMZlJ6jQo+45Md3NiwqIAWXt2QCdR1 mrCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2TPfbnlNgSvn1ZvA1J1UerZgXPq6+WBvVASakrBm5D8=; b=wQdRkXuxr640VYRIpVESuFZW3mUWY+eDrl26p8USbbMbOhOAPd1mi6k4EcNNVMaFv/ b4VprW9XF+/3mDnIXMvOh3UOFRFGl8uJJj7mvvq8oaabaZ1v1aMVUVH3rhyfjWgI8Xe7 sGCY19ODOjj+smBzfCnIe1dBEV3osXfi+gycQiRYWFe6EOwA2nq7H7llH2GLQpYMpiNa CHba60tms+Gwjud5z3INbaUbpuyGOy2QpRMIA+LaXSLltqZ10AHTWMdsaJS8Bprmxkf+ ibp+d1qBRCz28P13X5qnley14qts6BwSPvPdw97uIh3emmId74VxR/KYTAz5KnZZT+Ik OYLQ== X-Gm-Message-State: AO0yUKWjkh6hltPHkEFPkFlGo9HigEQ+VhT64BycVMsprsK7XBLSsgnY IMHTu7Q77KRahOlGCMU6EoIB4TI6NkCaKg== X-Received: by 2002:a17:903:7c6:b0:19a:a815:2869 with SMTP id ko6-20020a17090307c600b0019aa8152869mr2192376plb.4.1676893946444; Mon, 20 Feb 2023 03:52:26 -0800 (PST) Received: from localhost.localdomain ([202.53.32.211]) by smtp.gmail.com with ESMTPSA id iz17-20020a170902ef9100b001962858f990sm955297plb.164.2023.02.20.03.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:52:26 -0800 (PST) From: Orlando Chamberlain <orlandoch.dev@gmail.com> To: linux-doc@vger.kernel.org, linux-input@vger.kernel.org Cc: Jonathan Corbet <corbet@lwn.net>, Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <benjamin.tissoires@redhat.com>, linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>, Aditya Garg <gargaditya08@live.com>, Aun-Ali Zaidi <admin@kodeit.net>, Kerem Karabay <kekrby@gmail.com>, Andy Shevchenko <andy@infradead.org>, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas@t-8ch.de>, Orlando Chamberlain <orlandoch.dev@gmail.com> Subject: [PATCH v5 0/2] Apple Magic Keyboard Backlight Date: Mon, 20 Feb 2023 22:52:01 +1100 Message-Id: <20230220115203.76154-1-orlandoch.dev@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758351176712209087?= X-GMAIL-MSGID: =?utf-8?q?1758351176712209087?= |
Series | Apple Magic Keyboard Backlight | |
Message
Orlando Chamberlain
Feb. 20, 2023, 11:52 a.m. UTC
This patchseries adds support for the internal keyboard backlight of Macs with Apple's "Magic" keyboard (MacBookPro16,* and MacBookAir9,1), and also documents what names should be used for keyboard backlight leds in Documentation/leds/well-known-leds.txt. v4->v5: - use <tab><space><space> for help in Kconfig - prepend "hid-" to filename in MAINTAINERS v3->v4: - collect reviews from Andy and Thomas - remove now unused hdev member of apple_magic_backlight v2->v3: - remove unneeded header inclusion - use s32 for report value type - remove unneeded null check - don't set drvdata as its never used - prepend "hid-" to module name v1->v2: - drop unneeded remove function - combine set functions - add missing header inclusions - avoid char as argument in favour of u8 - handful of style/formatting fixes - use standard led name ":white:kbd_backlight" - rename USAGE_MAGIC_BL to HID_USAGE_MAGIC_BL - New patch documenting preferred keyboard backlight names v1: https://lore.kernel.org/linux-input/7D70F1FE-7F54-4D0A-8922-5466AA2AD364@live.com/ v2: https://lore.kernel.org/linux-input/20230216041224.4731-1-orlandoch.dev@gmail.com/ v3: https://lore.kernel.org/linux-input/20230217102319.3419-1-orlandoch.dev@gmail.com/ v4: https://lore.kernel.org/linux-input/20230218090709.7467-1-orlandoch.dev@gmail.com/ Orlando Chamberlain (2): Documentation: leds: standardise keyboard backlight led names HID: hid-apple-magic-backlight: Add driver for keyboard backlight on internal Magic Keyboards Documentation/leds/well-known-leds.txt | 8 ++ MAINTAINERS | 6 ++ drivers/hid/Kconfig | 13 +++ drivers/hid/Makefile | 1 + drivers/hid/hid-apple-magic-backlight.c | 120 ++++++++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 drivers/hid/hid-apple-magic-backlight.c
Comments
On Mon, 20 Feb 2023, Orlando Chamberlain wrote: > This patchseries adds support for the internal keyboard backlight of > Macs with Apple's "Magic" keyboard (MacBookPro16,* and MacBookAir9,1), > and also documents what names should be used for keyboard backlight > leds in Documentation/leds/well-known-leds.txt. > > v4->v5: > - use <tab><space><space> for help in Kconfig > - prepend "hid-" to filename in MAINTAINERS > > v3->v4: > - collect reviews from Andy and Thomas > - remove now unused hdev member of apple_magic_backlight > > v2->v3: > - remove unneeded header inclusion > - use s32 for report value type > - remove unneeded null check > - don't set drvdata as its never used > - prepend "hid-" to module name > > v1->v2: > - drop unneeded remove function > - combine set functions > - add missing header inclusions > - avoid char as argument in favour of u8 > - handful of style/formatting fixes > - use standard led name ":white:kbd_backlight" > - rename USAGE_MAGIC_BL to HID_USAGE_MAGIC_BL > - New patch documenting preferred keyboard backlight names > > v1: https://lore.kernel.org/linux-input/7D70F1FE-7F54-4D0A-8922-5466AA2AD364@live.com/ > v2: https://lore.kernel.org/linux-input/20230216041224.4731-1-orlandoch.dev@gmail.com/ > v3: https://lore.kernel.org/linux-input/20230217102319.3419-1-orlandoch.dev@gmail.com/ > v4: https://lore.kernel.org/linux-input/20230218090709.7467-1-orlandoch.dev@gmail.com/ > > Orlando Chamberlain (2): > Documentation: leds: standardise keyboard backlight led names > HID: hid-apple-magic-backlight: Add driver for keyboard backlight on > internal Magic Keyboards > > Documentation/leds/well-known-leds.txt | 8 ++ > MAINTAINERS | 6 ++ > drivers/hid/Kconfig | 13 +++ > drivers/hid/Makefile | 1 + > drivers/hid/hid-apple-magic-backlight.c | 120 ++++++++++++++++++++++++ > 5 files changed, 148 insertions(+) > create mode 100644 drivers/hid/hid-apple-magic-backlight.c Hi, thanks for creating the support for backlight. Is there any reason why not to fold all this into existing hid-apple? I don't think we need separate driver for the backlist, separated from the rest of hid-apple support. Thanks,
> Hi, > > thanks for creating the support for backlight. > > Is there any reason why not to fold all this into existing hid-apple? I > don't think we need separate driver for the backlist, separated from the > rest of hid-apple support. > > Thanks, > > -- > Jiri Kosina > SUSE Labs > As far as I know, hid-apple manages the keyboards and trackpads on Macs. The magic backlight is managed by the touchbar on T2 Macs, so if you wanna integrate the driver in some other one, then it should be the to-be-upstreamed touchbar driver. But when we did that, the MacBook Air 2020, the model which has magic backlight, but no touchbar faced issues. lsusb interestingly shows presence of touch bar backlight even on this model, but backlight is registered at the 0th interface on Air, and 1st interface on the Pros. So, the co-author, Kerem Karabay suggested using a separate driver. Although, the authors may give more detailed reason for the same.
On Fri, 10 Mar 2023 15:36:34 +0100 (CET) Jiri Kosina <jikos@kernel.org> wrote: > On Mon, 20 Feb 2023, Orlando Chamberlain wrote: > > > This patchseries adds support for the internal keyboard backlight of > > Macs with Apple's "Magic" keyboard (MacBookPro16,* and > > MacBookAir9,1), and also documents what names should be used for > > keyboard backlight leds in Documentation/leds/well-known-leds.txt. > > > > v4->v5: > > - use <tab><space><space> for help in Kconfig > > - prepend "hid-" to filename in MAINTAINERS > > > > v3->v4: > > - collect reviews from Andy and Thomas > > - remove now unused hdev member of apple_magic_backlight > > > > v2->v3: > > - remove unneeded header inclusion > > - use s32 for report value type > > - remove unneeded null check > > - don't set drvdata as its never used > > - prepend "hid-" to module name > > > > v1->v2: > > - drop unneeded remove function > > - combine set functions > > - add missing header inclusions > > - avoid char as argument in favour of u8 > > - handful of style/formatting fixes > > - use standard led name ":white:kbd_backlight" > > - rename USAGE_MAGIC_BL to HID_USAGE_MAGIC_BL > > - New patch documenting preferred keyboard backlight names > > > > v1: > > https://lore.kernel.org/linux-input/7D70F1FE-7F54-4D0A-8922-5466AA2AD364@live.com/ > > v2: > > https://lore.kernel.org/linux-input/20230216041224.4731-1-orlandoch.dev@gmail.com/ > > v3: > > https://lore.kernel.org/linux-input/20230217102319.3419-1-orlandoch.dev@gmail.com/ > > v4: > > https://lore.kernel.org/linux-input/20230218090709.7467-1-orlandoch.dev@gmail.com/ > > > > Orlando Chamberlain (2): > > Documentation: leds: standardise keyboard backlight led names > > HID: hid-apple-magic-backlight: Add driver for keyboard backlight > > on internal Magic Keyboards > > > > Documentation/leds/well-known-leds.txt | 8 ++ > > MAINTAINERS | 6 ++ > > drivers/hid/Kconfig | 13 +++ > > drivers/hid/Makefile | 1 + > > drivers/hid/hid-apple-magic-backlight.c | 120 > > ++++++++++++++++++++++++ 5 files changed, 148 insertions(+) > > create mode 100644 drivers/hid/hid-apple-magic-backlight.c > > Hi, > > thanks for creating the support for backlight. > > Is there any reason why not to fold all this into existing hid-apple? > I don't think we need separate driver for the backlist, separated > from the rest of hid-apple support. Hi Jiri, I think we can do that if we modify hid-apple to support usb endpoints with only the keyboard backlight and no keyboard, assuming it doesn't prevent the (not upstream) touchbar driver from using the touchbar backlight interface (and I don't think it will, given hid-apple lets a different driver bind to the trackpad interface of the keyboard/trackpad usb device). > > Thanks, >