From patchwork Sat Aug 17 11:45:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 820107 Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01olkn2037.outbound.protection.outlook.com [40.92.102.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67EDB77F10; Sat, 17 Aug 2024 11:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.102.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723895167; cv=fail; b=m8SCQvD3wOyiihRSeWPiHUZkrbWx1XBf6HyqjPg7NBrflmjdsTcWp1EezUSECZ2xpyXxbSdyP7q/cYNA+LSZeZA0HnvsyxKxJQ/QmgdlgqqjM8et5j0X/VgiAv4R31UVDXmWE21Ooe8bVuu99MMIk/pR7TMhbAHILao+iW0CrWI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723895167; c=relaxed/simple; bh=XINHJZ669k1kZJCm4iIwu6HrdmkZQEmoCqJgIG1jrWs=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=agi2jNj19/Nzn8+gtl6nIav4ottn83SfCqktx9Ry8RTuY8b4moR6XP9wGRQEJQqROdCVa4BT85uMH9mkxKVb4E9ot4UzhWaladHPHmG+lMkqbcww0mkKB+AJeLzMt6X0YYhVAPYDFLRRStVbAtivDghpDTXOk1PGAHpp6X2FwHQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com; spf=pass smtp.mailfrom=live.com; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b=EjDx1ql9; arc=fail smtp.client-ip=40.92.102.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=live.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b="EjDx1ql9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cIoJcUGbBoj8l+xUvFN/PbBBUL1Vst69WDcvE5kLQXBjjvwzo6eRttVrJjURnWLb1Uvzhyju5xyDeyfXt/Bpqn/ksdYB/d+HgmPH/EoaPsJg1X2H8hO6cxoQli61OKf+bDlnfGqR3/dnTt9vN45duLV2QvvYox5bwHbjzbSRL1pCRZog1twwyAYL7ilkXDZNPYBr+vs6/5gBkoEdH75yudVm427rF5qez6g9vO+5ak33QS13va793I0p92+Kycyt0zCcDTRoVu6FYymDTDyGxO5e8+E4H8YdMngkAwvA0VjCZ5bkxAg6y0l87lt0zybAF+wON54rjyPh611h6uopdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XINHJZ669k1kZJCm4iIwu6HrdmkZQEmoCqJgIG1jrWs=; b=tT7cP5FdMWVe23T/RwJp+m9wTBDEv9J/ADSU4YzIng+U3AXofSIqSAzOvNMxUl5LJvsRrlMxfYiMnleQxIttvOdf6Titbzi3YqBwVda8CK0v3gShmU9isz5WOX+Xz/lhtXHc/x+I4INqGWbc6t7RNUIMcZRnvOJObrjef+bBmbylzx+eWbViF7yj1j+XbRgK2jrg7vCHH6apA6guDVuPtyeQBJY0g9tXBIP+dmhOcmYQ24CSWncYuLcBoCJeCQnIxG3vr1Fh2uKoaRsUzjMTeE4MvGoBxn58EKRSUavC32+LH4+r7KqIkOSr6IVr3u54y4sKkcja/eLpxUD6/p95sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XINHJZ669k1kZJCm4iIwu6HrdmkZQEmoCqJgIG1jrWs=; b=EjDx1ql9ELa4pJ0Y/tQgSJWgEjrXo3uYKYS/mLtKyLm3qNzQPrHC6L9+wa4KEy5u+Ms1f/U/H5eUSoBFZ7fgf5MHTbk7gLTZgjnR1Odx3sP5fRxR3P0onSHPmIu63w66x+x5EcasB5HteUSIsdvETA17SLAYTdrD4Uc8M7gmDZxum0A+B20tOzC6L4BzE8rVfpQ0z9Xok2Kss3JoFTG7ijpJASEHrrZ3Nwiu9Mv8zbgrdmmwhoHON8bNvabh0yDBZWYcQ5+puv65MZGK56bUFD/9uHCocC6LxncW+KRdbbROk/uj6l63MPXYnLmvjQnLSIR/aPeiI7G4W48oo3lUyA== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by PN3P287MB0241.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:d2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Sat, 17 Aug 2024 11:45:55 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%6]) with mapi id 15.20.7875.016; Sat, 17 Aug 2024 11:45:55 +0000 From: Aditya Garg To: "tzimmermann@suse.de" , "maarten.lankhorst@linux.intel.com" , "mripard@kernel.org" , "airlied@gmail.com" , "daniel@ffwll.ch" , Jiri Kosina , "bentiss@kernel.org" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= CC: Orlando Chamberlain , Kerem Karabay , Linux Kernel Mailing List , "linux-input@vger.kernel.org" , "dri-devel@lists.freedesktop.org" Subject: [PATCH v5 1/10] HID: hid-appletb-bl: add driver for the backlight of Apple Touch Bars Thread-Topic: [PATCH v5 1/10] HID: hid-appletb-bl: add driver for the backlight of Apple Touch Bars Thread-Index: AQHa8JsF83YbRhsklUG3gMBE1GAA6w== Date: Sat, 17 Aug 2024 11:45:55 +0000 Message-ID: <8D04A2BD-7854-49E7-A0AA-DEAAB537F1DC@live.com> References: In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [a+QqwrX4jBFXAe5AcByVf2E2/IC8Jiy6bN8ynl2OvQObASb6qKvo8Q4f7iAbqr3BV2/C6I4TrFk=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|PN3P287MB0241:EE_ x-ms-office365-filtering-correlation-id: 2c3b28e4-12db-4e23-7925-08dcbeb22784 x-microsoft-antispam: BCL:0; ARA:14566002|461199028|15080799003|8060799006|19110799003|440099028|3412199025|102099032; x-microsoft-antispam-message-info: MJ3jlGqkI2NLwFkOc65wJB+iyN1COyppNlQ6E5H2PSPsj3XRQOkoZbV8wS4UxRpx3zmcMJWA6bnMvQ+qXbjDQ5OnX7an9I/P+2rrJ1REnrShtD6lu44P7W+XVmmuX8ihMSbASu/URlhb3Ezex1i1csCaanO4H9sMLUTl9nrBY3fsSR+z6QdM9gP/c5m9lprEA6a6r5ev06rcAMMrvaVC25+GIgKCLiNK5fJbi//Rt16J2rPFLR06K9mPO+0GTfDHdowe/k3WBmP5A9JYcvNGyl+b5kzvNXa5MIKwUX2qLMyqsTaSQOsGZeO7Bjjo5EXSaKYF5x62tIjBjVaidVAFNoYb30SThfVPTWN/ukcjwbXvLDcSS5uV0aGz8up609M1mDArzeKJNWGePM1p14aqV5cfFYE6KHwbHFNvVd7m36t1UKci/k8+to0e4nB4VezNwLN4GfgdJMeZneVbYILDTiKHQYg7ZuTpIKzXitQfrsJqaPFOeZdxEV+3nYOVggIvJ7BQ8SHjLGAI/dfE+joHSojgrc9rBfn7O3zwBPPNTsGqobtdW8Qn61ObCNFGpml3JEd89Gi+YS1AiuQ6B2+GK+x/zpt5iKTakwC8XNb80lOQ729M6JpmRLbcvK/JN/Bk7pyJIDwzHIYIjoVUDfQzYNn2zQfjOnHVJrcFvLeYnuLRhc+yrN22PTiuUMQI7SCh x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?ry2j3oDq+c1RYsBV/vwKAN35edNR?= =?utf-8?q?QTRAHznHmt8HiGo0AwWxKh1cSisqngfQYieMAptmVyzLMTc0xGb+jJyqlXKmjXaro?= =?utf-8?q?KeRciUJx6wwME1/qJeTr0PH79a7iTejVlPIYuK2f5PqLlIUvDXxZPkcHsnzE8h8QI?= =?utf-8?q?0/shdrk+3orFAxJCpdXVhObjM//AlPrP/c2AeQGOVI4lfqbD3pmZzpXg4JRdODQfC?= =?utf-8?q?FxxU7F6rIjqj4YbT4o8v7CHChkHr5Qmqu4v7Iqke1yjuXRGijLQ0bUPvfO5ZbMWea?= =?utf-8?q?MEewP2OaA2wtecSkVBZNXmhVdj1PzgmsPVCtGVe+zfKhZRtsARw0PQfD36FiY0dB2?= =?utf-8?q?EObz+ReqQKIriXiL5m69N7Hi2i/5U9PUFoe4/uFFuuJG8wDZ5id2u7ZQuIwf6SMRo?= =?utf-8?q?fFIzxnaUoYpG/Na9fn1md5cRnwWyNEBZT06ZHX+NVgltCPqGnHc7OGy8rXz4/NMmh?= =?utf-8?q?242xh794YrKISc+kbmP0pijAZhUQVxqfLpM0jRY63gRbPpQIZsyCO52gfqvEs5Nx8?= =?utf-8?q?6ErH4lIFzC4gM6NX+VOgfxRpTH/l/QQcLlc+Xco1HUa5HomHDFicA2xYjdOcOFPw6?= =?utf-8?q?xgCVTU2BQh3L8b9tMs/ZfAMPaag372vVM2SVhTbKNsB+90VMh9hSbr6hxOkTbpAej?= =?utf-8?q?QlYfOhz+BFp68vkClIF8obKR/4dUkUuioofcQRt0YsbEnnpENPKCE1zdZxknhhg5h?= =?utf-8?q?CDraQyUII6EN/GlkaXWzAxg+TO1WOKACdAvLJCL9m/XGkjbq4L+bgcVKn2zbtP533?= =?utf-8?q?A+EB1hGE4PjvjZC3IOHH2b7tR5UZEDOquaybXEdjZrQHomeiv8NteuUqJGTUuD/HF?= =?utf-8?q?kAKYQ8S3celtEHio/u9djXPI6u/3m3rg09LigyXflRaEg8nIm9UM6AJRe3Khkw4so?= =?utf-8?q?WWSRt6LnHglqbmvaRlBrXDjae5SFCWZnJLskYcJfIFONI7N0QRpPULHEQgTA9ZPL+?= =?utf-8?q?sAPZGrMUYQfAQ2/V6abpS8o9xrtwTLl42VIdI+R8OAF5n2YeWdDcM1xGtIg/PJp5M?= =?utf-8?q?bZ5oPZ4I5P0H2BEz7ijbIixrn8rz9kRFZk/DGPmkuvupp/yPAZnz34eq2MfMj9Btp?= =?utf-8?q?jpBkkVN6onv3bQPGPtRCly6jT415O5v1IYuj81zdD8d5au3AjcJdxsUvrx8sXf/Wx?= =?utf-8?q?OPbQs4SimC4a2bE+3IBVSxoQ9XPCDQEPH8FnukqNuEC6lCVwOKCV7S1QZEYW1H/Ff?= =?utf-8?q?XpFhiwdNBO9Ba7E3L6yK3RKKRkwaigGUdO8GYoDorsb8PQXWwbyZg58Ogh8akRX0B?= =?utf-8?q?0v/qpMjykQ3HcHcW?= Content-ID: <4B7BD82D27AB7B46B028F174162E5D2A@INDP287.PROD.OUTLOOK.COM> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-24072.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB0217.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 2c3b28e4-12db-4e23-7925-08dcbeb22784 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Aug 2024 11:45:55.6085 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN3P287MB0241 From: Kerem Karabay This commit adds a driver for the backlight of Apple Touch Bars on x86 Macs. Note that currently only T2 Macs are supported. This driver is based on previous work done by Ronald Tschalär . Signed-off-by: Kerem Karabay Co-developed-by: Aditya Garg Signed-off-by: Aditya Garg --- drivers/hid/Kconfig | 10 ++ drivers/hid/Makefile | 1 + drivers/hid/hid-appletb-bl.c | 207 +++++++++++++++++++++++++++++++++++ drivers/hid/hid-quirks.c | 4 +- 4 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 drivers/hid/hid-appletb-bl.c diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 08446c89e..4988c1fb2 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -148,6 +148,16 @@ config HID_APPLEIR Say Y here if you want support for Apple infrared remote control. +config HID_APPLETB_BL + tristate "Apple Touch Bar Backlight" + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want support for the backlight of Touch Bars on x86 + MacBook Pros. + + To compile this driver as a module, choose M here: the + module will be called hid-appletb-bl. + config HID_ASUS tristate "Asus" depends on USB_HID diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index e40f1ddeb..1d825a474 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_HID_ALPS) += hid-alps.o obj-$(CONFIG_HID_ACRUX) += hid-axff.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_APPLEIR) += hid-appleir.o +obj-$(CONFIG_HID_APPLETB_BL) += hid-appletb-bl.o obj-$(CONFIG_HID_CREATIVE_SB0540) += hid-creative-sb0540.o obj-$(CONFIG_HID_ASUS) += hid-asus.o obj-$(CONFIG_HID_AUREAL) += hid-aureal.o diff --git a/drivers/hid/hid-appletb-bl.c b/drivers/hid/hid-appletb-bl.c new file mode 100644 index 000000000..819157686 --- /dev/null +++ b/drivers/hid/hid-appletb-bl.c @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Apple Touch Bar Backlight Driver + * + * Copyright (c) 2017-2018 Ronald Tschalär + * Copyright (c) 2022-2023 Kerem Karabay + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include + +#include "hid-ids.h" + +#define APPLETB_BL_ON 1 +#define APPLETB_BL_DIM 3 +#define APPLETB_BL_OFF 4 + +#define HID_UP_APPLEVENDOR_TB_BL 0xff120000 + +#define HID_VD_APPLE_TB_BRIGHTNESS 0xff120001 +#define HID_USAGE_AUX1 0xff120020 +#define HID_USAGE_BRIGHTNESS 0xff120021 + +static int appletb_bl_def_brightness = 2; +module_param_named(brightness, appletb_bl_def_brightness, int, 0444); +MODULE_PARM_DESC(brightness, "Default brightness:\n" + " 0 - Touchbar is off\n" + " 1 - Dim brightness\n" + " [2] - Full brightness"); + +struct appletb_bl { + struct hid_field *aux1_field, *brightness_field; + struct backlight_device *bdev; + + bool full_on; +}; + +static const u8 appletb_bl_brightness_map[] = { + APPLETB_BL_OFF, + APPLETB_BL_DIM, + APPLETB_BL_ON, +}; + +static int appletb_bl_set_brightness(struct appletb_bl *bl, u8 brightness) +{ + struct hid_report *report = bl->brightness_field->report; + struct hid_device *hdev = report->device; + int ret; + + ret = hid_set_field(bl->aux1_field, 0, 1); + if (ret) { + hid_err(hdev, "Failed to set auxiliary field (%pe)\n", ERR_PTR(ret)); + return ret; + } + + ret = hid_set_field(bl->brightness_field, 0, brightness); + if (ret) { + hid_err(hdev, "Failed to set brightness field (%pe)\n", ERR_PTR(ret)); + return ret; + } + + if (!bl->full_on) { + ret = hid_hw_power(hdev, PM_HINT_FULLON); + if (ret < 0) { + hid_err(hdev, "Device didn't power on (%pe)\n", ERR_PTR(ret)); + return ret; + } + + bl->full_on = true; + } + + hid_hw_request(hdev, report, HID_REQ_SET_REPORT); + + if (brightness == APPLETB_BL_OFF) { + hid_hw_power(hdev, PM_HINT_NORMAL); + bl->full_on = false; + } + + return 0; +} + +static int appletb_bl_update_status(struct backlight_device *bdev) +{ + struct appletb_bl *bl = bl_get_data(bdev); + u8 brightness; + + if (backlight_is_blank(bdev)) + brightness = APPLETB_BL_OFF; + else + brightness = appletb_bl_brightness_map[backlight_get_brightness(bdev)]; + + return appletb_bl_set_brightness(bl, brightness); +} + +static const struct backlight_ops appletb_bl_backlight_ops = { + .options = BL_CORE_SUSPENDRESUME, + .update_status = appletb_bl_update_status, +}; + +static int appletb_bl_probe(struct hid_device *hdev, const struct hid_device_id *id) +{ + struct hid_field *aux1_field, *brightness_field; + struct backlight_properties bl_props = { 0 }; + struct device *dev = &hdev->dev; + struct appletb_bl *bl; + int ret; + + ret = hid_parse(hdev); + if (ret) + return dev_err_probe(dev, ret, "HID parse failed\n"); + + aux1_field = hid_find_field(hdev, HID_FEATURE_REPORT, + HID_VD_APPLE_TB_BRIGHTNESS, HID_USAGE_AUX1); + + brightness_field = hid_find_field(hdev, HID_FEATURE_REPORT, + HID_VD_APPLE_TB_BRIGHTNESS, HID_USAGE_BRIGHTNESS); + + if (!aux1_field || !brightness_field) + return -ENODEV; + + if (aux1_field->report != brightness_field->report) + return dev_err_probe(dev, -ENODEV, "Encountered unexpected report structure\n"); + + bl = devm_kzalloc(dev, sizeof(*bl), GFP_KERNEL); + if (!bl) + return -ENOMEM; + + ret = hid_hw_start(hdev, HID_CONNECT_DRIVER); + if (ret) + return dev_err_probe(dev, ret, "HID hardware start failed\n"); + + ret = hid_hw_open(hdev); + if (ret) { + dev_err_probe(dev, ret, "HID hardware open failed\n"); + goto stop_hw; + } + + bl->aux1_field = aux1_field; + bl->brightness_field = brightness_field; + + if (appletb_bl_def_brightness == 0) + ret = appletb_bl_set_brightness(bl, APPLETB_BL_OFF); + else if (appletb_bl_def_brightness == 1) + ret = appletb_bl_set_brightness(bl, APPLETB_BL_DIM); + else + ret = appletb_bl_set_brightness(bl, APPLETB_BL_ON); + + if (ret) { + dev_err_probe(dev, ret, "Failed to set touch bar brightness to off\n"); + goto close_hw; + } + + bl_props.type = BACKLIGHT_RAW; + bl_props.max_brightness = ARRAY_SIZE(appletb_bl_brightness_map) - 1; + + bl->bdev = devm_backlight_device_register(dev, "appletb_backlight", dev, bl, + &appletb_bl_backlight_ops, &bl_props); + if (IS_ERR(bl->bdev)) { + ret = PTR_ERR(bl->bdev); + dev_err_probe(dev, ret, "Failed to register backlight device\n"); + goto close_hw; + } + + hid_set_drvdata(hdev, bl); + + return 0; + +close_hw: + hid_hw_close(hdev); +stop_hw: + hid_hw_stop(hdev); + + return ret; +} + +static void appletb_bl_remove(struct hid_device *hdev) +{ + struct appletb_bl *bl = hid_get_drvdata(hdev); + + appletb_bl_set_brightness(bl, APPLETB_BL_OFF); + + hid_hw_close(hdev); + hid_hw_stop(hdev); +} + +static const struct hid_device_id appletb_bl_hid_ids[] = { + /* MacBook Pro's 2018, 2019, with T2 chip: iBridge DFR Brightness */ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT) }, + { } +}; +MODULE_DEVICE_TABLE(hid, appletb_bl_hid_ids); + +static struct hid_driver appletb_bl_hid_driver = { + .name = "hid-appletb-bl", + .id_table = appletb_bl_hid_ids, + .probe = appletb_bl_probe, + .remove = appletb_bl_remove, +}; +module_hid_driver(appletb_bl_hid_driver); + +MODULE_AUTHOR("Ronald Tschalär"); +MODULE_AUTHOR("Kerem Karabay "); +MODULE_DESCRIPTION("MacBookPro Touch Bar Backlight Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index e0bbf0c63..818d41a35 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -328,7 +328,6 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) }, #endif #if IS_ENABLED(CONFIG_HID_APPLEIR) @@ -338,6 +337,9 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL5) }, #endif +#if IS_ENABLED(CONFIG_HID_APPLETB_BL) + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT) }, +#endif #if IS_ENABLED(CONFIG_HID_ASUS) { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD) }, { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD) },