From patchwork Tue Sep 29 02:40:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Badhri Jagan Sridharan X-Patchwork-Id: 297447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.9 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C075DC4727E for ; Tue, 29 Sep 2020 02:40:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BB75208FE for ; Tue, 29 Sep 2020 02:40:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YOzN/rOv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbgI2Ckq (ORCPT ); Mon, 28 Sep 2020 22:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727531AbgI2Ckm (ORCPT ); Mon, 28 Sep 2020 22:40:42 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E771C0613DA for ; Mon, 28 Sep 2020 19:40:41 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id e2so3243427ybc.17 for ; Mon, 28 Sep 2020 19:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=ETPAsWHvLyLNkSHJ+gS6oA+OTExuVARAMVUjKC9Fc/4=; b=YOzN/rOvca1uPt9PY3XDoEf2RUnhEyq0eKxdF8Fg+uNyxFSFrujusub6QGt672Jep3 QQAQ1lYV+wvQ0XYYYxJrqwdRFZfO2FbRewFO+oty1wXCTAsmmK5tEmgyl0xi8oCvmsMi BUgFbkwEWW32XL+iyuCv5n5sGW2/bfdQGc4XxpLppVKIgyXxlVX54V5fnETAwQOBUurf kO+XGzvUsGuHa9ncWogKv+vLs2sUo+8z38OyopD8nZAaW0RpmXFU1oIlWwp8hY9Vyl2M algRGGfrfjDNQmXqY81pqW6LXhe2dneFr05VEUk0eHVhjIAljJpvrH94ot4Z89qeNJxD lJfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ETPAsWHvLyLNkSHJ+gS6oA+OTExuVARAMVUjKC9Fc/4=; b=i4A+vi2dZRcDINa/LPR4UeTEHR7+vjmji9A5QRIhCWzEW4LYZyKSn8nlsNbZ1Gr8kQ PNNjzz41rtJ7ejHZb/IqY+lxgzcenSj6cHWG+VFNZzAO/OAzzj0eC0r2U7lSkpbG7u9N NLQQREFmgq5kFnkjwzNggne393/MoXvXz+vC86IvOa8hyC/rT3+A3E1YvqS4EuuqHVz9 MxzechYkxaY8CRSMvR8zJtcJY/jBNE6vY6DRX16WFJJ0vd46LfUhvZSkFZs35AaJI5oU rXxagN48v9Anh6I8VvNORoVShQr7i9w5vP06DL1W9Y6Cr2OqVuSo+wZZytm9twUuYx3L i21w== X-Gm-Message-State: AOAM532A8+ujQP/yZjLbW3bXEK14AVxYgu9vxGD6votfy5HyV0BsafaQ UG9W9oDp/79wnln2U7RIJPHnkSQrymo= X-Google-Smtp-Source: ABdhPJxq3i3a+BB6LOmVW3EbE+nzVKJocf8lveCUAVDznppOElFjuLfBgYnTIP44KqRmyroDeGUQ0rVuSp4= 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:d45:: with SMTP id 66mr3316010ybn.231.1601347240323; Mon, 28 Sep 2020 19:40:40 -0700 (PDT) Date: Mon, 28 Sep 2020 19:40:04 -0700 In-Reply-To: <20200929024004.244992-1-badhri@google.com> Message-Id: <20200929024004.244992-16-badhri@google.com> Mime-Version: 1.0 References: <20200929024004.244992-1-badhri@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH v9 15/15] usb: typec: tcpci_maxim: Enable auto discharge 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 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Enable auto discharge disconnect for Maxim TCPC. Signed-off-by: Badhri Jagan Sridharan --- Changes since v1: - Changing patch version to v6 to fix version number confusion. Changes since v6: - Rebase on usb-next. Changes since v7: - Heikki's suggestion: Moved the actual write of TCPC_VBUS_SINK_DISCONNECT_THRES register to tcpci code. Changes since v8: - Moved the logic to program the default values of TCPC_VBUS_SINK_DISCONNECT_THRESH into the tcpci code. --- drivers/usb/typec/tcpm/tcpci_maxim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm/tcpci_maxim.c b/drivers/usb/typec/tcpm/tcpci_maxim.c index 43dcad95e897..55dea33387ec 100644 --- a/drivers/usb/typec/tcpm/tcpci_maxim.c +++ b/drivers/usb/typec/tcpm/tcpci_maxim.c @@ -441,6 +441,7 @@ static int max_tcpci_probe(struct i2c_client *client, const struct i2c_device_id chip->data.TX_BUF_BYTE_x_hidden = true; chip->data.init = tcpci_init; chip->data.frs_sourcing_vbus = max_tcpci_frs_sourcing_vbus; + chip->data.auto_discharge_disconnect = true; max_tcpci_init_regs(chip); chip->tcpci = tcpci_register_port(chip->dev, &chip->data);