From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 46CB8C433FF for ; Mon, 12 Aug 2019 13:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AC4E20684 for ; Mon, 12 Aug 2019 13:05:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="pS3+xUTB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbfHLNFB (ORCPT ); Mon, 12 Aug 2019 09:05:01 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58122 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfHLNFB (ORCPT ); Mon, 12 Aug 2019 09:05:01 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x7CD4u6D069046; Mon, 12 Aug 2019 08:04:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565615096; bh=+0J8/dXNY2I0HxagR2J8izHTeBMCABSonsYQvwNG014=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=pS3+xUTBTGRFVf8qelsL4jJSeeBrtWlEoPtzu2q8tGCzdlZC58FqK/jYyitJy2o47 Kt2YTFPzWNnwXKc+x++l5XN+G9zNWE8EpXU/5lPiiJ3QhEHDbkcZKN+gSE66BxVWnf Sqjs23IL2LEBCzevVTFeoqDI7PPgtr5e011vexA4= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x7CD4umB067487 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 12 Aug 2019 08:04:56 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 12 Aug 2019 08:04:55 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 12 Aug 2019 08:04:55 -0500 Received: from [192.168.2.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x7CD4qFS074187; Mon, 12 Aug 2019 08:04:53 -0500 Subject: Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver To: Felipe Balbi , Heikki Krogerus , Pawel Laszczak CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jbergsagel@ti.com" , "nsekhar@ti.com" , "nm@ti.com" , Suresh Punnoose , Jayshri Dajiram Pawar , Rahul Kumar , Anil Joy Varughese References: <1563733939-21214-1-git-send-email-pawell@cadence.com> <1563733939-21214-6-git-send-email-pawell@cadence.com> <88742d5b-ee10-cf4e-6724-58e7bdd19cb9@ti.com> <1e557bcf-2d50-f600-0e81-1f9fba5499a1@ti.com> <20190812103147.GA4691@kuha.fi.intel.com> <874l2mtuu6.fsf@gmail.com> From: Roger Quadros Message-ID: <679b82bc-9f33-91ad-4acf-bf6a29e51bc1@ti.com> Date: Mon, 12 Aug 2019 16:04:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <874l2mtuu6.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 12/08/2019 15:46, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: >>> The sysfs file we expose from the class for the role switches is >>> primarily meant for supporting proprietary protocols that require us >>> to basically override the connector USB data role. The default role >>> should always be selected in the drivers. >> >> OK. Let's take this example >> - Port is dual-role port micro AB. >> - microAB to type-A adapter is connected which pulls ID low. port transitions >> to "host" role by the controller driver. >> - proprietary protocol want to switch role to device role so writes "device" to >> mode switch sysfs. port transitions to "device" role. >> >> Now, how does controller driver know to fall back to HW based role switching? > > Use a 'disconnect' or 'suspend' event to go reset it? But that should, > probably, be done at kernel space, no? > Yes that could be one option. So after a disconnect, sysfs role should reflect actual hardware role. correct? cheers, -roger -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki