From patchwork Thu Dec 14 13:26:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 121939 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6810261qgn; Thu, 14 Dec 2017 05:32:42 -0800 (PST) X-Google-Smtp-Source: ACJfBotIZqyjU9oNBBr8E2Zb8ylsYMaXHrej7RZspSKmypCmNQMokYKwou0Tto1C0FXeVGLjgBN6 X-Received: by 10.80.224.198 with SMTP id j6mr12368365edl.0.1513258362618; Thu, 14 Dec 2017 05:32:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513258362; cv=none; d=google.com; s=arc-20160816; b=i2fvqYqg+dWYuEoMQfcr0/l2EBjCn1OS5ptYAF0uJFdkfZvm+yq7WTM/J5v00EI8uv 4bHvUEqliy5vWJJdwj9U4ZNnQSlZos0/nZg4euOmpThEuxD1lyZTZOEVugJa5dz0EvFX wrkdzP8mAdsy4n4RnPhjwEl8VvUCL+tLOC2S449gR5bZYtA7jZq4Ac5Bv+m3yIcNG7aW oEbVoRhjFwfhu2gq7ZTakQWR2qFe6qI9lUcaSL4Yw5FpgrdH8Ztwt7L6PO+hSzZ97xMl mnR04DyKoYul7cK22sU2MXWz6ddqDouao1VPOGRUoGRgmguFcijdK3imDvqVcXYFvAyB mgCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:arc-authentication-results; bh=ZxkZ2FAVwBVDPPJcWiMDLQ0MCQI2WjJYEl1btkml214=; b=jr9KEMuNrTSl8oLo7wCEihwa3Cw6Ln0olKtdyts3Rt5S5wQWCfZJ46D1U1nv/o90pe UFT2g2aL7qiQht1QKykdUJOrv4EGP0ixV8lyGNd95/XOzR+QBcdlphc6l3DeAe+0RD12 XPhfEtFhWiaDugIhRivpppiwrtgBpDeyd/BdJG9HnTZMRKYgRb1gwU+rjio+ZoE7GVTB VGns+ijY7YwebC/MJs7XeIFL9ou8kbloCRxvDekZPpQ3uAsqT+6qHjTNgQBTC7g7q6mc rzBBWw0FnO6i82Ho7pKBypKd19O9PqH85510OosXXwSn6H0Dqc1oYFdlABgy/Iuh3EMR 9dZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P2B2dJpN; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id w15si1267473edw.148.2017.12.14.05.32.42; Thu, 14 Dec 2017 05:32:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P2B2dJpN; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 3E595C21F25; Thu, 14 Dec 2017 13:29:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5A2D6C21F30; Thu, 14 Dec 2017 13:27:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 25958C21F21; Thu, 14 Dec 2017 13:27:16 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id 7B57BC21EFB for ; Thu, 14 Dec 2017 13:27:12 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id v105so5153693wrc.3 for ; Thu, 14 Dec 2017 05:27:12 -0800 (PST) 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=FShJnCuR1SYBW2FAq7DKgYshsW/A7wqbCW9j59vcagc=; b=P2B2dJpN9+dB8nuw8pUE7GGhAi7r3DMDmoo6SRYXrNY2EZYLCHyH5z4TU02ADbihNu /Tma0rLfMh2XfMLvggNmJPL3yalsMOrnKAjGai98/0fZed+0bJpIXn5SCfrBQ0biqk5M UJbvvrTPVvsi7LLqz9T+DAjbRhj8tKOEPxJs4= 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=FShJnCuR1SYBW2FAq7DKgYshsW/A7wqbCW9j59vcagc=; b=fz1SFLP+4B3PkZrSlW6V+ql61w3vw9tmTu0GFSmVu/A4aI5ubyRgum2AZ1S106EDXO SM+jHcVU/t+0QQqAJp/6uLUKqPdO7WSHutQhy8tD5RED/1lhzQ8OB2MaHZmxmYRWDIz6 pWH8zkBRI0tTU9JD6vkasbuI2jn+ld++KeOYZZ9fqemyDZHp5OTDHGl5n8vy0Qf+U37M SIoY4WFHuEKoe8j/Ds+5p3kLPy3eLkt0FFTcv3QwG8V8B3OUt8NnNI+j+MnwVAPOeBAv LInd9XP+jbHhTJgUbOf733RIuLtOd1lwOYp5y/BK+418873yCUf+QIIIMh7DbelmChcu F7nw== X-Gm-Message-State: AKGB3mIXsWR674Uj6ivgLodoJTE2RCtI4BlzeslI1tudy4rbgnfd5HGS 7LNCX2f82ScPY8gTA37RfmHKx3NJB3E= X-Received: by 10.223.162.204 with SMTP id t12mr6217889wra.258.1513258032069; Thu, 14 Dec 2017 05:27:12 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id l3sm3235378wrg.2.2017.12.14.05.27.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 05:27:11 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Thu, 14 Dec 2017 14:26:57 +0100 Message-Id: <1513258020-23589-6-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513258020-23589-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1513258020-23589-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Subject: [U-Boot] [PATCH v2 5/8] db820c: enable pmic gpios for pm8994 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Jorge Ramirez-Ortiz --- arch/arm/dts/dragonboard820c.dts | 43 +++++++++++++++++++++++++++++++++++++++ configs/dragonboard820c_defconfig | 7 +++++++ drivers/gpio/pm8916_gpio.c | 7 +++++-- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/dragonboard820c.dts b/arch/arm/dts/dragonboard820c.dts index bad5a1e..3086d60 100644 --- a/arch/arm/dts/dragonboard820c.dts +++ b/arch/arm/dts/dragonboard820c.dts @@ -61,5 +61,48 @@ clock = <&gcc 0>; clock-frequency = <200000000>; }; + + spmi@400f000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0x400f800 0x200>, + <0x4400000 0x400000>, + <0x4c00000 0x400000>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + pmic0: pm8994@0 { + compatible = "qcom,spmi-pmic"; + reg = <0x0 0x1>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + pm8994_pon: pm8994_pon@800 { + compatible = "qcom,pm8994-pwrkey"; + reg = <0x800 0x96>; + #gpio-cells = <2>; + gpio-controller; + gpio-bank-name="pm8994_key."; + }; + + pm8994_gpios: pm8994_gpios@c000 { + compatible = "qcom,pm8994-gpio"; + reg = <0xc000 0x400>; + gpio-controller; + gpio-count = <24>; + #gpio-cells = <2>; + gpio-bank-name="pm8994."; + }; + }; + + pmic1: pm8994@1 { + compatible = "qcom,spmi-pmic"; + reg = <0x1 0x1>; + #address-cells = <0x1>; + #size-cells = <0x1>; + }; + }; }; + }; + +#include "dragonboard820c-uboot.dtsi" diff --git a/configs/dragonboard820c_defconfig b/configs/dragonboard820c_defconfig index 788ff28..5e25e2e 100644 --- a/configs/dragonboard820c_defconfig +++ b/configs/dragonboard820c_defconfig @@ -23,11 +23,18 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_EXT4=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_PMIC=y CONFIG_OF_CONTROL=y CONFIG_MSM_SERIAL=y +CONFIG_SPMI_MSM=y CONFIG_MMC_SDHCI_MSM=y CONFIG_MMC_SDHCI=y CONFIG_DM_MMC=y +CONFIG_DM_GPIO=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_PM8916=y +CONFIG_PM8916_GPIO=y CONFIG_CLK=y CONFIG_PSCI_RESET=y CONFIG_ENV_IS_IN_EXT4=y diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/pm8916_gpio.c index 9ec2a24..056b982 100644 --- a/drivers/gpio/pm8916_gpio.c +++ b/drivers/gpio/pm8916_gpio.c @@ -29,7 +29,7 @@ DECLARE_GLOBAL_DATA_PTR; #define REG_STATUS_VAL_MASK 0x1 /* MODE_CTL */ -#define REG_CTL 0x40 +#define REG_CTL 0x40 #define REG_CTL_MODE_MASK 0x70 #define REG_CTL_MODE_INPUT 0x00 #define REG_CTL_MODE_INOUT 0x20 @@ -183,7 +183,7 @@ static int pm8916_gpio_probe(struct udevice *dev) return -ENODEV; reg = pmic_reg_read(dev->parent, priv->pid + REG_SUBTYPE); - if (reg != 0x5) + if (reg != 0x5 && reg != 0x1) return -ENODEV; return 0; @@ -203,6 +203,7 @@ static int pm8916_gpio_ofdata_to_platdata(struct udevice *dev) static const struct udevice_id pm8916_gpio_ids[] = { { .compatible = "qcom,pm8916-gpio" }, + { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ { } }; @@ -278,6 +279,7 @@ static int pm8941_pwrkey_ofdata_to_platdata(struct udevice *dev) struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); uc_priv->gpio_count = 2; + uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name"); if (uc_priv->bank_name == NULL) uc_priv->bank_name = "pm8916_key"; @@ -286,6 +288,7 @@ static int pm8941_pwrkey_ofdata_to_platdata(struct udevice *dev) static const struct udevice_id pm8941_pwrkey_ids[] = { { .compatible = "qcom,pm8916-pwrkey" }, + { .compatible = "qcom,pm8994-pwrkey" }, { } };