From patchwork Fri Jun 7 08:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166067 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp346200ili; Fri, 7 Jun 2019 01:29:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5UiisAnHmgOP0QRAvGdQ6TehWdlmLsJAOLfNUJNB6SkRve4M2YGhIjvX6fcLRXPUDIkW8 X-Received: by 2002:a17:902:2a26:: with SMTP id i35mr16088037plb.315.1559896154754; Fri, 07 Jun 2019 01:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559896154; cv=none; d=google.com; s=arc-20160816; b=MM5efAg/dcldsVeYQlmz/Z29vYpW75O9utcgISP68O/3PSWLzic+XWMfqaumbVmTHB fSgZA5+NMAWA+FLah829I18pJgabvVq4dOJhKRvRe2coPVijEOteXspokrWt1PssnlBR HUB/McQTm2Cy8BssVl4jHwnQy3HhXThmQKIpV153FlqerId1Akrj0SlLkZko3adAWwKP yPzf9dTjHe8DBYEj+WI8/DZuplSAlQkolBe7mmH8sRjIE8aUOoTs5YMtZnS5JEgnjGrr vv4DP/2zLTyzKWwwG52rstn0ywH+UreVWZxMla5TWo6ZJ5vQ8sMDdLq8EGrSgbl9ynsj Bsag== 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=Ixa6PZM7Qd3yNTQ1/2lb9UJukHzNBYD4+3OM8ec4OSs=; b=buS6s3mJfRDQ/5vrGEDjXSyWOd6wZNoffifVURrpjBz7EZANLnqaiQziN80OxdlvT5 KNGfZN1eD0VKeSnoKrAEQ8KQrM3uOIgvKlTldPwpw2e+Op8oySe9WnRMwsprPcnK10W0 2oEPZfrZXULAuSYzGa/nOJuszuIJ/oGsKp94+X3THcPlxZD331kBvEQowF+15CHEcj9p zbYmcFMaWnu63D7dl6CmZT6G7IL6/TEvOUja3ypK60rZr7we7OIZuySDuZgdwdD1Mi6V t3hw2uM6EZFRuCor8+9qPzjKVPS80joo/yu8g8De6WEOFddlCMvjKIkwtkjxeQq8X/le 5chA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wikC+rZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r18si1186838pgv.433.2019.06.07.01.29.14; Fri, 07 Jun 2019 01:29:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=wikC+rZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728052AbfFGI3N (ORCPT + 30 others); Fri, 7 Jun 2019 04:29:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40671 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfFGI3J (ORCPT ); Fri, 7 Jun 2019 04:29:09 -0400 Received: by mail-wr1-f67.google.com with SMTP id p11so1228841wre.7 for ; Fri, 07 Jun 2019 01:29:08 -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=Ixa6PZM7Qd3yNTQ1/2lb9UJukHzNBYD4+3OM8ec4OSs=; b=wikC+rZdUqNR3zYa4TZ+AvztWEikBNz5wbZm7r65rxsnDyDgTfXlcYq+WBYqLs5jOj hr74PKupzOhMt9dxYf6nfiWkRnedKpch2Vvd51AjOYuHM9Sd+qNyIws2b/VS4SqYvvW/ TVZsTX7wKv/zNdLjvgeu61VENnYiQR4EMDVwBn+sbW6KBtD/NpmwstvwzEddF2SEOiu1 O1VU/WvDqteNLlGZQDiR725yriDo+UadwNwdtidpPyKmw4jNY53RybTW4UkDYFMuPBPk ZF3ChktwCFp49vXoN989jLPXyfMlgOlk9DRIVrUTXbWabbEqSsLw0HnmNMNlGZaZd+n7 m4BQ== 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=Ixa6PZM7Qd3yNTQ1/2lb9UJukHzNBYD4+3OM8ec4OSs=; b=nmIAJTgxBF/ck4lK8D5UfrKH4RmK5YgAaOksb4aClQUnuTOSyBq7jGERplobPQ3MHe Eg3Ord8oqqzWAnjrr96meaUfh8/fiYiWmMXs8QUMqcjklcsMCE1W84WuQyFib0QS7gEt YyKL45bUEpyY9y/DxpsfRnkVM9PfIQ6PYQQaK3SGibIN5PGRkoobSHq+AFQ7OBBHj7v8 sLqNPVaLTqHqGC6ghwX27C7RbYFP4MJGAkp0jCJpya97MHoogcJkx6mFFnVMLS6sD++5 rHAzoYxd4JUS32GbomaOpuP8Yzts2vB62/b3AjYORjcq7a4e81rvYl4DJb0AUVSFXk1B 2oPw== X-Gm-Message-State: APjAAAWKw++zXQca6a/UvdGgiwuZCMioceYBaNIwsl2T1nmj0fCTUoTS gLhrU/sP1C5dRW7J9J/76zFVFg== X-Received: by 2002:adf:ab11:: with SMTP id q17mr18952194wrc.182.1559896148016; Fri, 07 Jun 2019 01:29:08 -0700 (PDT) Received: from localhost.localdomain ([2.31.167.229]) by smtp.gmail.com with ESMTPSA id a3sm1092946wmb.35.2019.06.07.01.29.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 01:29:07 -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 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 v2 5/8] soc: qcom: geni: Add support for ACPI Date: Fri, 7 Jun 2019 09:28:58 +0100 Message-Id: <20190607082901.6491-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190607082901.6491-1-lee.jones@linaro.org> References: <20190607082901.6491-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index 6b8ef01472e9..cff0a413e59a 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 (ACPI_HANDLE(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 (ACPI_HANDLE(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 (!ACPI_HANDLE(&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);