Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1440912ioo; Sun, 22 May 2022 14:48:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+n1QiwU62CXv67Th1dSTLjOecZ4XBMU7fLmSLv2BnosQxPj00N7AiDZ8eHy7XpzuS/xJ8 X-Received: by 2002:a17:906:d550:b0:6f8:60a4:c2cf with SMTP id cr16-20020a170906d55000b006f860a4c2cfmr16683467ejc.477.1653256088506; Sun, 22 May 2022 14:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653256088; cv=none; d=google.com; s=arc-20160816; b=ttcFJhSDZH6wlWxRLxG1LCy0jES/CnDq1kA0I0fXS50uGk/z22OABo9JDmOzia9Isq m3DLSAcgOns4HhSfGB/MGBzZ/NrsnsPVu4MRUX/jARyCh8+xOOTnzTD4HRKIVPLasGWq iXFlxXbxHLmBTeEDjxb2ftkSfxdDjLNofkt8bbgNENFFIJaw9ZKeqkCmdfX9aa+fSE3l e+IzEZ4cDFG0VDkq8hfI4g2vrSkab8qKU89GIAp4XDYFR1QNy2dptBYYad82m8URO9Fs SIAxnNvlGgm8PCGQK6GMflH3r/KGnW9G4IXunb3S49SfCbV5zxQ3SlGDT7ExkKAHZUSS h6Pw== 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=3Bvgb2lQC/lXU1/Ce5R2fdk8VVqr9ldd55Cmvb2FG04=; b=ED+m99aAD7VBSNEEs8DljfByXhwRmqDJ6zEBUjXU/xXYBKfgItOkF0x4ppzSdGr6m9 O5SrcmwF3EtOm7HNsOAKwQC9ddceDiBdAp5/FzAaBJzTkDSLiEZmtj5q6/PusDQwFhF9 DC1/SHs1XhN8VrPRXogW9MGpbT2Zt1kX6x/jAS1PsMIyWxzyuqxKEbASyGiwAmSI4kr3 8Zm4M+6TBAWVB+Pz3JcxVgHSTFw4WptmGfcHHBFoPYZ3F/4LP6nN0mkMt6CxnipwoMfL SYRVrxqJrdDEeHUuPG2tAEJ201aeN11K77+C1CuMzV2YVaAapBa4whWMNaZCgljq5vXy nx6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tnva1bxM; 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 m21-20020a056402051500b00424013eaa32si12364116edv.585.2022.05.22.14.47.42; Sun, 22 May 2022 14:48:08 -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=Tnva1bxM; 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 S1351395AbiETSep (ORCPT + 99 others); Fri, 20 May 2022 14:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343952AbiETSen (ORCPT ); Fri, 20 May 2022 14:34:43 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CD65FF06; Fri, 20 May 2022 11:34:42 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id w4so12575953wrg.12; Fri, 20 May 2022 11:34:42 -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=3Bvgb2lQC/lXU1/Ce5R2fdk8VVqr9ldd55Cmvb2FG04=; b=Tnva1bxMWOKs2UqctZ678Ff8MWwyt7pQaseYZ2MDJ+3GyUDgF5viImh1detkoBd1B6 YKxC2awW4A830XVPDuHwTJzGCWo5E0WuetPzvkDotXPqQoIQQ2R01ix3CfOo5IJRIBqP XSSHC7PvHXaXIlGLSs5ynFI6qWX6T6z4PULIstgeURmE66hXexdQ5grYvSjjTtrIRuOC vr0vjR/KZ9jN8yNIsgbWc2iC9BuqA9A1DTbdNpTw1mlifrqOOYzwn5qLjnwf+vOVSzEB KIA4LEsDxpaKCsAi1DrvxKEuxCWB9S2GpwicMCBI8uO+RxCEbwhA/o/Gic7TRjNO0lLn ELIw== 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=3Bvgb2lQC/lXU1/Ce5R2fdk8VVqr9ldd55Cmvb2FG04=; b=YDRJafk1kipNmVZul7qw7uvFARymDtoa2U53yjfB/WZAkwTlOBt5OVEngO99VRwyVN kuUuSIT5BSg7+D5kq9M2XR49qOXJ3KII5/AwsNeCT8ttUNZ7YYC1xgMY3Egse2uswxxT jluIvRqt+zsheema38J3bJ4Sj4TtdtTI+QJZym6B5ew/KpSxtovNDk+yACRnM1uAjZxP 1moSjgtFQdXpYZSCBNmqp4QJEBxSzODn4tcr5fc/tty+fusP9bR0j84VxcTn5sFCR+Sk i75oT3c2W0pBqL79CQd73VNSz9G7ZXwHF2/JyHz0Uop9UOYpqFhFUk3ecEyLbMBeeZe5 rYvQ== X-Gm-Message-State: AOAM5303IbthLmJKhwyYCLuQmUBdFtYN19m919MC0GNqIv5IDybyGN/6 S3cGZ7sSqLbhDE6upkBZ190= X-Received: by 2002:a5d:68cf:0:b0:20c:ff58:37b with SMTP id p15-20020a5d68cf000000b0020cff58037bmr9412390wrw.448.1653071680604; Fri, 20 May 2022 11:34:40 -0700 (PDT) Received: from xws.localdomain (pd9e5a9fe.dip0.t-ipconnect.de. [217.229.169.254]) by smtp.gmail.com with ESMTPSA id r9-20020adfa149000000b0020e62feca05sm3252081wrr.32.2022.05.20.11.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 11:34:40 -0700 (PDT) From: Maximilian Luz To: Hans de Goede Cc: Maximilian Luz , Mark Gross , Sebastian Reichel , Jiri Kosina , Benjamin Tissoires , Jonathan Corbet , platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/10] platform/surface: aggregator: Add support for client hot-removal Date: Fri, 20 May 2022 20:34:12 +0200 Message-Id: <20220520183422.7185-1-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 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 support for the type cover of the Surface Pro 8. On the Pro 8, the type cover is (unlike on previous generations) handled via the Surface System Aggregator Module (SSAM). As the type cover is detachable, care needs to be taken and the respective SSAM (HID) client devices need to be properly removed when detached and re-initialized when attached. Therefore, this series does three things: 1. Improve hot-removal support for SSAM client devices. When hot-removing clients, subsequent communication may time out. In the worst case, this can lead to problems when devices are detached and re-attached quickly, before we can remove their respective kernel representations. This can then lead to devices being in an uninitialized state, preventing, for example, touchpad gestures from working properly as the required HID feature report has not been sent. Therefore, handle hot-removal of devices more gracefully by avoiding communication once it has been detected and ensure that devices are actually removed. 2. Generify SSAM subsystem hubs and add a KIP hub. On the Surface Pro 8, the KIP subsystem (only that abbreviation is known) is responsible for managing type-cover devices. This hub acts as the controller for device removal similar to the BAS (detachable base) subsystem hub on the Surface Book 3 (therefore we can share most of the code between them). 3. Add the (HID) type-cover clients of the Surface Pro 8 to the aggregator registry. Regards, Max Maximilian Luz (10): platform/surface: aggregator: Allow devices to be marked as hot-removed platform/surface: aggregator: Allow notifiers to avoid communication on unregistering platform/surface: aggregator_registry: Use client device wrappers for notifier registration power/supply: surface_charger: Use client device wrappers for notifier registration power/supply: surface_battery: Use client device wrappers for notifier registration HID: surface-hid: Add support for hot-removal platform/surface: aggregator: Add comment for KIP subsystem category platform/surface: aggregator_registry: Generify subsystem hub functionality platform/surface: aggregator_registry: Add KIP device hub platform/surface: aggregator_registry: Add support for keyboard cover on Surface Pro 8 .../driver-api/surface_aggregator/client.rst | 6 +- drivers/hid/surface-hid/surface_hid_core.c | 38 +- .../platform/surface/aggregator/controller.c | 53 ++- .../surface/surface_aggregator_registry.c | 401 +++++++++++++----- drivers/power/supply/surface_battery.c | 4 +- drivers/power/supply/surface_charger.c | 4 +- include/linux/surface_aggregator/controller.h | 24 +- include/linux/surface_aggregator/device.h | 114 ++++- include/linux/surface_aggregator/serial_hub.h | 2 +- 9 files changed, 501 insertions(+), 145 deletions(-) -- 2.36.1