Received: by 10.213.65.16 with SMTP id m16csp159838imf; Sun, 11 Mar 2018 21:36:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELuNKbvq8I/QQY/2jOxD7DO33bHtmX26vMj4DmTeAXCScVtL+f4JlS0qG9FaL1NHEeJiD8mL X-Received: by 10.98.225.2 with SMTP id q2mr6616934pfh.23.1520829389251; Sun, 11 Mar 2018 21:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520829389; cv=none; d=google.com; s=arc-20160816; b=QcRy+11plvyVL3UwLzD8dnuHr0cxL2RjztAryUjDKVxGz8J6cQaFE9Q4i6GSCZivWQ 1OUmUP2dVKjAH0ouh8fopQ9iuzKm5TaTgkvLMHfkTBFM1wZ5Cz5JFdAKkHvkpAoIlSVZ kZpeC3liyeLlXeau3mUHmW+3GocfY9p8IBGTm3V9QS/qAQOkqfzvcCRySs8WoPqR5rRO 9AyQs5WY6cqhSpTA657HI9Pw7MrWeKCr8V/0LCbrS8gfW9asjP2RNmrwSAu+tVUCy8ew 5IKEObAtY+zEmN16YR2nyH5HWyUglWKuDvZQ5ypXiTYeqdRupo8g/rweF7c2eJZ3WI2O iTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=X7S4AQffQdPu6X8yhnaEK2uCUMVOSkStQFEpyy6U56I=; b=ht+7xX+L5+7mVKSo10argZVbHI7YXMf8MtalBpKjw6q0er7lnfuT5m+B6jjOlA7V+H 8RZqGqzuzo282K0krqGCdpQS1jIlGdF7ThZNhnkMrWwNAgZ/uC4vOX49kXtbkUKZ7Kc7 eKKRZxwX3892xsua5Okus98URSnIZXz/TWfEWDzkzpS8YykVkLdlJjlOquvaJi+KDKnV rggMHLSzBzt3okbGiAIwZIIqGagt0BQdGiPqgzoSqfsu+3A1WUWdEHuufNd47qYHYWDl Fur4FOCtSAVCTzfVv9K581EqIZWjLAIDDO9isHhmHffmAmpMmEJXX0WTbm5/PgeCM4MH 40iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=F+OtNRJ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si5290330pld.653.2018.03.11.21.36.15; Sun, 11 Mar 2018 21:36:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=F+OtNRJ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751324AbeCLEdr (ORCPT + 99 others); Mon, 12 Mar 2018 00:33:47 -0400 Received: from mail-db5eur01on0057.outbound.protection.outlook.com ([104.47.2.57]:27456 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750764AbeCLEdp (ORCPT ); Mon, 12 Mar 2018 00:33:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X7S4AQffQdPu6X8yhnaEK2uCUMVOSkStQFEpyy6U56I=; b=F+OtNRJ7PSt4Xjv0zwjzPD1SGbbihGghaTuoQEAdl6WcJY30mk3a8tDpIYYC/kE+K+bTA4PaTwz1IePpfaOzx8Q52TIrUkkgBsNAYmT7gsX22BzvRanUp1jn9RVo38LWJ07VIbdvoehEly3Y6j5zq2tsR9/O3QXPmT394KWYZI4= Received: from VI1PR0402MB3917.eurprd04.prod.outlook.com (52.134.17.30) by VI1PR0402MB2846.eurprd04.prod.outlook.com (10.175.23.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 04:33:41 +0000 Received: from VI1PR0402MB3917.eurprd04.prod.outlook.com ([fe80::70cd:1c30:40b2:1bae]) by VI1PR0402MB3917.eurprd04.prod.outlook.com ([fe80::70cd:1c30:40b2:1bae%13]) with mapi id 15.20.0548.021; Mon, 12 Mar 2018 04:33:41 +0000 From: Jun Li To: Greg Kroah-Hartman , ShuFan Lee , "heikki.krogerus@linux.intel.com" , "linux@roeck-us.net" , "greg@kroah.com" CC: "shufan_lee@richtek.com" , "cy_huang@richtek.com" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: RE: [PATCH v7] staging: typec: handle vendor defined part and modify drp toggling flow Thread-Topic: [PATCH v7] staging: typec: handle vendor defined part and modify drp toggling flow Thread-Index: AQHTtO2TvuhbiKnCtkaCXDhq065ky6PL/wvQ Date: Mon, 12 Mar 2018 04:33:41 +0000 Message-ID: References: <1520301032-10109-1-git-send-email-leechu729@gmail.com> In-Reply-To: <1520301032-10109-1-git-send-email-leechu729@gmail.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0402MB2846;7:UGcX7lQefmVHJw0zj5gdd0PXVWFtpUstp8jsj9Fa+U12RStv19hKvCnkwvN1smkHZLNNM87qa44kLVg1mJ4iE5nSwqQbBY9uVyI/vBFnPr5MWMI4B5KgH2MxERQMZNBnEb2vofnW7I7bszEJzTlhIh/gl3qlJsu6sftiO0luRB6k6JGJYru3bAU0Rt5g8hpz+++oJioznVC4f09OF9magS+UuFFnrW4avvAYjprK4Qc3xWHnjgTznSLsweeqlR5C x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 83e7d867-d457-44b4-e18d-08d587d26ea5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0402MB2846; x-ms-traffictypediagnostic: VI1PR0402MB2846: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(84791874153150); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:VI1PR0402MB2846;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB2846; x-forefront-prvs: 06098A2863 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(39380400002)(366004)(376002)(396003)(346002)(189003)(199004)(86362001)(8936002)(2950100002)(59450400001)(8676002)(81156014)(2201001)(14454004)(25786009)(39060400002)(6116002)(3846002)(66066001)(4326008)(478600001)(2906002)(3280700002)(99286004)(2900100001)(97736004)(3660700001)(186003)(26005)(102836004)(966005)(6506007)(5660300001)(81166006)(7736002)(575784001)(305945005)(53936002)(2501003)(5250100002)(106356001)(6246003)(7696005)(68736007)(105586002)(110136005)(76176011)(74316002)(33656002)(54906003)(6436002)(316002)(55016002)(6306002)(229853002)(9686003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB2846;H:VI1PR0402MB3917.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: jpijm+ViDLIY0s4bVTCJyMm6lMuctmogmcUhbdZ9BdFZk3jtk0t4ZHU93ME2kHK+/7G5TXX6phtW8uZTJbPM0233fwUFKrs5kRAfVEOLMFq2DSoYnDgJmIdPdM60h9UUbpbRMcJFaRTIcuBxllZ5MQI0CL4eDICT3V9IZhbhDr84b7qpRCnhRubs82qAfQjhYVjcV9EUb1TWFF9DkNln4QA7UvDgZgoXF8O3Ln6U1+lnaeOJPUa0LpcJQY2LFTwK+tedYr9366W6Nyf26ukAnTcFivFyZitMoWBVhxpIdWNTX3nlz8xku8GIpn1wUW1AHkkKV1jqIpkhPVVRmgp7Rw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83e7d867-d457-44b4-e18d-08d587d26ea5 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2018 04:33:41.1102 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2846 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > +static irqreturn_t _tcpci_irq(int irq, void *dev_id) { > + struct tcpci *tcpci =3D dev_id; > + > + return tcpci_irq(tcpci); > +} >=20 ... > + err =3D devm_request_threaded_irq(&client->dev, client->irq, NULL, > + _tcpci_irq, > IRQF_ONESHOT | IRQF_TRIGGER_LOW, > - dev_name(tcpci->dev), tcpci); > + dev_name(&client->dev), chip); - dev_name(&client->dev), chip); + dev_name(&client->dev), chip->tcpci);=20 Did you ever test this patch? I noticed Greg already picked this patch[1]: [1] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?= h=3Dusb-testing&id=3D8f94390226487bcb86c554ddc12eef0d27bdec3b One more minor comment below. Jun Li > diff --git a/drivers/staging/typec/tcpci.h b/drivers/staging/typec/tcpci.= h index > fdfb06c..a2c1754 100644 > --- a/drivers/staging/typec/tcpci.h > +++ b/drivers/staging/typec/tcpci.h > @@ -59,6 +59,7 @@ > #define TCPC_POWER_CTRL_VCONN_ENABLE BIT(0) >=20 > #define TCPC_CC_STATUS 0x1d > +#define TCPC_CC_STATUS_DRPRST BIT(5) Defined but not used. > #define TCPC_CC_STATUS_TERM BIT(4) > #define TCPC_CC_STATUS_CC2_SHIFT 2 > #define TCPC_CC_STATUS_CC2_MASK 0x3 > @@ -121,4 +122,18 @@ > #define TCPC_VBUS_VOLTAGE_ALARM_HI_CFG 0x76 > #define TCPC_VBUS_VOLTAGE_ALARM_LO_CFG 0x78 >=20 > +struct tcpci; > +struct tcpci_data { > + struct regmap *regmap; > + int (*init)(struct tcpci *tcpci, struct tcpci_data *data); > + int (*set_vconn)(struct tcpci *tcpci, struct tcpci_data *data, > + bool enable); > + int (*start_drp_toggling)(struct tcpci *tcpci, struct tcpci_data *data, > + enum typec_cc_status cc); > +}; > + > +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); > + > #endif /* __LINUX_USB_TCPCI_H */ > -- > 1.9.1