Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3409371pxk; Mon, 21 Sep 2020 12:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUcyZo/8jvIoP17uR/Ztxf6lU6YQ1vz8th1wM5WTy7LfTleTopK3xoGAlX3VQn4gLqfOQv X-Received: by 2002:a17:906:2962:: with SMTP id x2mr1149719ejd.188.1600718244811; Mon, 21 Sep 2020 12:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600718244; cv=none; d=google.com; s=arc-20160816; b=yIGey6RbL0bWFFydbX7bu3sMV/FA5KeTmVpTj/MeAElz3xld6cBQTLekM5Npi427Dp 1ze5U1cXFE54mveLsSQzJ4KYQiP5oUXymJhUvIZeX7raalYRK1bcNHZ9z989kyxdLxR5 zKCWLEyg0UovCKFUdtYTKce1ywWOoPR5tRMdsa24rXyIxDIZ2SaUZ7vkqG+p+6KS2m2M 43b1Cf4/Tlqdno7PiWZbJ8+5HYCI2CqLd7GGywQ+znjm9v/ghSiz3Gr6CR0kep4zDRt2 621BG9flKJ49wo+gQy7bv6qHJs9eDDDSiv9zA+2e07JHW808oNP60Tmj/LMhfr720wbD SVPg== 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=UYdZsbRRn0ngJ7bp1PZbaVObPNEy0F/LDH2oLgnJ+1Y=; b=h19nAlkfmqlRgbLlbOkpw+cJNus2slwnh9dw5WxMs9uCG+8zbidqLpICzQZjP2qS66 hx/A3IhkwUrXGbPnlwZIkPBgd4xPo4rBvjrwXwaWuSYxRcQZduLPWxGb3gK0hXxgpeSt QHOl5LUTKplfc2/szjG2OepwmRTuCU+XFuzhGotA7U2R4occKAaahsTyjc/HCECvlF1e VOHTFuZfXkH57tNTWarDM+b1Ag2fXV5QZGs9qj0Sk3lsWQJUqFRRX4IO6cMWY43fziza 9DKD+x6zdjMBKaNH3b2cRdl2Sc0c4hwaCVE7brSGg7Q1ZEwjRU75cmhd8zygSgRLaSKi DASw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FfGltcom; 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 a4si9324807edb.358.2020.09.21.12.57.02; Mon, 21 Sep 2020 12:57:24 -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=FfGltcom; 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 S1726322AbgIUT4C (ORCPT + 99 others); Mon, 21 Sep 2020 15:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbgIUT4B (ORCPT ); Mon, 21 Sep 2020 15:56:01 -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 82F20C0613CF for ; Mon, 21 Sep 2020 12:56:01 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id q2so14039548ybo.5 for ; Mon, 21 Sep 2020 12:56:01 -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=UYdZsbRRn0ngJ7bp1PZbaVObPNEy0F/LDH2oLgnJ+1Y=; b=FfGltcomG8zE8J9z8QDGQdn1bE5ren29TUCOaytLkD/duuDzhuy+St8rIBXWrrfUkI jqnW3Litk/BDspNQE9AUIyxNApoOUtLYnhcYcpYrm2pGw8tuwuyy+/RX0QZYEuGGtxVm b+7HrlQl4Jb36vcefnKHPpNWkRn4RItmKyb2TKtNYyRF+SMR263h/+h5R0Rbi3zgsLH+ qhoiwzD26yZbHi4UROICtnG3FKoiNaUzo8lCpZeUFNAoGtG5Rv5/jqEHz1ZYgNDm5hGd paqjlBCf5blo1tu2bUaMMcB/qjInBRZ67AacUc642ZNE89uDi6IscpBbYDcd0ilZVWy9 81qw== 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=UYdZsbRRn0ngJ7bp1PZbaVObPNEy0F/LDH2oLgnJ+1Y=; b=grQBrqxA6oXQORa1g7VkDhSi8oHbS0sAiGwGHceWYmzM6aKG66P2kguERE0ILf1WDS 501ncB47+btHe3lWrPgvUaW6rIdScWsjDl3zx6wlO0cogFpZM0oPD2VWrWvwof1Eg72C jkIbjW1hlFd5pAVaYh6fyo9Hu6ihQXt5FJhBQxsdPEGZ58aW/ujHv06cgP+OK6WH4C5m hI25hBmdG88YtxG5sLm6nR83pOSHRE6hKVziJRUmVT03zYfzIyHMLPSEpkNZ31qqmmud TJuMV0z3dlAqOUwqa4yUuWGaRTCQQqwUEx23bIF9OtwQ3lzyzmB92Itv0auwmgCsFH6F 8KSg== X-Gm-Message-State: AOAM533PngKTsA4xJLksx5glrWUybSgiuI65w6uPOr0WPc1rOkRnRemf vFxnjVf29zecbO7zCovvajTNuwuIvPI= 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:244a:: with SMTP id k71mr2218204ybk.504.1600718160665; Mon, 21 Sep 2020 12:56:00 -0700 (PDT) Date: Mon, 21 Sep 2020 12:55:45 -0700 Message-Id: <20200921195555.1050731-1-badhri@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v8 01/11] usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference 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 Allow chip level drivers to retrieve reference to tcpm_port. Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Heikki Krogerus --- Change since v1: - Changing patch version to v6 to fix version number confusion. Change since v6: - Rebase on usb-next - Added Reviewed-by from Heikki. Change since v7: - Rebase on usb-next --- drivers/usb/typec/tcpm/tcpci.c | 6 ++++++ drivers/usb/typec/tcpm/tcpci.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 7d9491ba62fb..b960fe5a0f28 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -38,6 +38,12 @@ struct tcpci_chip { struct tcpci_data data; }; +struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci) +{ + return tcpci->port; +} +EXPORT_SYMBOL_GPL(tcpci_get_tcpm_port); + static inline struct tcpci *tcpc_to_tcpci(struct tcpc_dev *tcpc) { return container_of(tcpc, struct tcpci, tcpc); diff --git a/drivers/usb/typec/tcpm/tcpci.h b/drivers/usb/typec/tcpm/tcpci.h index cf9d8b63adcb..04c49a0b0368 100644 --- a/drivers/usb/typec/tcpm/tcpci.h +++ b/drivers/usb/typec/tcpm/tcpci.h @@ -150,4 +150,6 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data); void tcpci_unregister_port(struct tcpci *tcpci); irqreturn_t tcpci_irq(struct tcpci *tcpci); +struct tcpm_port; +struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci); #endif /* __LINUX_USB_TCPCI_H */ -- 2.28.0.681.g6f77f65b4e-goog