Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000AbbDNKng (ORCPT ); Tue, 14 Apr 2015 06:43:36 -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 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2188 Lines: 60 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 */ -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/