From patchwork Fri Sep 6 09:38:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1158939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YFD+9Ucb"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46PvBN0mz8z9sNk; Fri, 6 Sep 2019 20:36:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i6Bbo-0007Ke-Rr; Fri, 06 Sep 2019 10:36:52 +0000 Received: from mail-wm1-f66.google.com ([209.85.128.66]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i6AhE-0001pi-9z for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2019 09:38:24 +0000 Received: by mail-wm1-f66.google.com with SMTP id q19so5757086wmc.3 for ; Fri, 06 Sep 2019 02:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=+myniLoXFfUf/AIW2RYoXRZjip8aaNKsE63NlbvWJtY=; b=YFD+9UcbPLCEmRJyHxB5KYRLM0kmf+pEQOCTWb4r3+zVyeUL83/sflO7JNb9EsGp2a RdaBfACmQWBOz3qmnlxyvU7ugBE1on757QlWPC6Z5ulTNJpJ2W8pHVH8xYweYmfgAC64 LPzcu/GmxJQPmgJEROv2zxmve592eft0wdsrXVhOInVU50wBWNkfUA4k3psQysksXKfz JjgdIXNtbownJ8k5ipDfC5Wg5uSVFOst8VHbWypCKrRB9JcQMmyT6TpNGqEm/3rlUIqy MT1qSWFwP2yZLJnxcQ0/mbu9b/mCj97uMxLSNZecjC3RNk5Yu1+Nh457A+OR8TG7gF6+ p5vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+myniLoXFfUf/AIW2RYoXRZjip8aaNKsE63NlbvWJtY=; b=NASxyIsxnZ55Z5t7R1DyUirxdGuagTKBPlN0APDFnWNiPS/gHEgm4pIOOZ0ZpNXXzw 4jR2BRHgJg0l+SMIJWIsT/8Pnx7OMy2Ll4nJzSd8R+krC71cVgyVSbZ+ScLA8037HpzS Iyw7zmSOyd28JJsbUlpr027IFWhSC9v3oLnrmN65pdi35fpUZAcKnKU3BRor65GPaLQP TldjIdwWaI6/y13iK/M6TWo5WpZ0RZmqZ7achMR5DeDEKgT4tG+B2S/xRMlsa8G8acni Ww4DbrHXVpEAF6T/X3UVs4nyc3oLiPJ5hJDwht4MejLYqNWWN76bx23cD7YSvNwwwE3a HR2g== X-Gm-Message-State: APjAAAXDfo5Xi569Us/cDKx4w8nno1OhuKN3jP/Y1vLHZz9IRJyGpO6N qa4y2SojRQ9xnpPwHHnoVFrgG284jkY= X-Google-Smtp-Source: APXvYqyF7TlUJFjGWlMg8V3tGcJmcwg0wmIVGU0TBZ7DcydjaC6J0MfTL2wKNM5wf0DuVp0IXBPjZw== X-Received: by 2002:a1c:7c15:: with SMTP id x21mr7052791wmc.154.1567762703935; Fri, 06 Sep 2019 02:38:23 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id z25sm3552276wmk.0.2019.09.06.02.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 02:38:23 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 1/3] soc: qcom: geni: Provide parameter error checking Date: Fri, 6 Sep 2019 10:38:15 +0100 Message-Id: <20190906093817.2897-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906093817.2897-1-lee.jones@linaro.org> References: <20190906093817.2897-1-lee.jones@linaro.org> X-Mailman-Approved-At: Fri, 06 Sep 2019 10:36:52 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" When booting with ACPI, the Geni Serial Engine is not set as the I2C/SPI parent and thus, the wrapper (parent device) is unassigned. This causes the kernel to crash with a null dereference error. Fixes: 8bc529b25354 ("soc: qcom: geni: Add support for ACPI") Acked-by: Bjorn Andersson Reviewed-by: Stephen Boyd Signed-off-by: Lee Jones --- NB: This patch should make it into v5.3-rc8 drivers/soc/qcom/qcom-geni-se.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index d5cf953b4337..7d622ea1274e 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -630,6 +630,9 @@ int geni_se_tx_dma_prep(struct geni_se *se, void *buf, size_t len, struct geni_wrapper *wrapper = se->wrapper; u32 val; + if (!wrapper) + return -EINVAL; + *iova = dma_map_single(wrapper->dev, buf, len, DMA_TO_DEVICE); if (dma_mapping_error(wrapper->dev, *iova)) return -EIO; @@ -663,6 +666,9 @@ int geni_se_rx_dma_prep(struct geni_se *se, void *buf, size_t len, struct geni_wrapper *wrapper = se->wrapper; u32 val; + if (!wrapper) + return -EINVAL; + *iova = dma_map_single(wrapper->dev, buf, len, DMA_FROM_DEVICE); if (dma_mapping_error(wrapper->dev, *iova)) return -EIO; From patchwork Fri Sep 6 09:38:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1158941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xYy/pmif"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46PvBP3p3dz9sNT; Fri, 6 Sep 2019 20:37:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i6Bbs-0007Lu-9Z; Fri, 06 Sep 2019 10:36:56 +0000 Received: from mail-wm1-f41.google.com ([209.85.128.41]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i6AhF-0001po-58 for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2019 09:38:25 +0000 Received: by mail-wm1-f41.google.com with SMTP id r195so6300793wme.2 for ; Fri, 06 Sep 2019 02:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; b=xYy/pmifYSZVEkg4V/TPtqTRTUMq+XSiUL6yJZRo0p3HHFL04EBSbv2YAW2NsiNz7N xAiYwTA1eWd0r98zCUCYMjW5ehFbY3Lo30kqR/iqCusQWtSI4cXo5Edh7CKH3095t2xg 86PskpwO6ryDEOajP/rZfEh8ZQM2qYwLFrbrVuTRrxywmYGEzmg5rWMfK2QbM/FPB4Lr imThon4hYgEsoj6ApDBn0aEufWSWvRhskxZER5dEXPnUmv5O7+Ep5JQiASHImOPeu+Hc sUNkLz/wuF54iX/BW0n4c5LJGGhDlJ9Ex2azAq/Nif7+odkoMaEP8ceerBQ4XuQoYE9v SYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; b=sYwBr7RdapKBxjr6T8qOhm1QkvF8v6ygY7Fb5aiEwt/CLsWJ9/3MlYKJGe5Eb80EWJ mWxwFNkEK092k6txGHQGuKq8OiEnE6gy5/XCe6NwCAh2UDydlvypyVcpzG+2K+ZzV4IO kCbV8G4RP6cPGMb7xUBsC4aM203RW529b3d4uFe8G3uQIz1hfzHREXZkcSfQtaANAWxB GwkRhtnR2S466bDqBcWtvwj+COfpHal4xPIFbTWVUIOc0pPlKbaK1NgLorOfKC5bOt6q 7sAO8t6JbWIqdraFqAImu/khs83I/M1Bqq2mD2IJ70LS8R0Bjj3Sn6gQ1+ENPQh0Gusd 0vDQ== X-Gm-Message-State: APjAAAWt9cPMnqJMQIe3W5O+KTUY0OMgND2S416JP6qj2v7BIy89LSwZ PiNINa11Ua5Oj1rnUlZroWxL0g== X-Google-Smtp-Source: APXvYqwB7LHJwMXTu5qIe8EDGwaY+9w62LJ6WClLUah67w8v9N/6gdXPawQrlrDaKXOoizh23jwNpg== X-Received: by 2002:a1c:658a:: with SMTP id z132mr6717606wmb.98.1567762704783; Fri, 06 Sep 2019 02:38:24 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id z25sm3552276wmk.0.2019.09.06.02.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 02:38:24 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 2/3] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630 Date: Fri, 6 Sep 2019 10:38:16 +0100 Message-Id: <20190906093817.2897-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906093817.2897-1-lee.jones@linaro.org> References: <20190906093817.2897-1-lee.jones@linaro.org> X-Mailman-Approved-At: Fri, 06 Sep 2019 10:36:52 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" We have a production-level laptop (Lenovo Yoga C630) which is exhibiting a rather horrific bug. When I2C HID devices are being scanned for at boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. When it does, the laptop reboots and the user never sees the OS. Attempts are being made to debug the reason for the spontaneous reboot. No luck so far, hence the requirement for this hot-fix. This workaround will be removed once we have a viable fix. Signed-off-by: Lee Jones --- drivers/i2c/busses/i2c-qcom-geni.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index a89bfce5388e..17abf60c94ae 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, { dma_addr_t rx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_machine_is_compatible("lenovo,yoga-c630")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else @@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, { dma_addr_t tx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_machine_is_compatible("lenovo,yoga-c630")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else From patchwork Fri Sep 6 09:38:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1158942 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XRSEq/OH"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46PvBP38m2z9sDB; Fri, 6 Sep 2019 20:37:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i6Bbs-0007MD-Et; Fri, 06 Sep 2019 10:36:56 +0000 Received: from mail-wm1-f67.google.com ([209.85.128.67]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i6AhG-0001px-Ec for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2019 09:38:26 +0000 Received: by mail-wm1-f67.google.com with SMTP id r17so6982939wme.0 for ; Fri, 06 Sep 2019 02:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=g7s5voyz2eS3FxHJEO8Pct6dn2kEJWlJVb3QEW+c5EI=; b=XRSEq/OHtTVC/q8q+DI9eJNL5FFZ1iLmWR4Nu3jmDxs38IaubXrDWKPKx50fvqul/O kfEb1GCsgk6N78NYrWBIjfpVqJaq6woIks5eEz+wTOKyyxGqwv/04N7uHPtE2RJ2v/lL ASujG4OU3AEm2XRh5LC0woD+wnZlXf/P8ou5NQgB5fykClV2Pp8roWUgStiZlJ9tTUKu KLKwMmaD6OSH9RJNRV9rYN9R9+PLJzzV9tI03U8wsBpETqD2xJfWpVmgPa8nPXIUj25d l8N3MEGhfmhsv0Tw9M1FWKY9AqXNTTbE9f5xXuhUVJB+IHT/Za9JpQSaZQrwhkSH4GRn 4Veg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=g7s5voyz2eS3FxHJEO8Pct6dn2kEJWlJVb3QEW+c5EI=; b=otNAD4qdqadiikOYHZEn3KU7gBLUKm5MCD+nF4KPsjLG2n8lT4fqYcuuE1waSot7De abm0oUMmfKNW0reQ/n2Wm1wIG6gDtO6nHuegEYo7sFdmyk3k07IptO+C05w+oJ2kZcRV qWjwqdAJrykkVAbQTRqeuE7lMvBUogGDkNAnLpdF6DP0GHPYnebYfrMjn1O0gtHqTOHr 1rnYaSr9bESjHnNyt2c0R62jKlpYoOZdX07b+QGqleB5fjYMbLQSlah67iNS6fw7JNEl 7Wco1/f5Wcr0iIAHtB2dqZuHHvyP0omI9cUzuhSQzv1dHLjUQPqV7N72grug9O5csVrt 0OTw== X-Gm-Message-State: APjAAAX5RGXEzJvj9wNvGbzqow7AJHVfhXQTQiLGWFcVrJBud+VIwLpz wARDf/rGkq2XNRxnjYskPxk3DQ== X-Google-Smtp-Source: APXvYqy7oXLMELFoaLq2wYjKxblPaGZhvOmmSi0vZx1g2lpx5LOgsp9w9EXU75rtzWpz9DOrcVTzEA== X-Received: by 2002:a1c:2d11:: with SMTP id t17mr6654568wmt.147.1567762705999; Fri, 06 Sep 2019 02:38:25 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id z25sm3552276wmk.0.2019.09.06.02.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 02:38:25 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 3/3] arm64: dts: qcom: Add Lenovo Yoga C630 Date: Fri, 6 Sep 2019 10:38:17 +0100 Message-Id: <20190906093817.2897-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906093817.2897-1-lee.jones@linaro.org> References: <20190906093817.2897-1-lee.jones@linaro.org> X-Mailman-Approved-At: Fri, 06 Sep 2019 10:36:52 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bjorn Andersson The Lenovo Yoga C630 is built on the SDM850 from Qualcomm, but this seem to be similar enough to the SDM845 that we can reuse the sdm845.dtsi. Supported by this patch is: keyboard, battery monitoring, UFS storage, USB host and Bluetooth. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Acked-by: Sudeep Holla Signed-off-by: Lee Jones --- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 446 ++++++++++++++++++ 2 files changed, 447 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 0a7e5dfce6f7..670c6c65f9e9 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -12,5 +12,6 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r2.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb +dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts new file mode 100644 index 000000000000..ded120d3aef5 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts @@ -0,0 +1,446 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Lenovo Yoga C630 + * + * Copyright (c) 2019, Linaro Ltd. + */ + +/dts-v1/; + +#include +#include "sdm845.dtsi" +#include "pm8998.dtsi" + +/ { + model = "Lenovo Yoga C630"; + compatible = "lenovo,yoga-c630", "qcom,sdm845"; + + aliases { + hsuart0 = &uart6; + }; +}; + +&apps_rsc { + pm8998-rpmh-regulators { + compatible = "qcom,pm8998-rpmh-regulators"; + qcom,pmic-id = "a"; + + vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>; + vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>; + + vreg_s2a_1p125: smps2 { + }; + + vreg_s3a_1p35: smps3 { + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + regulator-initial-mode = ; + }; + + vreg_s4a_1p8: smps4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vreg_s5a_2p04: smps5 { + regulator-min-microvolt = <2040000>; + regulator-max-microvolt = <2040000>; + regulator-initial-mode = ; + }; + + vreg_s7a_1p025: smps7 { + }; + + vdd_qusb_hs0: + vdda_hp_pcie_core: + vdda_mipi_csi0_0p9: + vdda_mipi_csi1_0p9: + vdda_mipi_csi2_0p9: + vdda_mipi_dsi0_pll: + vdda_mipi_dsi1_pll: + vdda_qlink_lv: + vdda_qlink_lv_ck: + vdda_qrefs_0p875: + vdda_pcie_core: + vdda_pll_cc_ebi01: + vdda_pll_cc_ebi23: + vdda_sp_sensor: + vdda_ufs1_core: + vdda_ufs2_core: + vdda_usb1_ss_core: + vdda_usb2_ss_core: + vreg_l1a_0p875: ldo1 { + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = ; + }; + + vddpx_10: + vreg_l2a_1p2: ldo2 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = ; + regulator-always-on; + }; + + vreg_l3a_1p0: ldo3 { + }; + + vdd_wcss_cx: + vdd_wcss_mx: + vdda_wcss_pll: + vreg_l5a_0p8: ldo5 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-initial-mode = ; + }; + + vddpx_13: + vreg_l6a_1p8: ldo6 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vreg_l7a_1p8: ldo7 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vreg_l8a_1p2: ldo8 { + }; + + vreg_l9a_1p8: ldo9 { + }; + + vreg_l10a_1p8: ldo10 { + }; + + vreg_l11a_1p0: ldo11 { + }; + + vdd_qfprom: + vdd_qfprom_sp: + vdda_apc1_cs_1p8: + vdda_gfx_cs_1p8: + vdda_qrefs_1p8: + vdda_qusb_hs0_1p8: + vddpx_11: + vreg_l12a_1p8: ldo12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vddpx_2: + vreg_l13a_2p95: ldo13 { + }; + + vreg_l14a_1p88: ldo14 { + regulator-min-microvolt = <1880000>; + regulator-max-microvolt = <1880000>; + regulator-initial-mode = ; + regulator-always-on; + }; + + vreg_l15a_1p8: ldo15 { + }; + + vreg_l16a_2p7: ldo16 { + }; + + vreg_l17a_1p3: ldo17 { + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = ; + }; + + vreg_l18a_2p7: ldo18 { + }; + + vreg_l19a_3p0: ldo19 { + regulator-min-microvolt = <3100000>; + regulator-max-microvolt = <3108000>; + regulator-initial-mode = ; + }; + + vreg_l20a_2p95: ldo20 { + regulator-min-microvolt = <2960000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = ; + }; + + vreg_l21a_2p95: ldo21 { + }; + + vreg_l22a_2p85: ldo22 { + }; + + vreg_l23a_3p3: ldo23 { + }; + + vdda_qusb_hs0_3p1: + vreg_l24a_3p075: ldo24 { + regulator-min-microvolt = <3075000>; + regulator-max-microvolt = <3083000>; + regulator-initial-mode = ; + }; + + vreg_l25a_3p3: ldo25 { + regulator-min-microvolt = <3104000>; + regulator-max-microvolt = <3112000>; + regulator-initial-mode = ; + }; + + vdda_hp_pcie_1p2: + vdda_hv_ebi0: + vdda_hv_ebi1: + vdda_hv_ebi2: + vdda_hv_ebi3: + vdda_mipi_csi_1p25: + vdda_mipi_dsi0_1p2: + vdda_mipi_dsi1_1p2: + vdda_pcie_1p2: + vdda_ufs1_1p2: + vdda_ufs2_1p2: + vdda_usb1_ss_1p2: + vdda_usb2_ss_1p2: + vreg_l26a_1p2: ldo26 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1208000>; + regulator-initial-mode = ; + }; + + vreg_l28a_3p0: ldo28 { + }; + + vreg_lvs1a_1p8: lvs1 { + }; + + vreg_lvs2a_1p8: lvs2 { + }; + }; +}; + +&apps_smmu { + /* TODO: Figure out how to survive booting with this enabled */ + status = "disabled"; +}; + +&gcc { + protected-clocks = , + , + ; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c3 { + status = "okay"; + clock-frequency = <400000>; + + hid@15 { + compatible = "hid-over-i2c"; + reg = <0x15>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; + }; + + hid@2c { + compatible = "hid-over-i2c"; + reg = <0x2c>; + hid-descr-addr = <0x20>; + + interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_hid_active>; + }; +}; + +&i2c5 { + status = "okay"; + clock-frequency = <400000>; + + hid@10 { + compatible = "hid-over-i2c"; + reg = <0x10>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c6_hid_active>; + }; +}; + +&i2c11 { + status = "okay"; + clock-frequency = <400000>; + + hid@5c { + compatible = "hid-over-i2c"; + reg = <0x5c>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c12_hid_active>; + }; +}; + +&qup_i2c12_default { + drive-strength = <2>; + bias-disable; +}; + +&qup_uart6_default { + pinmux { + pins = "gpio45", "gpio46", "gpio47", "gpio48"; + function = "qup6"; + }; + + cts { + pins = "gpio45"; + bias-pull-down; + }; + + rts-tx { + pins = "gpio46", "gpio47"; + drive-strength = <2>; + bias-disable; + }; + + rx { + pins = "gpio48"; + bias-pull-up; + }; +}; + +&qupv3_id_0 { + status = "okay"; +}; + +&qupv3_id_1 { + status = "okay"; +}; + +&tlmm { + gpio-reserved-ranges = <0 4>, <81 4>; + + i2c2_hid_active: i2c2-hid-active { + pins = <37>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; + + i2c6_hid_active: i2c6-hid-active { + pins = <125>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; + + i2c12_hid_active: i2c12-hid-active { + pins = <92>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; +}; + +&uart6 { + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3990-bt"; + + vddio-supply = <&vreg_s4a_1p8>; + vddxo-supply = <&vreg_l7a_1p8>; + vddrf-supply = <&vreg_l17a_1p3>; + vddch0-supply = <&vreg_l25a_3p3>; + max-speed = <3200000>; + }; +}; + +&ufs_mem_hc { + status = "okay"; + + vcc-supply = <&vreg_l20a_2p95>; + vcc-max-microamp = <600000>; +}; + +&ufs_mem_phy { + status = "okay"; + + vdda-phy-supply = <&vdda_ufs1_core>; + vdda-pll-supply = <&vdda_ufs1_1p2>; +}; + +&usb_1 { + status = "okay"; +}; + +&usb_1_dwc3 { + dr_mode = "host"; +}; + +&usb_1_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb1_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = ; + qcom,preemphasis-level = ; + qcom,preemphasis-width = ; +}; + +&usb_1_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb1_ss_1p2>; + vdda-pll-supply = <&vdda_usb1_ss_core>; +}; + +&usb_2 { + status = "okay"; +}; + +&usb_2_dwc3 { + dr_mode = "host"; +}; + +&usb_2_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb2_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = ; +}; + +&usb_2_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb2_ss_1p2>; + vdda-pll-supply = <&vdda_usb2_ss_core>; +};