From patchwork Mon Jun 10 08:42:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166292 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp758883ilk; Mon, 10 Jun 2019 01:42:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDA1iUcQdCjerP1dt0jKVBfoF6gTLG1bJMfszh0A7Y8DUMTH+X9iw8vJT0rwP+TDYj+gYH X-Received: by 2002:a17:902:848b:: with SMTP id c11mr46916386plo.217.1560156167895; Mon, 10 Jun 2019 01:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560156167; cv=none; d=google.com; s=arc-20160816; b=ldx1ZTl5m6gzikn65gsAF2ckmbsFE00egd3m5AyVkmESp45LxV/5jywTc+9YP+2EyW q+LEjvhJwkiACOyj40DEPNjjPe1e9VBdikg+b9l2XM0RA4GPQSCJ5thVvEj+Y/D1x4EH UuHns9PbYuJUJklmq7x+xa4GwEZkSCfKLArHM84xzkx3V6+XzUGz61FMe2PCNGbC9UjU EmkaOIi59JO2JBAfu+m+eTXh7ioVWugXYQkqPGQTSjTFOuNf8m9R2w87hmwlIJvuoKuy fppzDNyjk7gAbnfoohVGhF5bv3tziZ1ExNR1oxsQqkIhaFUdIMa0X8vXi+vEf1GGKVDf o3Yw== 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=9rm9ccpuGtAMzIOW1NWstMoYndtXNXfoUtRC4Q0MWiI=; b=ZZOZqYemruk4LP2r3H2GShLdbEo2bQ+qePOhCQyGS5/VytmbvqKX8aQnzzLJVlmfNk OqJ3xso6LBQJTstNfbOcYb2c2sIk+VjiBvzusRzcPedO14ZT0kA+PEJMgYm+LjQJMjOn 4R7Tds+Lc93Nr31mFtyyzAVkgOb3ppP7xtCelkyShq9XeOtvrKUf+FnvJJmWzD6VbN9+ 8sFHX0t7EaJ8pqbYpcE5ZfceZcrahG43kBCnfGrPA2CZp9y2PYzZl49vEXiviR4LLWUF 7ZqUZvvw1Q/WHE+eMjFUFXz9obQgPg1k51qKSlWLAS4mN4Ph44icyKsOyd2oDownrXjw 04hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O3IPYAnJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 c8si1839147pje.30.2019.06.10.01.42.47; Mon, 10 Jun 2019 01:42:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=O3IPYAnJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S2388547AbfFJImX (ORCPT + 15 others); Mon, 10 Jun 2019 04:42:23 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54775 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388493AbfFJImW (ORCPT ); Mon, 10 Jun 2019 04:42:22 -0400 Received: by mail-wm1-f66.google.com with SMTP id g135so7607917wme.4 for ; Mon, 10 Jun 2019 01:42:21 -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=9rm9ccpuGtAMzIOW1NWstMoYndtXNXfoUtRC4Q0MWiI=; b=O3IPYAnJIDAl9EBtH7E8TaBsbNYtCKJBzNXBhBSGchgmycGXMZ+SeXXWnHSJOF+E1x lQJx8GEVyLHbCQSfwQGcmlHAXj/qpJqdYd+xa6Ge30LjoqMMj+e3DI1Mf5jTQdOnB7lv qBdw4GPvolTSV9zkgu3+9mYCaajae+noAZGPuKK4G0hfX8CoHLO+xuJwymz43tAPCRTS oFAksS5WtCnQ7hjeAO1Bx0DsLKc7CGuGhzCCjiYBjfnFqYs9mTkBQ+gLf+CtMSny0UhA EEWQm6DVSKX1xMXFHmiAC7i0TC6/CjOQCe/Z53vgI+f5Bs62A+INNhrLfdctLDZ8DOfP EVuQ== 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=9rm9ccpuGtAMzIOW1NWstMoYndtXNXfoUtRC4Q0MWiI=; b=H9M3w7+5fsgzOJW8JwJ9pdmOeoqKSbf85uJNSoP2f9vYKcEti9ADw6j4q/XpOqr5zh /GqQuA5oUyclt+pqlPA9CZ9iaBYRZtrroziHk8O8WvoSKka37HxMa7DperLeyrwv4sAW 8PbLAINH/jAm0HSQd2vxfZMAy4n5YxNHESGLhfuEd5gE4ehR9nATcYvwB9CxrgwoMUlJ NQVuSRmp15109px9CfW0Qp3b2lLqxaWIjl7uV/u3nhcxp6S4B7NDv+IjbRysIf7oHEDo YHkIk7OjPnr/HjNhBbFE8U1SsVBbgj/bSAeUsTiZccKWPWSinkzq79vp33ad+q0Y8zVW tcdQ== X-Gm-Message-State: APjAAAUCZoPrUDwfhS4gDOtGcWpVw8M764T5PSfBORtkrVGuIb/lN7HU MH9NxDIKCE+knYDMsmSGDuCRcA== X-Received: by 2002:a1c:448b:: with SMTP id r133mr13074978wma.114.1560156140428; Mon, 10 Jun 2019 01:42:20 -0700 (PDT) Received: from localhost.localdomain ([2.31.167.229]) by smtp.gmail.com with ESMTPSA id a125sm9929670wmf.42.2019.06.10.01.42.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 01:42:19 -0700 (PDT) From: Lee Jones To: alokc@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, 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v3 5/8] soc: qcom: geni: Add support for ACPI Date: Mon, 10 Jun 2019 09:42:10 +0100 Message-Id: <20190610084213.1052-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610084213.1052-1-lee.jones@linaro.org> References: <20190610084213.1052-1-lee.jones@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When booting with ACPI as the active set of configuration tables, all; clocks, regulators, pin functions ect are expected to be at their ideal values/levels/rates, thus the associated frameworks are unavailable. Ensure calls to these APIs are shielded when ACPI is enabled. Signed-off-by: Lee Jones --- drivers/soc/qcom/qcom-geni-se.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.17.1 Acked-by: Ard Biesheuvel diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index 6b8ef01472e9..d5cf953b4337 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +#include #include #include #include @@ -450,6 +451,9 @@ int geni_se_resources_off(struct geni_se *se) { int ret; + if (has_acpi_companion(se->dev)) + return 0; + ret = pinctrl_pm_select_sleep_state(se->dev); if (ret) return ret; @@ -487,6 +491,9 @@ int geni_se_resources_on(struct geni_se *se) { int ret; + if (has_acpi_companion(se->dev)) + return 0; + ret = geni_se_clks_on(se); if (ret) return ret; @@ -724,12 +731,14 @@ static int geni_se_probe(struct platform_device *pdev) if (IS_ERR(wrapper->base)) return PTR_ERR(wrapper->base); - wrapper->ahb_clks[0].id = "m-ahb"; - wrapper->ahb_clks[1].id = "s-ahb"; - ret = devm_clk_bulk_get(dev, NUM_AHB_CLKS, wrapper->ahb_clks); - if (ret) { - dev_err(dev, "Err getting AHB clks %d\n", ret); - return ret; + if (!has_acpi_companion(&pdev->dev)) { + wrapper->ahb_clks[0].id = "m-ahb"; + wrapper->ahb_clks[1].id = "s-ahb"; + ret = devm_clk_bulk_get(dev, NUM_AHB_CLKS, wrapper->ahb_clks); + if (ret) { + dev_err(dev, "Err getting AHB clks %d\n", ret); + return ret; + } } dev_set_drvdata(dev, wrapper); From patchwork Mon Jun 10 08:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166290 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp758576ilk; Mon, 10 Jun 2019 01:42:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqjifA3lMc5+PFpoKaVzn3BhgNggL2VRcZcCyKt9Cd+6LHDXn2AkXjMB9X8XAd+L8T2tR7 X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr20116042pjb.30.1560156146682; Mon, 10 Jun 2019 01:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560156146; cv=none; d=google.com; s=arc-20160816; b=kTmvbXZpRpOY+IIePyJmS8bAeSVnyIXdKd2LNgzmC3sg5boaH4ojjI/ebYeBjAViJN b6Gwd3u3aswzrx6NVkIP9gontq6Wi8KAbjTi7mrNM5QMwmA0/eDiu4naCaJ1w6kkH4a9 jy8KSOQwYutSkclsW94Dn6iWEH9ezeLAcTbkhs6xE7hKAn27UQ+sgTjlFEbEOxOJCjD2 xV6rsRV1fWk4gIIU0xAnjT5Hz/V+UjlneSqm/u1HOdXH3+1we8knxMYgc7srHefo+34d mLzKFJZreLzgW2uegbiC336HQmrQJ1/x3djh2t7qMIPUxJlY1q9oUxEAkeOQf6zXh6K2 LQqQ== 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=D1YI3KbYi08Gt53137zQUvYaTjAlj5pAkcVwiE+DyoM=; b=f+EAV8Bra1qQKqJ040wSl5EOukJzyeatS0S3Zz6GoqVRzLmIHDh5GVkH+tqcKLWbZh uEVE+BX1yEoiQDeI1DRAdwd94nXZ3BglVuFM7dsn7emx91kVsTtDcCYT26GmfKUA3dyF KX0wFjmE6zzBGfv0pE1IB3BXeCIhW4sUY5WUNeWG0OcEKuhEyWs5pkSCWirDgwOKcfK9 XuMn51ZkYE6HPx9ZS/R27lFCwKgQgicigFBa4Tb8ws6y1Rpd1XxLQJ0n9y5fRvXT5JfC qFAperKos6xtvY2VTR+yR/CV9Luo4c8sE2GyWtiOhSuJFobNNbUEOOPaEKuNhVwVNS1o s4Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fdh+cJir; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 cj19si9882295plb.169.2019.06.10.01.42.26; Mon, 10 Jun 2019 01:42:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=Fdh+cJir; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S2388511AbfFJImZ (ORCPT + 15 others); Mon, 10 Jun 2019 04:42:25 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40116 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388542AbfFJImZ (ORCPT ); Mon, 10 Jun 2019 04:42:25 -0400 Received: by mail-wm1-f67.google.com with SMTP id v19so7280395wmj.5 for ; Mon, 10 Jun 2019 01:42:23 -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=D1YI3KbYi08Gt53137zQUvYaTjAlj5pAkcVwiE+DyoM=; b=Fdh+cJirOeCPwca26GEwwWvQ3uzK3nNcYIOCYE8binAxIF/9nbOyMkwaed+EfuvQJy VqLf/0N0B9UWZzM3uwCXTlBxBRaoBDkNkBtGw3eXyQIiwzWCxJTeuq45QjmkejDndaV1 LWduK1uypyuWZFT5a5FsEAgypHaOkHW6tLNHRGr+NmxAkJq2qKanIs8glRWS71UfhM9K LSkKBodguJ08qiQbcXIpbJw/ruLp8OSwuEIBXpd4Ux3Dz+qh0qLOOfskjggq/Oe7aqpn YFYA+qd7cTUnb474P8X/pSeXinKIyv1TCgXRw0/BnhwXM7fP47h3BtLQ8YmHeChyhPGZ mIhQ== 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=D1YI3KbYi08Gt53137zQUvYaTjAlj5pAkcVwiE+DyoM=; b=FvzY5vX5/8V+K2DX5y2IOgodlNTxeF0Yg2ko/r0lt3ZaB+5sWIT7ZGZwN14xRaoe0u xQY0BQOpcIhP3ZFbnWJNsWLLZZNxKe2sN5BVZcjsoMxAapbGNuSPfv2kLk2qMz2ziOZH faesPB7ewISJQB0sfvzqysddhSh0Z8uUiJYqfupgM7V8mfTgoZalI9Uda1IGZe4dr0/h Hs1NhOLhTcxD+Sm7cON+NlyvgJvEfA8E2AInhOSbQilQBUnOiLYKqDzpyZdKhu7oyS8r 9HWgBKgXN1xcFn87abznYA3qS1CpYBmKr54fDG1xkfCAxNmkxMe6lSWEMNr93waR+um4 RDcQ== X-Gm-Message-State: APjAAAUSWaM+X93d2e3XCGLlKqljAifWi3cwZuxTFwicM/5qldmUy3Rd c8EqrCRyci/F9YMIU7UIiBdA0w== X-Received: by 2002:a1c:3942:: with SMTP id g63mr11315348wma.61.1560156142556; Mon, 10 Jun 2019 01:42:22 -0700 (PDT) Received: from localhost.localdomain ([2.31.167.229]) by smtp.gmail.com with ESMTPSA id a125sm9929670wmf.42.2019.06.10.01.42.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 01:42:22 -0700 (PDT) From: Lee Jones To: alokc@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, 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v3 7/8] usb: dwc3: qcom: Start USB in 'host mode' on the SDM845 Date: Mon, 10 Jun 2019 09:42:12 +0100 Message-Id: <20190610084213.1052-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610084213.1052-1-lee.jones@linaro.org> References: <20190610084213.1052-1-lee.jones@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 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(+) -- 2.17.1 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");