From patchwork Mon Aug 27 13:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Adell X-Patchwork-Id: 10577111 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 AA98C14BD for ; Mon, 27 Aug 2018 14:00:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 905A329C3E for ; Mon, 27 Aug 2018 14:00:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E4A129C22; Mon, 27 Aug 2018 14:00:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 EF20D29BE8 for ; Mon, 27 Aug 2018 14:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbeH0Rqx (ORCPT ); Mon, 27 Aug 2018 13:46:53 -0400 Received: from mail-eopbgr90084.outbound.protection.outlook.com ([40.107.9.84]:63875 "EHLO FRA01-MR2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726931AbeH0Rqw (ORCPT ); Mon, 27 Aug 2018 13:46:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=actia.fr; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/UvbPQew15ROX2WOCgBrDkOg8AzpikZWF6593C9tx3I=; b=WGh2I+qnji7PYgeSEDGFASRyzmMxq2u+7YsDFwdatDXJrgxc+FPuO3YlpXUuVueaIad9UWVeXdlVYmoS77YblVKQYu62iO2rHeire48GenFaJwwStLEaaLMHmZng5MyJqDvee26IkRup5JS+Fpbh/pCdYUi+ZsDkBAxE/qla26c= Received: from localhost.localdomain (212.194.216.83) by MR2P264MB0051.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Mon, 27 Aug 2018 14:00:03 +0000 From: Nicolas Adell To: Peter.Chen@nxp.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, nicolas.adell@actia.fr Subject: [PATCH] usb: chipidea: imx: enable OTG overcurrent in case USB subsystem is already started Date: Mon, 27 Aug 2018 15:59:56 +0200 Message-Id: <1535378396-9328-1-git-send-email-nicolas.adell@actia.fr> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [212.194.216.83] X-ClientProxiedBy: DB6PR01CA0016.eurprd01.prod.exchangelabs.com (2603:10a6:6:45::29) To MR2P264MB0051.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:4::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2bbc7044-a3f8-4a24-d1d0-08d60c256364 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:MR2P264MB0051; X-Microsoft-Exchange-Diagnostics: 1;MR2P264MB0051;3:3F2PDmS1LtfwbU1hO/TkmYWaEAMj7aLL/Ct+P/3hkMzUvQ2Fl2MsrtyD7HZBK/pda44B6ZQmL5jTOYUNtJdBMG9yKROXsUzz6x0LH4nACpk4/K86nnWSU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kes3WZQPUrHRFDTiDTv75WMKFEAGU9f03QEJzlJZyWorQ9pBoj6W8wOGkOxvNp9PDcVmBkQGUsOkaeJ0DS4UaFlpSzDb7LBM5Ivma9qrc+XiaPmYA9fNn5yfkMYpNaSjKsv1ApUHFJd7uZCRwrE89TW+zqqIiw== 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:(6040522)(2401047)(8121501046)(5005006)(823301075)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699016);SRVR:MR2P264MB0051;BCL:0;PCL:0;RULEID:;SRVR:MR2P264MB0051; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(376002)(136003)(366004)(346002)(39850400004)(396003)(189003)(199004)(14444005)(6666003)(6916009)(105586002)(478600001)(5660300001)(6512007)(106356001)(48376002)(53936002)(2361001)(50466002)(305945005)(2906002)(81156014)(74482002)(7736002)(81166006)(8676002)(2351001)(36756003)(86362001)(486006)(6116002)(3846002)(316002)(6506007)(386003)(107886003)(4326008)(16586007)(956004)(476003)(97736004)(2616005)(25786009)(8936002)(68736007)(6486002)(44832011)(50226002)(51416003)(52116002)(1857600001)(16526019)(186003)(47776003)(6346003)(26005)(66066001)(69590400005);DIR:OUT;SFP:1101;SCL:1;SRVR:MR2P264MB0051;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: actia.fr does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nicolas.adell@actia.fr; X-Microsoft-Exchange-Diagnostics: 1;MR2P264MB0051;23:iHvKaEZs2ngUz1NVDPOUBvO/B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TJ9tMlhOjwnele44CLgrMcCjmGpLbWd3zq+iE1y2Ad3xkjSZa3Qwvfk0F9AKsA==;5:kLfdvPQzhTVNMjjwLGdvGdx+zROnNeJO+kiYKLZc6QTlqBu2SL3rtqQcGRiT2bIXqLaXthUbwThC3YWhgjCf5A4zeUxFKbuv/sD4CQ0JGL4F+6N06J25pZxMQ01pdauojRI56cJYqxUidG+CIyeVqkEn7eyIL9Vmj4thnpGTYUI=;7:RNu4GGpFke1yLZFOwFX8sWIrre9MLlEUjNhCK2IVjMemGkixkMPcwUuVZPU3Fv8t9mMXVMVWqRuZ2cmOoc8/kj8tb19qBbv58HUSwwyfHmcQPH49N4tljhQRnog+lVLsEqp9S5VXNPRdAv58KsDj2uot6IVz6lZ0QkzzVSW+j6an4AykSyxf2ZpS2Y38QxUloTzUgF9nkytgzqX9Du2EwFPuidNycStFaw79c9hOQzAjJtryceIjVZXj+sCqv0x6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: actia.fr X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 14:00:03.5335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bbc7044-a3f8-4a24-d1d0-08d60c256364 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 86314f06-03e8-4460-82f3-a44f992a19c7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR2P264MB0051 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When initializing the USB subsystem before starting the kernel, OTG overcurrent detection is disabled. In case the OTG polarity of overcurrent is low active, the overcurrent detection is never enabled again and events cannot be reported as expected. Because imx usb overcurrent polarity is low active by default, only detection needs to be enable in usbmisc init function. Signed-off-by: Nicolas Adell --- drivers/usb/chipidea/usbmisc_imx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index 34ad5bf..424ecb1 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -343,6 +343,8 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data) } else if (data->oc_polarity == 1) { /* High active */ reg &= ~(MX6_BM_OVER_CUR_DIS | MX6_BM_OVER_CUR_POLARITY); + } else { + reg &= ~(MX6_BM_OVER_CUR_DIS); } writel(reg, usbmisc->base + data->index * 4);