From patchwork Fri Jan 18 01:09:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Gupta X-Patchwork-Id: 10769263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A5CA139A for ; Fri, 18 Jan 2019 01:10:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 675682EBA9 for ; Fri, 18 Jan 2019 01:10:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B58A2EBBB; Fri, 18 Jan 2019 01:10:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11F2D2EBA9 for ; Fri, 18 Jan 2019 01:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfARBKH (ORCPT ); Thu, 17 Jan 2019 20:10:07 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:14843 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfARBKH (ORCPT ); Thu, 17 Jan 2019 20:10:07 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 17 Jan 2019 17:09:35 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 17 Jan 2019 17:10:06 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 17 Jan 2019 17:10:06 -0800 Received: from ajayg.nvidia.com (172.17.174.172) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 18 Jan 2019 01:10:03 +0000 From: Ajay Gupta To: CC: , Ajay Gupta Subject: [PATCH 3/7] usb: typec: ucsi: add port num info Date: Thu, 17 Jan 2019 17:09:05 -0800 Message-ID: <20190118010909.16161-4-ajayg@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190118010909.16161-1-ajayg@nvidia.com> References: <20190118010909.16161-1-ajayg@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-Originating-IP: [172.17.174.172] X-ClientProxiedBy: BGMAIL104.nvidia.com (10.25.59.13) To HQMAIL101.nvidia.com (172.20.187.10) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547773775; bh=pYQzRDbsaJsIAfOsogYmxGT+pyJ9bNpwXo0AfBC9/RQ=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: X-Originating-IP:X-ClientProxiedBy:Content-Type; b=TbXajW4FtXwLTSI0ChAUl7wWTPSIFMusx64ln695MVdQKAROeI4K3DJBXNI6X4/15 AhlrGM6XBH+y6B6KBMIsexnkN0ms1m9azc2WECk+lHt/8uy8Ms9Y56qGkATfPdL6EE fk4Bq5B0Eh2GXedQvwcStt8yTk90hJTqC1RTmdSLvz0bqmGTnObv6lIq2Kq/PjK7O/ Q5jOju+FJFDvJX32/iKKsSai9t1aWwmHTsiUq9Hkhmne6CGd8X60/NzBcwa3mj0K6D sQeht+9VtXkgTHXlLZbVMb5rBc9N1QTDLOge3A7ylnh5WHVWK3ms4awfq6XZ6f9JPz 2c74LSIgJvbMg== Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Read PD port number information and save. Signed-off-by: Ajay Gupta --- drivers/usb/typec/ucsi/ucsi_ccg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c index dce9126b6a37..b30ca51120a3 100644 --- a/drivers/usb/typec/ucsi/ucsi_ccg.c +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c @@ -172,6 +172,7 @@ struct ucsi_ccg { #define DEV_CMD_PENDING 1 struct ccg_resp dev_resp; u8 cmd_resp; + int port_num; }; static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len) @@ -554,6 +555,11 @@ static int ucsi_ccg_probe(struct i2c_client *client, return status; } + if (uc->info.two_pd_ports) + uc->port_num = 2; + else + uc->port_num = 1; + status = devm_request_threaded_irq(dev, client->irq, NULL, ccg_irq_handler, IRQF_ONESHOT | IRQF_TRIGGER_HIGH,