Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp172004yba; Mon, 20 May 2019 06:53:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5MPq+Riw+P6LfDs1nerWFtvIJsDexsUkQj+Q2BOw61UkfJlg8jJfG6c7yGGM3QrhdPMV2 X-Received: by 2002:a63:da14:: with SMTP id c20mr14098349pgh.191.1558360383963; Mon, 20 May 2019 06:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360383; cv=none; d=google.com; s=arc-20160816; b=ZsvTlrAxgOOdyfcnk/EXUssB9dWS8vKYQs7B8vNihe2YlFDkBCM/URbt+TSbTBFDvM SIykQmpA/OcbuiIcK3KfyWY+644xBTiy3DUyRkhLivlHXs+6JbzUoWBuPAOrJNzvxL2l XiokScwGwjQaewhwbbsBclo19po4hZIN2GfXA1jF4GG7mEOZJyXaG86U80Y8Hve3aNDV Vy3TTSpzmWxJwZ9l8wcNtHzr1ypsHn5C/y7dKQ6YJ4YHesZG1q6iAU8ih0BgVXV6cnjH RAVKapsQhBNPMP7klhpS4CI9Z2GX2gZGFJmniPJt8C2RvMaxcm3yBtFnGnHERQSrV5qI FhZA== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=urpvzzQMwcJiy4pS6sbeUbf3IXmOHrotPzfsSLOu+jQ=; b=rv9N05/kMM6+a9g09L4uGflvwsKIZAtlhITbVx55GVn3lJp3WqJDoj8dH+5IGuK9iP 4vJaov15tDQBbOM/4RrHBuIdbxkyV/UCG1VsTzkuF+WWAWh6KWl3lThupL5mnOnRLFjQ OuLWjL2Ds43BRd1f0dZhOsSgZ5Nqu9mdEbBacQSg0C7Bb3shbEmv4ilUOVKs1IhKIw9D mX3U7ashOEwsAgPJVrEEY5U7CXkXdVrO2hHltsQRNMa9tVLigVIW1C+5VnmmF0NXkM+t wDmPPdSEelKw9us1mSjAkN5hHIEAuWbPiv/Ybrl0IL0EouQoaC5Qr3dHInlKfeOlW8uc j5uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b=VQUBEhXC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si5412110plr.184.2019.05.20.06.52.45; Mon, 20 May 2019 06:53:03 -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=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b=VQUBEhXC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732331AbfETJpx (ORCPT + 99 others); Mon, 20 May 2019 05:45:53 -0400 Received: from mail-eopbgr1400102.outbound.protection.outlook.com ([40.107.140.102]:15937 "EHLO JPN01-TY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729835AbfETJpx (ORCPT ); Mon, 20 May 2019 05:45:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector2-renesasgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=urpvzzQMwcJiy4pS6sbeUbf3IXmOHrotPzfsSLOu+jQ=; b=VQUBEhXCljvfslhV9g2Q453aZBsEEDY4u85rcnbg85FkxRFbU7ixwB+r7uDcmdLf5BSgp+7OA8U286ofQtID0uOVs6H4R+MMMRQjVSjao/3FV8YDaZjme91fSqrpcCetrRe7zG6V5yb8+St29HJzh2COUr0EX+oSCZKkHVcsTpI= Received: from OSBPR01MB2103.jpnprd01.prod.outlook.com (52.134.242.17) by OSBPR01MB1832.jpnprd01.prod.outlook.com (52.134.227.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.18; Mon, 20 May 2019 09:45:46 +0000 Received: from OSBPR01MB2103.jpnprd01.prod.outlook.com ([fe80::a146:39f0:5df9:11bc]) by OSBPR01MB2103.jpnprd01.prod.outlook.com ([fe80::a146:39f0:5df9:11bc%7]) with mapi id 15.20.1900.020; Mon, 20 May 2019 09:45:46 +0000 From: Biju Das To: Heikki Krogerus CC: Chunfeng Yun , Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Andy Shevchenko , Min Guo , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , Linus Walleij Subject: RE: [PATCH v5 4/6] usb: roles: add API to get usb_role_switch by node Thread-Topic: [PATCH v5 4/6] usb: roles: add API to get usb_role_switch by node Thread-Index: AQHVCjGxbEdsIx4ReU+jIZIOb3TooaZvJLIAgAApPICABAgXgIAAWsCAgAAANlCAAAi9gIAADx0A Date: Mon, 20 May 2019 09:45:46 +0000 Message-ID: References: <1557823643-8616-1-git-send-email-chunfeng.yun@mediatek.com> <1557823643-8616-5-git-send-email-chunfeng.yun@mediatek.com> <20190517103736.GA1490@kuha.fi.intel.com> <20190517130511.GA1887@kuha.fi.intel.com> <1558319951.10179.352.camel@mhfsdcap03> <20190520080359.GC1887@kuha.fi.intel.com> <20190520083601.GE1887@kuha.fi.intel.com> In-Reply-To: <20190520083601.GE1887@kuha.fi.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=biju.das@bp.renesas.com; x-originating-ip: [193.141.220.21] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7de330c8-b2f9-4f0c-566a-08d6dd07eeee x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:OSBPR01MB1832; x-ms-traffictypediagnostic: OSBPR01MB1832: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 004395A01C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(346002)(366004)(396003)(136003)(376002)(51914003)(199004)(189003)(53936002)(2906002)(66066001)(7736002)(86362001)(305945005)(256004)(3846002)(186003)(26005)(6916009)(25786009)(6116002)(4326008)(74316002)(7416002)(66946007)(6246003)(66476007)(66556008)(76116006)(66446008)(64756008)(73956011)(81166006)(8676002)(81156014)(229853002)(33656002)(8936002)(316002)(6506007)(6436002)(966005)(71190400001)(76176011)(71200400001)(478600001)(6306002)(9686003)(54906003)(486006)(44832011)(102836004)(55016002)(68736007)(7696005)(99286004)(14454004)(52536014)(5660300002)(446003)(476003)(11346002);DIR:OUT;SFP:1102;SCL:1;SRVR:OSBPR01MB1832;H:OSBPR01MB2103.jpnprd01.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:1; received-spf: None (protection.outlook.com: bp.renesas.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: M2DfjJcjOvAj1G2bcfYc5O71X9OD6RTGyNzrf5DRGPHrh/WjVADLv5os5ugnuNb6lZCm1uRBVnIVTCcopdEnnIUyq8dJceis681i4g4GekgANxHW7Rf/W3seLugTY436DVC0tq4ZUl2psPVoyGSdedb6nfVzKaUC4NOHdqYvL44sWR+JyHmmY053FJM9HcKnsfkEVEmSjf2OwLmjf0u0/I/F3l7i8q0jasgvU1naSzfm+YGJDdxMzCxGCg6ckkZ9h2J+//zcktGu/x2E9Ch7+PdW0BeWtb8G/Pf7kOZte13XRbq5lM3WqCBN8Viw4ZSBLER8eAsRrbWoSwc2Fn6dCeReYGHaqGPXoY5BZglmGPHKgCqw4OUrfJr5xFtclkdHjwGXG7q5Fm2lieRvuKie4nvTjKc4M4p8d4H2geaktyQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7de330c8-b2f9-4f0c-566a-08d6dd07eeee X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2019 09:45:46.1271 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB1832 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heikki, Thanks for the feedback. > Subject: Re: [PATCH v5 4/6] usb: roles: add API to get usb_role_switch by > node >=20 > On Mon, May 20, 2019 at 08:06:41AM +0000, Biju Das wrote: > > Hi Heikki, > > > > > Subject: Re: [PATCH v5 4/6] usb: roles: add API to get > > > usb_role_switch by node > > > > > > On Mon, May 20, 2019 at 10:39:11AM +0800, Chunfeng Yun wrote: > > > > Hi, > > > > On Fri, 2019-05-17 at 16:05 +0300, Heikki Krogerus wrote: > > > > > Hi, > > > > > > > > > > On Fri, May 17, 2019 at 01:37:36PM +0300, Heikki Krogerus wrote: > > > > > > On Tue, May 14, 2019 at 04:47:21PM +0800, Chunfeng Yun wrote: > > > > > > > Add fwnode_usb_role_switch_get() to make easier to get > > > > > > > usb_role_switch by fwnode which register it. > > > > > > > It's useful when there is not device_connection registered > > > > > > > between two drivers and only knows the fwnode which register > > > > > > > usb_role_switch. > > > > > > > > > > > > > > Signed-off-by: Chunfeng Yun > > > > > > > Tested-by: Biju Das > > > > > > > > > > > > Acked-by: Heikki Krogerus > > > > > > > > > > Hold on. I just noticed Rob's comment on patch 2/6, where he > > > > > points out that you don't need to use device graph since the > > > > > controller is the parent of the connector. Doesn't that mean you > > > > > don't really need this API? > > > > No, I still need it. > > > > The change is about the way how to get fwnode; when use device > > > > graph, get fwnode by of_graph_get_remote_node(); but now will get > > > > fwnode by of_get_parent(); > > > > > > OK, I get that, but I'm still not convinced about if something like > > > this function is needed at all. I also have concerns regarding how > > > you are using the function. I'll explain in comment to the patch 5/6 = in this > series... > > > > FYI, Currently I am also using this api in my patch series. > > https://patchwork.kernel.org/patch/10944637/ >=20 > Yes, and I have the same question for you I jusb asked in comment I added > to the patch 5/6 of this series. Why isn't usb_role_switch_get() enough? Currently no issue. It will work with this api as well, since the port node= is part of controller node. For eg:- https://patchwork.kernel.org/patch/10944627/ However if any one adds port node inside the connector node, then this api = may won't work as expected. Currently I get below error [ 2.299703] OF: graph: no port node found in /soc/i2c@e6500000/hd3ss3220= @47 For eg:- hd3ss3220@47 { compatible =3D "ti,hd3ss3220"; ... .... usb_con: connector { .... .... port { hd3ss3220_ep: endpoint@0 { reg =3D <0>; remote-endpoint =3D <&usb3peri_role_switch>; }; }; }; }; Regards, Biju