Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp697640iog; Fri, 24 Jun 2022 12:00:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8qCT1Q7537nSkTE9yknA4aX4LH34Ngj++IeQZa7cfJOvKF8KU7b2nFpwu12AT3WhZvC17 X-Received: by 2002:a17:902:ef50:b0:168:f0ef:a9bc with SMTP id e16-20020a170902ef5000b00168f0efa9bcmr627102plx.14.1656097221541; Fri, 24 Jun 2022 12:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656097221; cv=none; d=google.com; s=arc-20160816; b=tLeSA5x/39Xhxz7a4xpC2GgTk+h8s1xSnhFygH1DbrHFU+s7H7eYP2P2jO3ocyABZs UFMrfb+Z8WhXZIvpkpJtDb+37bQDNFWFn4aB107PrLQ+iNabxDhvxLclMhQ32ESgDH+4 B/CuF9dzhU4j7DTkppmFFixQogkuxbhtAHsfBk0/Va3llHcVwoHY1zIybrzbsgwX96x3 CndMUGBpder8Iv8jXJBO28FsVq6n6kGiI3fwRX7ewpwgWNxtWyR2LmteuWsMSAequHlE bI7ITTjKne2kCeU1uutcD1lq0pkeThH0KTfjvPbV4UFSWy+7Zkb1vaX264LdFN8SaYiT BoYw== 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=R7x+93/bf/OFy0gtgD7o9zovjDkSW2Dr+HMDRLcG03E=; b=PkLX7Ee0NNSvEqsQFuVfYD2zzxJhxCgewjSbr6fll284QCc8qjC3j3Ep3D/BlWthxK EWE045638bJTTRKGy1OPImtyAEoTJbKjw4HUcLGXcqQ5PoX9ZPw3EmDyniIrihXFe5tN 5z8Tu5x2mOdfqpZJKqti2YMXbv6vdskVBmseh3TRV/T8hFlFjiFz3gQzHPJrpaopchth 61Umw6uolSjPbD8WRi8UaQlaokUajvHVlT+G8dfOkcYWp9Fxvp+soJFI3SEAcJw8k9lG ekcw+2IgVPRLmQ792KCF8axcA2VY+V/LEdLnoS8Z3p4EL3yId36E9v0uC5w3FcCaOS03 92Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UBwZQNMd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go18-20020a17090b03d200b001cd51f48295si3464780pjb.174.2022.06.24.12.00.09; Fri, 24 Jun 2022 12:00:21 -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=@gmail.com header.s=20210112 header.b=UBwZQNMd; 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 S230487AbiFXShE (ORCPT + 99 others); Fri, 24 Jun 2022 14:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiFXShC (ORCPT ); Fri, 24 Jun 2022 14:37:02 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7516B80507; Fri, 24 Jun 2022 11:37:01 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id g26so6391086ejb.5; Fri, 24 Jun 2022 11:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R7x+93/bf/OFy0gtgD7o9zovjDkSW2Dr+HMDRLcG03E=; b=UBwZQNMdfo8T1yoq3GvmXbSulJCGmOEiLiJslZupN8Vsv1vKmyEAa8FpFSp5w8lDVt gD1+oEJ/u4JQa5z6mv2+rrUWaItISlPOp1Ni2ByexriZl1+UmYQ463CNS3B5QBIU/Wur /DM6EKKWLLtJdzxXqrCkH2/umepgecr9rOBlfidU9M73txE6LOwntNlezSTuhmbHMPdx 4Qc6K17jBxKm6fp1HViA6J4ZJtzCmkAVMhhZiIxeHu9+Z4B9CJeM+4vwDgIOaYWE3lzT Tkcm+ADukm2KPWjmfsXI8lxcR2sM8SV7mNDkei9rC7hGIiMGZM9VZyIV+PJKelhr702n U6eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R7x+93/bf/OFy0gtgD7o9zovjDkSW2Dr+HMDRLcG03E=; b=1pz6H0JE0O8fxcJYUzEwzsZR7zcl+uSZRK6jlyAmEMwqt8eHwDC1rCgaCCIbz6quXw pEc6iMZc9Bg0eJEgon80J8tUOwlQYpc+SFuGNzWJuhXgfXxMsPrvC4gj+nPJGr4kp64S rHvyCI5AUWX7FRg/BpQwRbSFVOXRTeMnfeUooWbfhsFBl8vVL+aiTTq8iNZFZ40VxaZ8 XHmdwWhWJ4JvUzt1t0HkrU/3YjpgwgBQm42Wx6fH3yata10yGgSB/Utcf7c5a+CS6801 7e6HuNiO0WLR5F2BhILAzKSQWoY36o8wBZA4iN2p35ZCf/HyACcefC4IrcHhLblw5KZL A2ug== X-Gm-Message-State: AJIora/kCtj7/lPN6jzLkX+T4pJttNG7sWn+aKe+l3fHz/7dvgbRYd/G 3tCY8KnMsAZp7g9Ob0Fx1K+2bBgVsEo= X-Received: by 2002:a17:906:4f:b0:712:af2:29d9 with SMTP id 15-20020a170906004f00b007120af229d9mr320542ejg.751.1656095819920; Fri, 24 Jun 2022 11:36:59 -0700 (PDT) Received: from xws.localdomain ([37.120.217.162]) by smtp.gmail.com with ESMTPSA id jw12-20020a170906e94c00b00722e8827c53sm1493822ejb.208.2022.06.24.11.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 11:36:59 -0700 (PDT) From: Maximilian Luz To: Hans de Goede Cc: Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz Subject: [PATCH 0/4] platform/surface: Add support for tablet mode switch via Surface Aggregator Module Date: Fri, 24 Jun 2022 20:36:38 +0200 Message-Id: <20220624183642.910893-1-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.36.1 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,T_SCC_BODY_TEXT_LINE 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 This series adds a driver providing a tablet mode switch on the Surface Pro 8, Surface Pro X, and Surface Laptop Studio. These devices provide posture information via subsystems of the Surface Aggregator Module (SAM; embedded controller). While the specific subsystems used for the Pro and Laptop models differ, large parts of the respective subsystem drivers would be equal. Therefore, we essentially provide a generic framework for tablet-mode switches via the Surface Aggregator module and use that to implement specific support for the KIP and POS subsystems used on the aforementioned devices. In addition, this series first introduces some helper macros for synchronous stack-allocated SAM requests used in the subsequent patches, extending the already existing ones. Further, this series adds the respective firmware nodes to the Surface Aggregator Registry. Maximilian Luz (4): platform/surface: aggregator: Add helper macros for requests with argument and return value platform/surface: Add KIP/POS tablet-mode switch driver platform/surface: aggregator_registry: Add support for tablet mode switch on Surface Pro 8 platform/surface: aggregator_registry: Add support for tablet mode switch on Surface Laptop Studio .../sysfs-bus-surface_aggregator-tabletsw | 57 ++ MAINTAINERS | 6 + drivers/platform/surface/Kconfig | 23 + drivers/platform/surface/Makefile | 1 + .../surface/surface_aggregator_registry.c | 15 +- .../surface/surface_aggregator_tabletsw.c | 533 ++++++++++++++++++ include/linux/surface_aggregator/controller.h | 125 ++++ include/linux/surface_aggregator/device.h | 36 ++ 8 files changed, 795 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-surface_aggregator-tabletsw create mode 100644 drivers/platform/surface/surface_aggregator_tabletsw.c -- 2.36.1