Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp42370lfb; Wed, 29 Jun 2022 16:52:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1urEZJagUAUvozElmnyZ9N6nkVh7h0PasfLWawRrdEFhNgev1M+U2V/gYKxzIjhqQMhDgIT X-Received: by 2002:a17:906:9c82:b0:6e1:1d6c:914c with SMTP id fj2-20020a1709069c8200b006e11d6c914cmr5607083ejc.769.1656546749680; Wed, 29 Jun 2022 16:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656546749; cv=none; d=google.com; s=arc-20160816; b=kDOT3EohwR1fzuJ3pi9U48kJAMEK6FkGxOep68k2VMs2YyLECHj+G3Oc6/1TtG8Uc4 FaYPXAXOi6uHzrXaf6MW0ygjxUIkUVvxK5ncBlsJkacUmEnXt4Drrfeu7psbyCP78Lu7 xl5SKQOXwHkV7XYTWkaCOAeA8K/CJb0WQKjksWUMnLYY98FWonwGvX4iWGglxbkZaGFX SGihN9dR49a1c/Gv8KIFecDKEjwY0LWNcJAWJwgeCuwLWe3bt4dW6Eww4Y7YVetH400B ma4gueaOPn4TF15/SFYakGVjKy+0A8xVU/g6y7qG6SBsOKyg14XCWUrK1bDbNUFskHwY 6PSg== 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=NsipExiNrrBArXSMUQqN1JMJ/FxaIb/dWMMG0KzbrOs=; b=li8mfw7NFxnFMUV0+PGoOmwhH7W8MH2lLy4d7H64zWUubc+clic14gvvS39rLw0LE7 Wbngcahs3+L2Ozc5Xed0hK21hQWR2zAw6Zkhg9LVqtWxWQYdovTWMa0p3nM6pEHBh8oq OiwN4zJCduvyroFrnjo3mFFmxdj/umQHFnEJ0xua4YcRcyJblO5BHJp410jzfkDHP5d/ VsYROU9ouvSB7uvwPKVaML3lB4uI6fe7sZmo/AvIMajgJdMq0hHymIuILOjy/kp+Egfd 7DCApAiHqemq0quYdDYKTTtsej+8H2m1evp6dx+OhCwG0MqqhhttEZ6LiyHxp6igy4Ra iZKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SKirdDWU; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m22-20020a509996000000b0043579ad55f1si19262237edb.94.2022.06.29.16.51.36; Wed, 29 Jun 2022 16:52:29 -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=@chromium.org header.s=google header.b=SKirdDWU; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbiF2XeE (ORCPT + 99 others); Wed, 29 Jun 2022 19:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbiF2Xdl (ORCPT ); Wed, 29 Jun 2022 19:33:41 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C6F96546 for ; Wed, 29 Jun 2022 16:33:27 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id s206so7777226pgs.3 for ; Wed, 29 Jun 2022 16:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NsipExiNrrBArXSMUQqN1JMJ/FxaIb/dWMMG0KzbrOs=; b=SKirdDWUbEM76rroMI+QFGcjo0pejKbbRpxDG17OH945v0BbXptuePFWmUkJdnAjDC S2EtS1whCoRGxKcli1T6cnbE4abqW5bDlGUTDrhNt8ay53FxRSaV/ejtnhfaORpv9NCG reeo1rMi9rtgrltdEO9o+VyWwTH8lMHh0bRjA= 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=NsipExiNrrBArXSMUQqN1JMJ/FxaIb/dWMMG0KzbrOs=; b=H6UD+J2He3xvDHwWlyDv17Y/LYrJH1kFc/SIhQPjG0sQfKOJml3nc1x5M8HcWPT2eY m6tRbCiwY5MNYGHgzvM0MhDW1uPKLOd9qPaFnVVBB6SX/3nnMc1lqi1LMhhU5UOcz+sf y+Ok0tTmbKloFYT4cjdYqSXTZgsmc34kchs9pZPve6ryM8Y4rhgdkerPirLhIK3wDxju yi1lhVg/WWr9+GWfa2GdfTmyyKVkF0e4GheJeh6ptBUoTtRunY0oeiB1BHykWk8H+l5q ByM9A8UBN+L0HAt8NldYlb/keHHhVakA/t4G43QTFtM/NCzfqb6QKuG8Oe03j29EM94V 7zfw== X-Gm-Message-State: AJIora8usMdy/zrRRBj5ty3hFVpp5Rlc15gdNq/+dtfNqXBqVkZYnSSy WEieR5CHSEnxmAUmiMy7oK7jWMK/S+2Tfw== X-Received: by 2002:a05:6a00:10c3:b0:525:40fe:6e8d with SMTP id d3-20020a056a0010c300b0052540fe6e8dmr12497366pfu.38.1656545604547; Wed, 29 Jun 2022 16:33:24 -0700 (PDT) Received: from pmalani.c.googlers.com.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id rm1-20020a17090b3ec100b001ed27d132c1sm127305pjb.2.2022.06.29.16.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 16:33:23 -0700 (PDT) From: Prashant Malani To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev Cc: bleung@chromium.org, heikki.krogerus@linux.intel.com, Prashant Malani , Daisuke Nojiri , "Dustin L. Howett" , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Kees Cook , Sebastian Reichel , Tzung-Bi Shih Subject: [PATCH 0/9] platform/chrome: Type-C switch driver and Type-C framework updates Date: Wed, 29 Jun 2022 23:32:18 +0000 Message-Id: <20220629233314.3540377-1-pmalani@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 introduces a retimer class to the USB Type-C framework, It also introduces a Chrome EC (Embedded Controller) switch driver which registers the aforementioned retimer switches as well as mode-switches. Patch 1 and 2 introduce the retimer class and associated functions to the Type-C common code. Patches 3-7 add the cros-typec-switch driver Patches 8-9 update cros-ec-typec to get and use retimer switch handles Submission suggestion (as always, open to better suggestions): - Patch 1 and 2 can go through the USB repo. - Patch 3-9 can go through the chrome-platform repo. Since they depend on patches 1 and 2, we can create an "topic branch" off of usb-next once Patch 1 and 2 are submitted, and then apply Patches 3-9 on top of that "topic branch" before merging it back into chrome-platform's for-next branch Prashant Malani (9): usb: typec: Add support for retimers usb: typec: Add retimer handle to port platform/chrome: Add Type-C mux set command definitions platform/chrome: cros_typec_switch: Add switch driver platform/chrome: cros_typec_switch: Set EC retimer platform/chrome: cros_typec_switch: Add event check platform/chrome: cros_typec_switch: Register mode switches platform/chrome: cros_ec_typec: Cleanup switch handle return paths platform/chrome: cros_ec_typec: Get retimer handle MAINTAINERS | 1 + drivers/platform/chrome/Kconfig | 11 + drivers/platform/chrome/Makefile | 1 + drivers/platform/chrome/cros_ec_typec.c | 50 ++- drivers/platform/chrome/cros_typec_switch.c | 332 ++++++++++++++++++ drivers/usb/typec/Makefile | 2 +- drivers/usb/typec/class.c | 17 +- drivers/usb/typec/class.h | 2 + drivers/usb/typec/retimer.c | 168 +++++++++ drivers/usb/typec/retimer.h | 15 + .../linux/platform_data/cros_ec_commands.h | 18 + include/linux/usb/typec_retimer.h | 45 +++ 12 files changed, 653 insertions(+), 9 deletions(-) create mode 100644 drivers/platform/chrome/cros_typec_switch.c create mode 100644 drivers/usb/typec/retimer.c create mode 100644 drivers/usb/typec/retimer.h create mode 100644 include/linux/usb/typec_retimer.h -- 2.37.0.rc0.161.g10f37bed90-goog