From patchwork Tue Apr 14 10:41:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 6214731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC347BF4A6 for ; Tue, 14 Apr 2015 10:43:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1833D2021F for ; Tue, 14 Apr 2015 10:43:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 134D820212 for ; Tue, 14 Apr 2015 10:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754945AbbDNKn2 (ORCPT ); Tue, 14 Apr 2015 06:43:28 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:47071 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754817AbbDNKmr (ORCPT ); Tue, 14 Apr 2015 06:42:47 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t3EAgg1N029856; Tue, 14 Apr 2015 05:42:42 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t3EAgeAG026580; Tue, 14 Apr 2015 05:42:40 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Tue, 14 Apr 2015 05:42:40 -0500 Received: from rockdesk.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t3EAg1wR025336; Tue, 14 Apr 2015 05:42:38 -0500 From: Roger Quadros To: , , CC: , , , , , , , , Roger Quadros Subject: [RFC][PATCH v2 11/13] usb: add "dual-role" mode to dr_mode device tree helper Date: Tue, 14 Apr 2015 13:41:58 +0300 Message-ID: <1429008120-5395-12-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429008120-5395-1-git-send-email-rogerq@ti.com> References: <1429008120-5395-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need to differentiat between "otg" and "dual-role" operation. dual-role means capability to operate as host or device depending on the ID pin status but no support for any of the OTG features like SRP, HNP and on the fly role-swap. The only way to change the role for a dual-role device is to toggle the ID pin by changing the cable. Signed-off-by: Roger Quadros --- Documentation/devicetree/bindings/usb/generic.txt | 2 +- drivers/usb/common/common.c | 1 + include/linux/usb/otg.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt index 477d5bb..64438f9 100644 --- a/Documentation/devicetree/bindings/usb/generic.txt +++ b/Documentation/devicetree/bindings/usb/generic.txt @@ -8,7 +8,7 @@ Optional properties: HW capability. - dr_mode: tells Dual-Role USB controllers that we want to work on a particular mode. Valid arguments are "host", - "peripheral" and "otg". In case this attribute isn't + "peripheral", "otg", "dual-role". In case this attribute isn't passed via DT, USB DRD controllers should default to OTG. diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index b530fd4..faf51fe 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -87,6 +87,7 @@ static const char *const usb_dr_modes[] = { [USB_DR_MODE_HOST] = "host", [USB_DR_MODE_PERIPHERAL] = "peripheral", [USB_DR_MODE_OTG] = "otg", + [USB_DR_MODE_DRD] = "dual-role", }; /** diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 52661c5..d6057fb 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -102,6 +102,7 @@ enum usb_dr_mode { USB_DR_MODE_HOST, USB_DR_MODE_PERIPHERAL, USB_DR_MODE_OTG, + USB_DR_MODE_DRD, }; #endif /* __LINUX_USB_OTG_H */