From patchwork Fri Sep 21 11:53:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10609925 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 183906CB for ; Fri, 21 Sep 2018 11:55:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0850A2CC66 for ; Fri, 21 Sep 2018 11:55:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0D642D9A0; Fri, 21 Sep 2018 11:55:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB562CC66 for ; Fri, 21 Sep 2018 11:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390096AbeIURn6 (ORCPT ); Fri, 21 Sep 2018 13:43:58 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:38762 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389914AbeIURn5 (ORCPT ); Fri, 21 Sep 2018 13:43:57 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 21 Sep 2018 20:55:22 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 920E67318E; Fri, 21 Sep 2018 20:55:22 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.54,284,1534777200"; d="scan'208";a="291574205" Received: from mail-ty1jpn01lp0182.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.182]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Sep 2018 20:55:22 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k5nO3RxfLKtmucLdrZPX8kuokwzGPizW3J8pUBgJ2qQ=; b=oE2gqaDhUvYwI6yhVf4/RZgudG3zbW0OC4St3coRt0F7iQBeWOLm9erV9u4UvSYTSGMPB1ypfWAQjD4dqtdxAqTEVB9xG/n9vdM9B5sGcHCvAxAfvaVNW5w7m9CBeUbpO8PIbBzW4qgZmMC+cfD7g5Jeigy8UHWIjyI48RsEXmI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by OSBPR01MB2296.jpnprd01.prod.outlook.com (2603:1096:603:26::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 11:55:21 +0000 From: Yoshihiro Shimoda To: kishon@ti.com, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 4/8] phy: renesas: rcar-gen3-usb2: Check a property to use otg pins Date: Fri, 21 Sep 2018 20:53:20 +0900 Message-Id: <1537530804-19399-5-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1537530804-19399-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1537530804-19399-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0065.jpnprd01.prod.outlook.com (2603:1096:403:a::35) To OSBPR01MB2296.jpnprd01.prod.outlook.com (2603:1096:603:26::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcae63b5-26c6-4c84-8e35-08d61fb91b97 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(8559020)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:OSBPR01MB2296; X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2296;3:SX0Ih9u8hDgFzXy/Kp5xSIiAqf4EtoWjqwylKQAhdmOMZ0TF6riUz1JWn8aGFxjDuiGzgbC1A+DUzSe2dlKGJzPd54ac8pnqLsr0rbSWVau47C/0DFVvywI1aBQpav+z62ckotAHrGYE67mYucATf2USxDL/cFuwHHTVIJD5TrOg/OdmVy0YiabBWsDLek7U8BeMM30zyZXXfaB7WdF4DIgcf3e4HkojrodAYf/8YWhOWMOsv3rgKfwb4mtBNqaS;25:YN8liK7ehKXp6qdXBHdNAy2tGkM/wdFaxmYIbnHsm9FSfPBmWhYn4SyQWYftMROgrno6rNip4jFmE3D5L38zU3/zbrrlm2HxslFyVUH4PS3lwFJotAx0eCLejAbzwwgMjldHUCvNk79XTPycKFyKRlYCanB6aUZe+mB8JI+94BFBTHIKVUzp0IojCAuYo7t1HaOe2rMVogHgpFS5AVRSPXKXshd6xvdFI4Aibw9MFYrzvvwP1cuCGdVFTa3RQN0wXaQ9Tz4SmlzsBWk9fYXT3iOGZv8bKtmnGybOCsNoIw0GXJNpIszC7n1Y139BTxiuVr4zN0mDeS4sSUO9U2l2mA==;31:98r4rqRgQ5AFcv99JvoItW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ztbsHg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051);SRVR:OSBPR01MB2296;BCL:0;PCL:0;RULEID:;SRVR:OSBPR01MB2296; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(376002)(39860400002)(136003)(396003)(366004)(199004)(189003)(66066001)(4326008)(52116002)(107886003)(6512007)(486006)(6506007)(42882007)(51416003)(386003)(47776003)(78352004)(476003)(26005)(6486002)(105586002)(11346002)(956004)(2616005)(53936002)(446003)(36756003)(76176011)(69590400006)(16526019)(25786009)(97736004)(50466002)(81166006)(5660300001)(50226002)(16586007)(8676002)(6116002)(3846002)(81156014)(68736007)(316002)(48376002)(106356001)(498600001)(8936002)(305945005)(2906002)(7736002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:OSBPR01MB2296;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2296;23:+uZAJ/rnDKrdKW43YOJVyB63LLTXStlXg6AGvzZtxGPfXpTB/3fscu+/Ckim2qN1tkuBpu4vLyyhdO+7V4L+zW5nbREIjOa/DGfh75sMBjpKhKDHFgVuvgUnzBDyc9J7sYSlQeVasvflrWZSUE/2dao97OcmYpMB7bhPaIC3e3YAzG/6ISQcFC7t4AD4Niw8cZVSNIIj4AZ5bMxpwY3ZZWA+jpfPBGdfSHSnTBZr0e10G0yz40sN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OqBQycK3oWTZeoRR4TAq7/ehtQzn14J/GEkKU8ziAef7dyVn6hncCGumxXJDMzMpQ+5vLznKHW5CyedjNGCohAgr1YtK6yEJqzx4M36JqG2T5Ex1Z0pLsMNaJzKBDB181NfXIHoDdRLmbeD5qK/ZArJy4jRCW5qWBGrU6lyfXEBKhaSN1Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2296;20:dxcSCH0SWjeQAOt2J6ZJisymyYO9ITF9JF/HS0RhLYH5YpCGqh5wCcZ1l4LRJDAioS/+Okg0kTXZAWvEk5/vcJylWB1ipzQrGQvP/awI1Gz592o8OEy2e2wPa83spgYGSUzePA9LtIw/g5eE6YSK6U3F8q4RyJ6vZj9YQlHuYTg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 11:55:21.0460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcae63b5-26c6-4c84-8e35-08d61fb91b97 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2296 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since All R-Car Gen3 SoCs have dedicated otg pins actually but some boards don't use the otg pins (e.g. R-Car D3 Draak and R-Car E3 Ebisu), the driver should not choose SoC model base by using rcar_gen3_phy_usb2_match_table's data. So, this patch checks a "renesas,no-otg-pins" property to set the "uses_otg_pins". Note that since r8a77995-draak.dts and r8a77990-ebisu.dts don't have 'dr_mode = "otg";' for now, if we apply this patch, no behavior changes (the value of "uses_otg_pins" is false). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman --- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c index d69317e..856056e 100644 --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c @@ -78,8 +78,6 @@ #define USB2_ADPCTRL_IDPULLUP BIT(5) /* 1 = ID sampling is enabled */ #define USB2_ADPCTRL_DRVVBUS BIT(4) -#define RCAR_GEN3_PHY_HAS_DEDICATED_PINS 1 - struct rcar_gen3_chan { void __iomem *base; struct extcon_dev *extcon; @@ -385,21 +383,10 @@ static irqreturn_t rcar_gen3_phy_usb2_irq(int irq, void *_ch) } static const struct of_device_id rcar_gen3_phy_usb2_match_table[] = { - { - .compatible = "renesas,usb2-phy-r8a7795", - .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS, - }, - { - .compatible = "renesas,usb2-phy-r8a7796", - .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS, - }, - { - .compatible = "renesas,usb2-phy-r8a77965", - .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS, - }, - { - .compatible = "renesas,rcar-gen3-usb2-phy", - }, + { .compatible = "renesas,usb2-phy-r8a7795" }, + { .compatible = "renesas,usb2-phy-r8a7796" }, + { .compatible = "renesas,usb2-phy-r8a77965" }, + { .compatible = "renesas,rcar-gen3-usb2-phy" }, { } }; MODULE_DEVICE_TABLE(of, rcar_gen3_phy_usb2_match_table); @@ -445,7 +432,8 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) if (of_usb_get_dr_mode_by_phy(dev->of_node, 0) == USB_DR_MODE_OTG) { int ret; - channel->uses_otg_pins = (uintptr_t)of_device_get_match_data(dev); + channel->uses_otg_pins = !of_property_read_bool(dev->of_node, + "renesas,no-otg-pins"); channel->extcon = devm_extcon_dev_allocate(dev, rcar_gen3_phy_cable); if (IS_ERR(channel->extcon))