Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3468309pxk; Mon, 28 Sep 2020 19:42:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpw1TweGQemMJy4CVZ0SfJeoiCUaUmKaqVteV43hyvfa1TgZJoUQsaU/PacDvJhA0WjMhc X-Received: by 2002:a17:906:8401:: with SMTP id n1mr1630779ejx.215.1601347326531; Mon, 28 Sep 2020 19:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601347326; cv=none; d=google.com; s=arc-20160816; b=spyFdHWfYZ9VJAj7fMpdiFoGfu+bb+B+M9uGJ2yi9sSz2mpaNj/Z7qqEA8YjIxiDtR Ivwe+GYR0uYrdvPgtZEbqYyEXS3ndSA0bTyUgq+Ci8bwrOZH7Rxlff2lbqLdbcr+2GYt vmT4+dL5yU1S/+gDoD+71l4NBI60wb86/Q70rbvhjFQiBoUBUmeLPJ8qW0TtZvtxyVGg l782nVCKm606/NVe1nXx5tk8gU0I+CZuYjRow181At/Cmpc2YC3InWQrfb8BPEx9nJac 2nsRn2v+CDwbfs1XsGUh+7cL+3p+BvRqLgYK5+o/ibqCo/W/OFjUYccTyTyPgjFnoH5I KipA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=fUNDNepzGaiGXAFhfkvJ0RSbCFD3wqyJd1yrtWxeUj8=; b=kgenQAEs2cLgqVFvk42OvrO2JvXGx8q4GbO3LCGSxXAWRm4eaMtur7IrfXH7ck1uwq kAnZ+SD/MjMCMl7LS5WezCT2ZMI9UMl6fbr7IqSJIpJf+C5+fgALNWe0GrSzdxT0I2BM 2H4T8T1dfsSuDVu5XzTKoFKiW+Bisrd+97C0gdvax7/LPg16lY5f+r11mgJ/vYPbxvRp 6FZRI25MJGp8zUREpZtxYM1+vtWkw/bUKI+pFzLDVNBF8e8rlDAPgAdzIGbE+zo44vic WuiyNJ1/dpb/c9wNp0aGLpLtw3VscDQrXxK3KxQXylPURlOIFAZTiTCr9oNo6jOxWxh4 uLcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IoHqVaUb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si1918395edx.501.2020.09.28.19.41.35; Mon, 28 Sep 2020 19:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IoHqVaUb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727276AbgI2CkN (ORCPT + 99 others); Mon, 28 Sep 2020 22:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbgI2CkM (ORCPT ); Mon, 28 Sep 2020 22:40:12 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02742C0613CE for ; Mon, 28 Sep 2020 19:40:11 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id d143so3265280ybh.11 for ; Mon, 28 Sep 2020 19:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=fUNDNepzGaiGXAFhfkvJ0RSbCFD3wqyJd1yrtWxeUj8=; b=IoHqVaUbKcxLhyR1E/x98m/4a3etB97/ByKN3fmpKhAU/yIpgGoXK83g3Qd1IX2UDU 1ZUtrDoMfdBcWpDZ2LyKNvlLnBDixrKvVU6MfpADkYztdZeN6XYU3cejo9FI6Xa1AqaH FdOtaRUlNJdLNfwrKRD3ftlZ3bmhNcZzD5VnV29ORmm/jIFxzYnr9FJ2bIgaXnoHvSH0 YvQ+VRzkzdoq1TfIh47EIBPxCoebhMwcNSWL2q75Z9qFPiNOXVBTXGTIixJyjKuP4E2p FG0rOfhrWCtgmdYvYqz7V4XX6oIiqDzBU8FN5bYWIKYJZfWK8P9735CRrjXQeMfdtQAM h75A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=fUNDNepzGaiGXAFhfkvJ0RSbCFD3wqyJd1yrtWxeUj8=; b=t9LMIhwAwxDRUVoRi3fO6y6swgZMgXDlNiFsXZwhlNb4AlHjVXiqwCtTsepE2y7Xzx kJrgRCZZorITNYdi8hl2WN0R+kzyhk3oAzL5bZZOGbPUffgrzxrIBg/POAe7VnNQr3jf O0wbGkVTYs4CfKlXRBfcmZs9sFuwHzHRoUF5jkbMDVCYBN7uMHH0TngMe53SLPJ9M2tC ItFTcwk8BYMq5bZO1juedONJ+nJfQYvcpZkiRKLYdtRUZL91okIyUlW1DSkCchnf9ob2 YHSu+YyZChD8yP95eSYiFd6It/1OXCg8ExCpZC0jDh7aKkfK5VQQPv7XBdSOkzIWrNEl d2eg== X-Gm-Message-State: AOAM533Geu1VwGde8VvUm2RiXRSUhPz2gHpSSEgRKdcWl/fG6ijHO86G xOMs6bGpNi9hivaq791RV2mxG+Q6H9o= Sender: "badhri via sendgmr" X-Received: from badhri.mtv.corp.google.com ([2620:15c:211:1:f292:1cff:fee0:66cf]) (user=badhri job=sendgmr) by 2002:a25:1381:: with SMTP id 123mr3584065ybt.406.1601347209808; Mon, 28 Sep 2020 19:40:09 -0700 (PDT) Date: Mon, 28 Sep 2020 19:39:49 -0700 Message-Id: <20200929024004.244992-1-badhri@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH v9 00/15] TCPM support for FRS and AutoDischarge Disconnect From: Badhri Jagan Sridharan To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Rob Herring , Lee Jones , Mark Brown , Maxime Ripard , Alexandre Belloni , Thierry Reding , Prashant Malani , Badhri Jagan Sridharan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Addressed three comments from v8: 1. Fixed the make dt_binding_check that Rob Herring pointed out in "dt-bindings: usb: Maxim type-c controller device tree binding document" https://lkml.org/lkml/2020/9/22/720 2. Moved to string based enums for new-source-frs-typec-current to address comments from Rob herring for: "dt-bindings: connector: Add property to set initial current cap for FRS". As a result, introduced another patch: "usb: typec: tcpm: Parse frs type-c current from device tree" to refactor tcpm code to read new-source-frs-typec-current from device tree. Previously this is was a uint32. https://lkml.org/lkml/2020/9/22/729 3. To address Heikki's comment on Auto discharge disconnect threshold https://lkml.org/lkml/2020/9/21/1857 a. Removed the call to tcpm_set_auto_vbus_discharge_threshold from source attach path. b. Moved logic of setting TCPC_VBUS_SINK_DISCONNECT_THRESH_MAX to tcpci.c as the tcpci_maxim was actually setting the default values. Removed the get_auto_vbus_discharge_threshold callback from tcpci_data for now. Can be added later if needed. 4. Added additional patches to address an isssue where vbus was being left post disconnect after Fast Role Swap operation is executed. a. usb: typec: tcpm: frs sourcing vbus callback b. usb: typec: tcpci: frs sourcing vbus callback c. usb: typec: tcpci_max77759: Fix vbus stuck on upon diconnecting sink Thanks, Badhri. Badhri Jagan Sridharan (15): usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference usb: typec: tcpci: Add set_vbus tcpci callback dt-bindings: usb: Maxim type-c controller device tree binding document usb: typec: tcpci_maxim: Chip level TCPC driver dt-bindings: connector: Add property to set initial current cap for FRS usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS) usb: typec: tcpci: Implement callbacks for FRS usb: typec: tcpci_maxim: Add support for Sink FRS usb: typec: tcpm: frs sourcing vbus callback usb: typec: tcpci: frs sourcing vbus callback usb: typec: tcpci_max77759: Fix vbus stuck on upon diconnecting sink usb: typec: tcpm: Parse frs type-c current from device tree usb: typec: tcpm: Implement enabling Auto Discharge disconnect support usb: typec: tcpci: Implement Auto discharge disconnect callbacks usb: typec: tcpci_maxim: Enable auto discharge disconnect .../bindings/connector/usb-connector.yaml | 26 + .../devicetree/bindings/usb/maxim,tcpci.yaml | 68 +++ drivers/usb/typec/tcpm/Kconfig | 6 + drivers/usb/typec/tcpm/Makefile | 15 +- drivers/usb/typec/tcpm/tcpci.c | 102 +++- drivers/usb/typec/tcpm/tcpci.h | 30 +- drivers/usb/typec/tcpm/tcpci_maxim.c | 504 ++++++++++++++++++ drivers/usb/typec/tcpm/tcpm.c | 299 ++++++++++- include/dt-bindings/usb/pd.h | 10 + include/linux/usb/pd.h | 19 +- include/linux/usb/tcpm.h | 27 +- include/linux/usb/typec.h | 12 + 12 files changed, 1093 insertions(+), 25 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/maxim,tcpci.yaml create mode 100644 drivers/usb/typec/tcpm/tcpci_maxim.c -- 2.28.0.709.gb0816b6eb0-goog