From patchwork Tue Jun 4 10:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 165747 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5667886ili; Tue, 4 Jun 2019 03:45:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqypi/4opBcnoB7QPkJRYZ2VcLycEC4wDNg+eWbi371hwpgFkB8prKV+7eknMh8Sz0l2+fy7 X-Received: by 2002:a63:1d1d:: with SMTP id d29mr35084676pgd.63.1559645102158; Tue, 04 Jun 2019 03:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559645102; cv=none; d=google.com; s=arc-20160816; b=zqPzR7wSTs5rjaAOpk2YAd5yj0ospmhM8+HRM3U2EL6aXmxIT4/7n6BY8velFbv+3+ 9vPphKGrhCk0vcwei+Df8q9paGDy67LagUXkcGh1BpZ+SEkxCq5htm+L1AXRaRKPajP2 LwNiJ1Mc5QipSi9J3/8dZD70VLA6Ae4h9fVAXE/SHTZG9QdFZtRZ+WV+fhuNOoK9NBl+ zkVoG/Y/R4JPQMxVoSRnjyYbyUIySw+zbg/K7kU0B3tMA6iK4MWyIGqtyxQae3zl/G7i Vywl8VG9mHnK0cbWLojywuIlTIMdVGDCJr3CMw63rp1/7AVHhHANAn8tdyEAZUTrfeAE vm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=nQjqkj1EN8NC8Ay0yEHmwn6X2HJX2TtkXyONunIjoOQ=; b=UjE9pYIXoPVrHTSeDu3M8t8I/5njTolB960y8lvW163/FyvrsKEsBc4jzuZuWxpMNX fHW97I7q0BXndHZIvnF7f0GqYB+HUfj2UUcqxl4QJ6aXlvCE1Fsc2qYnnOMGRUPGCcAE qCGvEpYWY+SOSC5+P0tTxkwxnhvCBSOA1WP2l0PESwW6U0ERDwSTtSHgUEwvtjTbNGvo Vm0H9X7MBKHE1sgPNmFgdfChm3bnohL5jsNfbkr7lazoQxa2Is87XGvgeGziSU+V5LE+ eMuo0QxzfN/ratWjhk/p+Qhe2WZriS1c10Qbc72Gow5AVwsbnxytYEtSZzidvfevEFaW R2eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LgaFtLgo; 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 k13si20904922pll.64.2019.06.04.03.45.01; Tue, 04 Jun 2019 03:45:02 -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=LgaFtLgo; 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 S1727386AbfFDKpB (ORCPT + 5 others); Tue, 4 Jun 2019 06:45:01 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37666 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727179AbfFDKpB (ORCPT ); Tue, 4 Jun 2019 06:45:01 -0400 Received: by mail-wm1-f67.google.com with SMTP id 22so5959543wmg.2 for ; Tue, 04 Jun 2019 03:45:00 -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; bh=nQjqkj1EN8NC8Ay0yEHmwn6X2HJX2TtkXyONunIjoOQ=; b=LgaFtLgo69Z61g+GbWOW59qkBgcDUOxjNGAQFne/2sNXo+5nvlREiDIDiZ5YaY5F9N Eyv3uRxa6TWCtsMCUJWb9Z8oapmFfry/+Ssw7nMD9REJirzVscIqSBPbu0EB+tXDsrFJ oz9y18iFepuQyqmb98O7GQYfNCXa6ElADnlthp5IzMl8S1xTIWDKver4ZF2aPfftF/WZ CeRdv9BwD+LaDbuC4g0tzV0AMVmDUGL4/e5N0YOscBVmeAlZUeRwdhH6/g9pHq7/a/rA fdQ8GAvTL8rb31m81z4MDhX0+POnf3oemi4gmNJYx+AMv8NuAF1EMYqp8A85NWygnW/u Tz5w== 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; bh=nQjqkj1EN8NC8Ay0yEHmwn6X2HJX2TtkXyONunIjoOQ=; b=mvqVyXRVyhkZS1HW6EONh+4SjAMxnqSLJSN8YKrL+RFt17mKebCGc/+n0kHaIs1GqS EuDZ3j7kIRkC/jDurnSUTntXu/VNmom+Ygl/0jqM63/Apk16W9ukwT9AltzWBbS+IZWb 5FJvLlMyK8s0vBSB/FUFLL6Kpezj2dSGI3D2dANG3VLqe+zBsYPm9i0JmoiWoG5EfjfV J6eTWjBAdZNLyZPnwCYV69+I9lD83Kgx/Ace5JATQVWNhuFmsfao59wCA65pU1EzhHOX 2CjtHrr0ZCAcBXpTuFJbSm337Oj4DsMJUV09W8vcb8fASny99yCtjPu+eZThyNUNf/pT 0Bng== X-Gm-Message-State: APjAAAUXtVk+DwnKSEYhg1mCBVJpWIjkRFjwB23P8YfDcNCrmE0Ao22T H+eDiGI50NIR/wFUl8fu9Xk9WQ== X-Received: by 2002:a1c:448b:: with SMTP id r133mr5943280wma.114.1559645099469; Tue, 04 Jun 2019 03:44:59 -0700 (PDT) Received: from localhost.localdomain ([2.27.167.43]) by smtp.gmail.com with ESMTPSA id t140sm2718623wmt.0.2019.06.04.03.44.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 03:44:58 -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 1/8] i2c: i2c-qcom-geni: Provide support for ACPI Date: Tue, 4 Jun 2019 11:44:48 +0100 Message-Id: <20190604104455.8877-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add a match table to allow automatic probing of ACPI device QCOM0220. Ignore clock attainment errors. Set default clock frequency value. Signed-off-by: Lee Jones --- drivers/i2c/busses/i2c-qcom-geni.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Bjorn Andersson diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index db075bc0d952..0fa93b448e8d 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.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 @@ -483,6 +484,12 @@ static const struct i2c_algorithm geni_i2c_algo = { .functionality = geni_i2c_func, }; +static const struct acpi_device_id geni_i2c_acpi_match[] = { + { "QCOM0220"}, + { }, +}; +MODULE_DEVICE_TABLE(acpi, geni_i2c_acpi_match); + static int geni_i2c_probe(struct platform_device *pdev) { struct geni_i2c_dev *gi2c; @@ -502,7 +509,7 @@ static int geni_i2c_probe(struct platform_device *pdev) return PTR_ERR(gi2c->se.base); gi2c->se.clk = devm_clk_get(&pdev->dev, "se"); - if (IS_ERR(gi2c->se.clk)) { + if (IS_ERR(gi2c->se.clk) && !ACPI_HANDLE(&pdev->dev)) { ret = PTR_ERR(gi2c->se.clk); dev_err(&pdev->dev, "Err getting SE Core clk %d\n", ret); return ret; @@ -510,12 +517,19 @@ static int geni_i2c_probe(struct platform_device *pdev) ret = device_property_read_u32(&pdev->dev, "clock-frequency", &gi2c->clk_freq_out); - if (ret) { + if (ret && !ACPI_HANDLE(&pdev->dev)) { dev_info(&pdev->dev, "Bus frequency not specified, default to 100kHz.\n"); gi2c->clk_freq_out = KHZ(100); } + if (ACPI_HANDLE(&pdev->dev)) { + ACPI_COMPANION_SET(&gi2c->adap.dev, ACPI_COMPANION(&pdev->dev)); + + /* Using default, same as the !ACPI case above */ + gi2c->clk_freq_out = KHZ(100); + } + gi2c->irq = platform_get_irq(pdev, 0); if (gi2c->irq < 0) { dev_err(&pdev->dev, "IRQ error for i2c-geni\n"); @@ -660,6 +674,7 @@ static struct platform_driver geni_i2c_driver = { .name = "geni_i2c", .pm = &geni_i2c_pm_ops, .of_match_table = geni_i2c_dt_match, + .acpi_match_table = ACPI_PTR(geni_i2c_acpi_match), }, }; 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");