Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5068578pjb; Mon, 27 Jul 2020 12:06:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAweH1b3zY4R1Jyk17sQ7mOvnpQbi4MxoyE2LdFD8TyKsxfPDSxZIjYokL2LbT++z02cdA X-Received: by 2002:a17:906:82d4:: with SMTP id a20mr21295941ejy.165.1595876782060; Mon, 27 Jul 2020 12:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595876782; cv=none; d=google.com; s=arc-20160816; b=Sw1gBMR9zCZRCxwBC+abxdJSFReLU6nAMQgSYshvaAD2jVGUGEWEti9vynHYzgrHnG uJxAghccex4AalwxVCtPhj/M/y3Q+t2pbV4RaFNoNRl03dEd3W/vhjT7ylZM4wx7EYtW kCojNbX6MmBTCNeaPtda6oq2WpR0LELwtmaCveR7IPKewkNCUK1N9sGXQYaJl/qID8Ia onwAPkaUT3+UEoIQb75WoFosgBfRdNWWTLwtdTV9iblapuLUPrM2eLdw9h2M5foNIzfT ZzVvxowWf+EZvTCj2dvg91ilzFXmatssQ1fUSRncu5AmHzph6Ii8vpjej8Ms1bpD8/i2 nm0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BfQsl2VkPzgMjJHaARqwNqUbw1qIxknvRprBs1qxAqw=; b=y88Ig25kmfkkkXSJBJA4uvUGaK8Nw6z5WIeFuT/vADdB6zziwhxaWY88cS48v0w0B/ eiSY8xs5SMrMm4spcJw3BE72pDEnZZMeLH59ZexkJIDUV1u7f8Y78iL+vhdms63YyNYy GJP6OfDzHULExcf98AcKPocAdZi6DDIXutDBExteoyQChH2Q/M7D4VTJxNJcWHWvq9sp +RrgwDLPwDM9nAwA7hhS56VTC1ys8RiRiA3flpAahGu908bquZ3CqZpm5T7B9+BWQaI2 202zLsMZ0WHzDSv/J3i6MlsQGd0awH3u6CnpKTfn17+VdHpm8GGwinUuuyorjqBXcMnr WwiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=rvIHSw7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy15si5723569edb.22.2020.07.27.12.05.59; Mon, 27 Jul 2020 12:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=rvIHSw7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729125AbgG0Rz5 (ORCPT + 99 others); Mon, 27 Jul 2020 13:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbgG0Rz5 (ORCPT ); Mon, 27 Jul 2020 13:55:57 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9B3C061794; Mon, 27 Jul 2020 10:55:56 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id v22so2024531edy.0; Mon, 27 Jul 2020 10:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BfQsl2VkPzgMjJHaARqwNqUbw1qIxknvRprBs1qxAqw=; b=rvIHSw7X95GJr0+XCFfmmero5cD0/utExmJuKYz5Qs91sBvJXMlcCDzKQXK2BYAF0q AOyqJaZngQWr9wfISZQjGxz7+meMd/1D7iHIkUQofP/eBvXJf6CUZyBQGBZBgRfC6trk i9V1whbAYAhLMZ1Ng8LBUYQyNA/ltTX7xk7PRr1gOsJQE7fPjvrOOFpVSMbkdKEEGlPd xIdBRhbyQRReLzRwZ9apKo1+tqI81oY9UNdZe2783fIH1PaB3ImM/EoqUJ9I2Gjtb1DL aZ7sqkAYV32yhov8ktBIyeVgaGarSpP8xTcJTPyK+iDceCdsXg9JT/G41ThxH4puV+mT 9jUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BfQsl2VkPzgMjJHaARqwNqUbw1qIxknvRprBs1qxAqw=; b=qUAcUwjRsMi+656tO/+nwplMOtyceqfV0O4dcswWJo/RYyNH7Z+7JAdIGy3YxGYKfe rlg0YKaGrcOcgANRA8eGvcHdBwgTlzz+Gk8MBNzdoR+fRhhgVD1KJGoISktgoncRH7+J uAeVzotOlod9rF8ZbA0P9dXFIWv239YZGud9a03SN2HAlIppUiZ3eqw0vQsaGyxfx91p 0GpYeu1jOv3Oixm/OdsK2R8mmpvkcX2uBlVqTk9q9p45a7Dh113/1TAI1SzJLnxvzu2o rMy3bsW1NevIJYhoGDrzXwXc31SFwNbdG2qExZ/0Kww9kszF1t7aP2TU4ty2v/kxdG9Z YA5Q== X-Gm-Message-State: AOAM533jdzm8dIztfRpxT9Eul51/wcIINY0qxRSgXZUzGhQV/94d6l2E LREdDs1dqGwpq/BjpIHXoSdPZmSZCYh70qU4Qh8= X-Received: by 2002:aa7:c788:: with SMTP id n8mr2559169eds.146.1595872555514; Mon, 27 Jul 2020 10:55:55 -0700 (PDT) MIME-Version: 1.0 References: <20200727092346.19780-1-amelie.delaunay@st.com> <20200727092346.19780-3-amelie.delaunay@st.com> In-Reply-To: <20200727092346.19780-3-amelie.delaunay@st.com> From: Martin Blumenstingl Date: Mon, 27 Jul 2020 19:55:44 +0200 Message-ID: Subject: Re: [PATCH v4 2/3] usb: dwc2: override PHY input signals with usb role switch support To: Amelie Delaunay Cc: Minas Harutyunyan , Felipe Balbi , Greg Kroah-Hartman , Rob Herring , Maxime Coquelin , Alexandre Torgue , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Fabrice Gasnier Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amelie, On Mon, Jul 27, 2020 at 11:23 AM Amelie Delaunay wrote: > > This patch adds support for usb role switch to dwc2, by using overriding > control of the PHY voltage valid and ID input signals. > > iddig signal (ID) can be overridden: > - when setting GUSBCFG_FORCEHOSTMODE, iddig input pin is overridden with 1; > - when setting GUSBCFG_FORCEDEVMODE, iddig input pin is overridden with 0. > > avalid/bvalid/vbusvalid signals can be overridden respectively with: > - GOTGCTL_AVALOEN + GOTGCTL_AVALOVAL > - GOTGCTL_BVALOEN + GOTGCTL_BVALOVAL > - GOTGCTL_VBVALEN + GOTGCTL_VBVALOVAL > > It is possible to determine valid sessions thanks to usb role switch: > - if USB_ROLE_NONE then !avalid && !bvalid && !vbusvalid > - if USB_ROLE_DEVICE then !avalid && bvalid && vbusvalid > - if USB_ROLE_HOST then avalid && !bvalid && vbusvalid > > Signed-off-by: Amelie Delaunay please add my: Acked-by: Martin Blumenstingl The usb_role_switch part looks correct to me I don't understand the details of the dwc2 hardware well enough to say if the rest of this patch is fine or not (which is why I'm giving my Acked-by instead of Reviewed-by). Unfortunately I'm still fighting with the Amlogic bits (or my board...) to make this work on my boards. That why I can't give my Tested-by yet At the same time I'm confident that the problem lies within the Amlogic OTG detection/GPIOs so I don't see a reason to hold your patch up due to this Finally, please note that there may be a small conflict due to one bugfix I sent: [0] I think it will be trivial to solve (since we're both adding a new error label) Thank you for your good work again! Best regards, Martin [0] https://patchwork.kernel.org/patch/11687357/