Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21705616rwd; Thu, 29 Jun 2023 21:26:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4UTrxIfpjhTiVW01jhLOUlca2EUomXrrWKGerF6JgC1X/B6Z3zhQAFWmb9cTlskff6UEF+ X-Received: by 2002:a05:6a20:bf1e:b0:12d:1e21:8960 with SMTP id gc30-20020a056a20bf1e00b0012d1e218960mr1178183pzb.47.1688099179292; Thu, 29 Jun 2023 21:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688099179; cv=none; d=google.com; s=arc-20160816; b=sERjAZd9tm5xZC8USzQj31A3zoPrhHXBS4otnHOZJHQZlp3pLH39+l1pOg8oDYmQlB LeRrq6FHrVIMS/g2FAoII4htLgo684z0hKdvcjtLM6xDouf0XaGvptenOBVkpCrnZb7v 6V8jgFdQAPa25d7lMgZ0i9Oc4zbcwr9euQV8SWmov7767AVqH0T33PNborQ1EGr+WYIu KnKZc/zKo3eW1oWKkg5b1fV5w8ILq7sJJEk/VKz3EL7SYsYAUE5QNxhH7WV4NpgexX2k kouLvcxiRvLIHNSp6v29R0ZkQ9kgvLCco7OxvJmkDrjDOrMZFP8ZoeK2xJ4xy7ziP/4q M0bQ== 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:feedback-id:dkim-signature :dkim-signature; bh=BZ7oSZ7ADhAqExrANywARhivzR2LpwYy+ka8YnAU4tU=; fh=52RqnqzHFu3c3gS8VqgRtcRPBRgGlf5eGe8HkjfR8FI=; b=aYPyilj3tCZTXxqXzaeYuS2h5GzQImg4LNtTJo1YcvNTeZyveo3s7ZV/p8/KgDKox/ kmfFlaeVLzYHlk9CWhy9+w3io7ubAIn4nHvG+1TiX1YjQeGkhnVzU4ULiaktyyK1t+fC /buZdzusOD81syiePnTq7ckZQCxPnys5CIq9OIbcPx8t1+KHayL0FlZig6YxVCRBCuH+ QcUd14saUp/nnKTPQEfY+barOXsQ7VoEoNfYS0TUqyByKfDWVHid4F7ZwTUozBRCQ32A aXF/ojjQwSusCNeL0yrMtHnL6OXXhphRwuFe5jlcO0tfE3amv0V93hTkAMljQiVv1sEZ 9Mug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=wTiKImww; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=WRQdhcNy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a170902779100b001b3a001a0dbsi10967304pll.361.2023.06.29.21.26.04; Thu, 29 Jun 2023 21:26:19 -0700 (PDT) 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=@ljones.dev header.s=fm3 header.b=wTiKImww; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=WRQdhcNy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbjF3ESH (ORCPT + 99 others); Fri, 30 Jun 2023 00:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjF3ESE (ORCPT ); Fri, 30 Jun 2023 00:18:04 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 895D61FE9; Thu, 29 Jun 2023 21:18:02 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3FC123200991; Fri, 30 Jun 2023 00:17:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 30 Jun 2023 00:18:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1688098678; x=1688185078; bh=BZ7oSZ7ADh AqExrANywARhivzR2LpwYy+ka8YnAU4tU=; b=wTiKImwwMnCqcR+Eq8CR0by2NY bI6YWmJRCxn7TJI0w3GG1xU/fZ9kxItzAlmTP/j/I9LTwVq5fKeBkFrJQb4f2Gqn 9oU19ed4o5AHJYBNn1jaEv/IJpPXifC4F7WTPs7Noy32x/R2vklP+2oWwweXm59E y4csHhQUf39Ny1VAtnkfct33xHIR3dkS2shRd2z5wYygNYuFKw2UP2Hpb6jTXtWH m+yX1QhDEWoF+Fu+zIJsy9De41N75ywuwxD2dWbYVcnpj/lSr30HLx4sPowBFSbJ PfSA952qkoZ8Bz6dNgebnM1goAhLxG1MHCsyC47lPkVXrtXVtqrFaowoCCiw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1688098678; x=1688185078; bh=BZ7oSZ7ADhAqE xrANywARhivzR2LpwYy+ka8YnAU4tU=; b=WRQdhcNyWuJWvIheSEdlea5YyVPv8 t+z9Lm9f5bl6oy/SvMxjE/3M+Zj1gK3uWVH83EzZeTi41tMZkrBW1ZAUNQ1siaL7 TYbD1IhuCvv/7FhdR3FAO//THbI0bv/aUrpLxMlcQG9FqZx7pfyfOXMAJ4/CjD9i lXQm/eaRD+h1d3Nt5cJlJ6HXm1+l/ku744P0Y0D8ru4nFFSPFLUIrQgdvMs3ha+x iBqr6RSC0L5wPEU9y5v/FgzaGy23E04QWKoXBgFjvW7AH4A/knZuh6nVvqi615Aj flRoSftBP4l4oh92hDuv4oZMZHEqXF1e/pPde5OintQHVuYVBtOjl7q5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtdehgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtre dttdenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvgeslhhjohhn vghsrdguvghvqeenucggtffrrghtthgvrhhnpedtheekieeggefgleekueeffeejuddvje evuddvhedtgeevfedtueegtedvledtjeenucffohhmrghinhepkhgvrhhnvghlrdhorhhg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhukh gvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 30 Jun 2023 00:17:54 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, markgross@kernel.org, jdelvare@suse.com, linux@roeck-us.net, "Luke D. Jones" Subject: [PATCH v4 0/1] asus-wmi: add support for ASUS screenpad Date: Fri, 30 Jun 2023 16:17:42 +1200 Message-ID: <20230630041743.911303-1-luke@ljones.dev> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org Adds support for the screenpad(-plus) found on a few ASUS laptops that have a main 16:9 or 16:10 screen and a shorter screen below the main but above the keyboard. The support consists of: - On off control - Setting brightness from 0-255 There are some small quirks with this device when considering only the raw WMI methods: 1. The Off method can only switch the device off 2. Changing the brightness turns the device back on 3. To turn the device back on the brightness must be > 1 4. When the device is off the brightness can't be changed (so it is stored by the driver if device is off). 5. Booting with a value of 0 brightness (retained by bios) means the bios will set a value of > 0, < 15 which is far too dim and was unexpected by testers. The compromise was to set the brightness to 60 which is a usable brightness if the module init brightness was under 15. 6. When the device is off it is "unplugged" All of the above points are addressed within the patch to create a good user experience and keep within user expectations. Changelog: - V4 - Fix a null dereference that happened if the display was powered off and dev struct uninitialised yet - Previous: https://lore.kernel.org/all/20230620030033.55033-1-luke@ljones.dev/ - V3 - Refactor error handling in all functions - V2 - Complete refactor to use as a backlight device Luke D. Jones (1): platform/x86: asus-wmi: add support for ASUS screenpad drivers/platform/x86/asus-wmi.c | 128 +++++++++++++++++++++ drivers/platform/x86/asus-wmi.h | 1 + include/linux/platform_data/x86/asus-wmi.h | 4 + 3 files changed, 133 insertions(+) -- 2.41.0