From patchwork Tue Jun 4 10:44:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 165749 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5668022ili; Tue, 4 Jun 2019 03:45:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXuQ8r/u4+JyoqStlZt4ijFaKqSIxq+0BjjCiIo8L2a80wK8uyX1dAST05gYSWWB72MogO X-Received: by 2002:a17:902:363:: with SMTP id 90mr35372499pld.131.1559645109841; Tue, 04 Jun 2019 03:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559645109; cv=none; d=google.com; s=arc-20160816; b=DI+Z9sCosKE479pyrWXPAp7oZ14e7Kl53KH5xzUPhgX4z6UHskk5vAJgS+DkC8Bk++ wHyx23u9Y5eNydoTQE8UEj7P+xoyi6NNNhfYfxLD/AXlf3o7jw6jizjPLbRY0eG8jiH3 5wDbeYnOW5rOJ/ZY6hw5lB3sl2+TFRO82aOM4i0Ctk3PqqO+J6ubT7QQHIadV25lPkZr GloOdHlP4YNU0BoCxDZmxDmgZcy6QOnb9boOEcS3x2FtHw4BKnoL+CG6R+NMsep/HHdM 5aDrcVtCMWJWi664weE2B0dAryP3/sDqYOqYZso5B7uQdx76FcXpGaSCpSGNnufTo0Gf aG3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=2HLapY/4ckHjahK5LJcjODvHB1d03rrvr/gU9+ztXyQ=; b=Wva5LgtjiZf6e3qjYGD5WULWpGes+688VIvYf53iZt3JF6HRO9ar+KxaiqPSHsqzOo TPypqgWoBDsypFoGcRPAdK/vQownSou+SfX/DPd8U3wejf/jIwnOBsmgo3+qUAmWbKUp fBFMcia1xJQ3dUzJj/fnC2gaZQZCqQdq/j9JKJ4BCUNvFwUHD8PuT8Mw+VRjpM4OhyWm tU+G9/oUu81g2lLEjQm2f0Nj6Qe+irKG+XLEWmYF6C/j7Wwfxm2nik+MOUbQyw5X7PSy zPn1vu7shlyNR6fq3hm37B4+zNymk3/oSP9sCVxZnqtxV7znir90yBhZLQpNyOyMB/0Y 2PZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h3nEBCdf; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si11740119plo.34.2019.06.04.03.45.09; Tue, 04 Jun 2019 03:45:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h3nEBCdf; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbfFDKpJ (ORCPT + 5 others); Tue, 4 Jun 2019 06:45:09 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52488 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbfFDKpI (ORCPT ); Tue, 4 Jun 2019 06:45:08 -0400 Received: by mail-wm1-f65.google.com with SMTP id s3so7003552wms.2 for ; Tue, 04 Jun 2019 03:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2HLapY/4ckHjahK5LJcjODvHB1d03rrvr/gU9+ztXyQ=; b=h3nEBCdfV7YoBlTlbe54J+YSDIvFJyXTob8NuoluPo7EfSZZElzYcZr6vSJWljnUnv dWRhGXI+d9hH5RgiAEGyaeZmndgWDOABLjIe3Fmy5TenMX9By9v01G8ZKdnulQokaH6A FKRiNN1x249LHRm8hy9rPBQnyYz1oVhCtEeYxPQomujeraH88eVU2RDpZYk8KZlLVtqR SOc/OCn6T89mrbQHSERwodJdfezyYN4154BMhcEWEUhOTb5rv7f8twOa0IADvr5wEn8c MacizzPwwOcliiupf2xtn0WwMsVCTUP3KKg8y95UkCtqVxXdgJrcDkPOTEsE0rsVuYCR c/xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2HLapY/4ckHjahK5LJcjODvHB1d03rrvr/gU9+ztXyQ=; b=bCbvDlccmMW76ldYYUTw78MlEschXc9CXNhxyIsVGxZo1ZtDoNxFMGJvwFk2zOlF9l dDMm4MqicQC8QOTExQZpCPv6YbspzZYMpbb6/c2D2uYsyvI4EdOIbeaGx/KdRHr7s3Ld uvEIUEMaSXtizmdhyXlm8JhacLEYuf/Py0Jdm/08/lW+nWQw/kqXo9p6Vw2NvWn5g5dc 9YKalfgby1kWSKJMhDj4YmGQOUKRxN79cF4eXQR6svlW6TOT9BmXMGYJ5f29cKGmmeCj OCempTaMdZuS2SRq10n35FKAFhpIaGtQcW0SRl8IBme/vv0bICS51VuaafIa8Nfi0Hks RiIQ== X-Gm-Message-State: APjAAAWaAi8GXfNxEFK9O6h0MBvAeZYuzvLKMmwCFW7KerDWz7BZwbUI +Q6K72sK+R+KzPZFnOstHFw47A== X-Received: by 2002:a1c:b4d4:: with SMTP id d203mr18294440wmf.34.1559645106162; Tue, 04 Jun 2019 03:45:06 -0700 (PDT) Received: from localhost.localdomain ([2.27.167.43]) by smtp.gmail.com with ESMTPSA id t140sm2718623wmt.0.2019.06.04.03.45.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 03:45:05 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, kramasub@codeaurora.org, andy.gross@linaro.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, bjorn.andersson@linaro.org, linus.walleij@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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, Lee Jones Subject: [PATCH 7/8] usb: dwc3: qcom: Start USB in 'host mode' on the SDM845 Date: Tue, 4 Jun 2019 11:44:54 +0100 Message-Id: <20190604104455.8877-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604104455.8877-1-lee.jones@linaro.org> References: <20190604104455.8877-1-lee.jones@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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. 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 Properites instead. Signed-off-by: Lee Jones --- drivers/usb/dwc3/dwc3-qcom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.17.1 diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 349bf549ee44..f21fdd6cdd1a 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -468,6 +468,11 @@ static const struct acpi_device_id dwc3_qcom_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, dwc3_qcom_acpi_match); +static const struct property_entry dwc3_qcom_acpi_properties[] = { + PROPERTY_ENTRY_STRING("dr_mode", "host"), + {} +}; + static int dwc3_qcom_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node, *dwc3_np; @@ -603,6 +608,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev) goto platform_unalloc; } + ret = platform_device_add_properties(qcom->dwc3, + dwc3_qcom_acpi_properties); + if (ret < 0) { + dev_err(&pdev->dev, "failed to add properties\n"); + goto platform_unalloc; + } + ret = platform_device_add(qcom->dwc3); if (ret) { dev_err(&pdev->dev, "failed to add device\n");