From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC4BDC31E46 for ; Tue, 11 Jun 2019 22:33:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0F402173B for ; Tue, 11 Jun 2019 22:33:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QKzewkqq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405635AbfFKWdx (ORCPT ); Tue, 11 Jun 2019 18:33:53 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36812 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405516AbfFKWdx (ORCPT ); Tue, 11 Jun 2019 18:33:53 -0400 Received: by mail-pl1-f193.google.com with SMTP id d21so5723045plr.3 for ; Tue, 11 Jun 2019 15:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rheF1XeHr+TBtp29Z8BqnMhDdcbdifoVvsMUnTVTQ0w=; b=QKzewkqqr14aegyj9+KanpTXPALGWcAhgyKlFkPm+hIUpaiT5vfVCHwLDQjJnicRB4 jWOVMCSmyMs7lj97v8kBr5AIAjLEtAYARRhQvSIdJl6dY8M8BIMwu6hXtzBO/6hQAAVZ R/3aJvCS5f1cpoXdCsmvWLdPJctFcP3gL7lhMRFa2f04l87qEV3sG+LctemNIIutyiz0 coO2IFn//1n30Y5C3x2psChDUceRjUq3sahJi0y3yAlHV+XXZsp9XT/sRIA/UjAFFgGJ VuUO6M6OzU+lbVMu8QhXHbQzabAHnK3JcUwmnUhN5ilGVa3HtEDaHSJuGg4zy3T9ddsl /2iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rheF1XeHr+TBtp29Z8BqnMhDdcbdifoVvsMUnTVTQ0w=; b=dwfbeYmuiyxuIwGf/RISWwF+5ZzEze3hyr2NscXI4EXk93vCTSctEMIMqzXn96THk/ sMX+Y1rWOJKHkNRyE1/o75z8Pkv9iB/1CN+21TWx9ZjrRqMQwy1ks12d5TP16iuPB6Qd 8Yrf6w/Qq/OEWTnROidy8gsUIRMaMXYwbPV2zBuEwJ7EVwSVE3Xk9rPK9XRAj2TIBRZD FHYuaZCRUZlm1VBOM7gtxNm+T/YVN+PQ3s8nI043flGW0KIY1vBKJaaFUG3wpG8rfiuf zBh3Bi0q2f7Rol8II46hv3LHvqcAoSwbvRan89BSE1TZH6nBqm37fPkWkrsO4YKCpoj9 ntEg== X-Gm-Message-State: APjAAAXU3JtsZPNwT71RrYgjsqKs825YhYsmLXEU+GLVthpSgvZNB5yh 8xznu8VeNF+DqGJBMu5xp6X+VQ== X-Google-Smtp-Source: APXvYqzOrGp2e1lCEgBy09sDw+6XFk1Cp1xh3ZSUOlQ7lXvCww/YU+McON7j6rpV8WQzMMdtV7Kusw== X-Received: by 2002:a17:902:42a5:: with SMTP id h34mr40878255pld.16.1560292432547; Tue, 11 Jun 2019 15:33:52 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id w4sm18222973pfw.97.2019.06.11.15.33.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 15:33:51 -0700 (PDT) Date: Tue, 11 Jun 2019 15:33:49 -0700 From: Bjorn Andersson To: Lee Jones Cc: alokc@codeaurora.org, andy.gross@linaro.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, linus.walleij@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org, ard.biesheuvel@linaro.org, jlhugo@gmail.com, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 7/8] usb: dwc3: qcom: Start USB in 'host mode' on the SDM845 Message-ID: <20190611223349.GS4814@minitux> References: <20190610084213.1052-1-lee.jones@linaro.org> <20190610084213.1052-7-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190610084213.1052-7-lee.jones@linaro.org> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon 10 Jun 01:42 PDT 2019, Lee Jones wrote: > When booting with Device Tree, the current default boot configuration > table option, the request to boot via 'host mode' comes from the > 'dr_mode' property. As I said in my previous review, the default mode for SDM845 is OTG. For the MTP specifically we specify the default mode to be peripheral (was host). The remaining thing that worries me with this patch is that I do expect that at least one of the USB-C ports is OTG. But I am not able to conclude anything regarding this and host-only is a good default for this type of device, so I suggest that we merge this. Reviewed-by: Bjorn Andersson Regards, Bjorn > A property of the same name can be used inside > ACPI tables too. However it is missing from the SDM845's ACPI tables > so we have to supply this information using Platform Device Properties > instead. > > This does not change the behaviour of any currently supported devices. > The property is only set on ACPI enabled platforms, thus for H/W > booting DT, unless a 'dr_mode' property is present, the default is > still OTG (On-The-Go) as per [0]. Any new ACPI devices added will > also be able to over-ride this implementation by providing a 'dr_mode' > property in their ACPI tables. In cases where 'dr_mode' is omitted > from the tables AND 'host mode' should not be the default (very > unlikely), then we will have to add some way of choosing between them > at run time - most likely by ACPI HID. > > [0] Documentation/devicetree/bindings/usb/generic.txt > > Signed-off-by: Lee Jones > --- > drivers/usb/dwc3/dwc3-qcom.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 1e1f12b7991d..55ba04254e38 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -444,6 +444,11 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) > return 0; > } > > +static const struct property_entry dwc3_qcom_acpi_properties[] = { > + PROPERTY_ENTRY_STRING("dr_mode", "host"), > + {} > +}; > + > static int dwc3_qcom_acpi_register_core(struct platform_device *pdev) > { > struct dwc3_qcom *qcom = platform_get_drvdata(pdev); > @@ -488,6 +493,13 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev) > goto out; > } > > + ret = platform_device_add_properties(qcom->dwc3, > + dwc3_qcom_acpi_properties); > + if (ret < 0) { > + dev_err(&pdev->dev, "failed to add properties\n"); > + goto out; > + } > + > ret = platform_device_add(qcom->dwc3); > if (ret) > dev_err(&pdev->dev, "failed to add device\n"); > -- > 2.17.1 >