From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5888F4AE8C2 for ; Thu, 1 Oct 2026 08:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790844145; cv=none; b=ANc+9bkmwTTDHQyg1oJ8KC0npgQAOsop4eKOwzQqTHtUusi0HiJcCOVkQKy6K0dYhrF7jH6dsWeoUs8rPGDiZPT99cVLoQ6EvX+6Z6i132KY1i94GFJWnxEO7zbXwh99NkhVproUj2LqLuxZSjnIlbsuGIe03uHE4s6T82vO1Ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790844145; c=relaxed/simple; bh=06Ox9IKJfXy8MQZ0xbbIOMeArMq0Aj3o7lfzFRx0NOw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NRPqUVQrger23wr4tP23xZJBBu6ceInUEAA01xcqM2SpSj/AmoU7Q4Nact04Ojmw9EB+q4ASH/INNwLDMnsVq4b8otxI8iDZYlcYySQzjoYPkvMZVoxMLXYB1FsPH159xGnoY/pi5BTjkG1g/S7PoOo/6IID3xginNxwYD+Nc5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SayuldGs; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SayuldGs" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49ffbd83a92so40418125e9.0 for ; Thu, 01 Oct 2026 01:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790844140; x=1791448940; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=lQPK/Y342DWum5zvJ87J6VdcruASwjM7cysQ73g4EIA=; b=SayuldGsM4Iy9hlC/nPdZs93lfx2KT3tBfSUx9eRfGB9RL3qqRdo+n6AqVbyIhwE3g QJMOeFQi7mOoMfpS4OaJ2abAsVQMddOwtlfm568hdbBSwG+95Izex1bLHmBBdjcxnZBu FsE6rFWNPO2FrwIOt+xYMlDAYYFaUuEAo+8CriN8Oy6dOmlxhoGPONbBdYdwezjAIjJu zrdT2xiZ4ozn/PR6az97n5clJt/GEqa5aAA8BubGJGzQBApITsvpAnaIFmcUznaO/I1V B7F5KS9MZvpXwja9zYZfDlbfdnPlMSPpiOq4BhpyztZ4jT/x68zG7K1OI6cxRsO5T/MX 6DZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790844140; x=1791448940; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lQPK/Y342DWum5zvJ87J6VdcruASwjM7cysQ73g4EIA=; b=PF5yq/v+7M4RMuRXHJFDjeiFh2C7J1shUI6E+M5IGFZaJpMRyOBjwhvCSHg+7JhenO we3DFe9h98G7pt9cUkQ2I1Sk/Oo5NfbnAHwQ/qp1W92BuKISMFmng7bYow6hZyPIU7zk CzRXL4XYtX+CUaAZvY3ksMDO/jEXvvid+YU7+4zFavnoygHp4RWRHtCGApRrLGliQ5+0 BHHKfowG216lI9OYuOU0XqJhCR2bjyJwKTqhyAhefJ6y3I7ECDAGvCoS/BNbKsIyk55I dlFT+MkpkEgVEZnoKojHfTVj4p/DTnMFVOjmr6cHAjzU2FLCsfzeLP+jjZ/Ads3/fK8I HmhA== X-Gm-Message-State: AFuF++loaTszflsZ6G7V9JAhZK8+9lJ8CTxL33u/HAMmMAtVTq7Lf7gN ZpV4UVBC0GNKX0fa9OzCz/tWz3HLD1076/wuHedNjbICrzeN7BNJ9t7Vk14GCA== X-Gm-Gg: AYBFou3q4koHH8PdiDCKUpT1Ayk6lrZvYKbjnSrYWltwD8EYP+gjqKI2SbMQqmWMQYO ByvnQwe+ZxLynfZhLZF2PGe26w93LXFtw8qUlr9GbGQOqaXL6CZqgeePDCRVaxsEImvVot+O9Hn ICqoq1mN2hrmEI33g1uP6468wJqapJzQrLpP9fFZF2qngbf8oeRqSnLPOmJ4X7E/1Pv4wkv2aeY CpHgJH28zOl3PtUWyormW3s3aWB0ykdTZZbco4xst1ykwHMrU7pTj2ussrBk42obQARSkScLyMa 6c6ypegSn4VmKGgdPnnxkV/imTZFjV9gZyUKzLesxXBlS8voqSMksh55ryuKGc+6T6Y15eks0Pb I9EIkYsilbNP8iDxHFPqwqZQ7rAnuCjgXQ0+yn/28nxblsOq87/IDIZB0Z0h/Y44HIbC0owAHya +2nD8pVJmCGtiPxb/B1wE+Zy8mL351YyBJE0KKkIaCZ3+PRoyZN6eDHRxEpemrFigylelDHbD2x mWFQN3OaA== X-Received: by 2002:a05:600c:4f8e:b0:49f:bd3c:bc18 with SMTP id 5b1f17b1804b1-4a01b00541bmr62101135e9.19.1790844140215; Thu, 01 Oct 2026 01:42:20 -0700 (PDT) Received: from fedora ([213.55.185.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a01f98f72fsm47380385e9.11.2026.10.01.01.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 01:42:19 -0700 (PDT) From: Michal Szpakowski To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: =?UTF-8?q?Ronald=20Tschal=C3=A4r?= , Aditya Garg , Lukas Wunner , stable@vger.kernel.org Subject: [PATCH] Input: applespi - turn the keyboard backlight off across suspend Date: Thu, 1 Oct 2026 10:41:54 +0200 Message-ID: <20261001084154.4703-1-michi.szpakowski@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The keyboard backlight of the SPI topcase stays lit through s2idle: the driver's suspend handler only switches the caps-lock LED off, and the backlight LED is registered without LED_CORE_SUSPENDRESUME, so the LED core never gets to blank it. Under deep (S3) the rails go down anyway, which is why it only shows on machines that default to s2idle. Set the flag. The LED core then sets the brightness to 0 before the device suspends and restores the previous level on resume; the LED is a child of the SPI device, so the command goes out before applespi_suspend() drains its writes and disables the GPE. Tested on a MacBookPro13,1 (2016): 30 s of s2idle with the backlight at 200/255 leaves it lit on the stock kernel; with the flag it goes dark at suspend and is back at 200 on wake. Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver") Cc: stable@vger.kernel.org Signed-off-by: Michal Szpakowski --- drivers/input/keyboard/applespi.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1772,6 +1772,7 @@ applespi->backlight_info.name = "spi::kbd_backlight"; applespi->backlight_info.default_trigger = "kbd-backlight"; applespi->backlight_info.brightness_set = applespi_set_bl_level; + applespi->backlight_info.flags = LED_CORE_SUSPENDRESUME; sts = devm_led_classdev_register(&spi->dev, &applespi->backlight_info); if (sts)