From patchwork Thu Dec 14 11:53:58 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: 121914 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6705550qgn; Thu, 14 Dec 2017 04:00:53 -0800 (PST) X-Google-Smtp-Source: ACJfBotNNkyqe9h3YCyLyEynm4S6Iht0f7jcUiTSvB4Csilk/y8dw1yFkI+14fPuHrnpQhK9khxF X-Received: by 10.80.206.26 with SMTP id y26mr12557435edi.117.1513252853497; Thu, 14 Dec 2017 04:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513252853; cv=none; d=google.com; s=arc-20160816; b=mMop3aH1bMDGhyLKKOyfDaIGSPFtMHUBWngefZn15BW3nh2ukKXr+jSlM0wj5WRcpY kFvj30OzJE5gPLsGCyJ8qcBZamBPRncKqRBGuAj8eehQiNeXrPiuxYRwA+AfXKsaYVqz bB6qUViWiEmzitS2Vuks6H39GTQ30DZXwUgIPs/Zd8bdO17/ITWaFnyX82huVbEsUWX+ 7Bft3QU0lG4CaFQF1VK/AEcl5Ogpi6+jJR/4KtvnQcweY5dSuHOeOaY2ymTwjn6gK5Aj MmCJmna2WAaAO55klMGcHOg3yDXJukBTfgykgnpLAs+FFBpQMAFrNTjJRfxAC3smMbCd jH0A== 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=HtrFi75aitL9NyVmL9rIItvru+wQ6LYWjuDbRGB1O2mHuidbukZngoIEiumFYqmD0J 6j3LCcL+mTuShWqMCYq96L3fizrt+z4wk+ZgPEybuoWeEhbzWKoVTR2st9lc84TtBTLS UvkFeJ8p3iuOBNagJH6AXSvq84VeztGJM4+QtrwMli2sM9mItPJHDxa+sbbNfcBwti1F A9kJIq1JgbYOlA2YygKnLnbS1qe5ytlzFq+1c6mMaCRijltL5EuBChD4G/X/7qsdeCYD SoNwDgF0yvqa2k7K+9AvcOCKLJgtjQykl+GlvbL50fby3bK40GsY7evRPWaDIGcM55Z8 euEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=E/jERkya; 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 i59si2418881edd.106.2017.12.14.04.00.53; Thu, 14 Dec 2017 04:00:53 -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=E/jERkya; 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 02CECC21DD9; Thu, 14 Dec 2017 12:00:37 +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 C11DEC21E93; Thu, 14 Dec 2017 11:54:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 11640C21F0A; Thu, 14 Dec 2017 11:54:19 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 4E8B5C21E68 for ; Thu, 14 Dec 2017 11:54:15 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id y21so4928804wrc.1 for ; Thu, 14 Dec 2017 03:54:15 -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=E/jERkyakqfnt44H66GfYqOF3Y5eM7S4EU28tVtIGWbMp/Md875I6YvS8wNboYYYUg kF61e2v2ZBqRxXh0kjPE5GIHQ9cqGFG4QX8O2l4yU3TLO3mI7epnDY67pDEfp2FxsR6n dhl0pbnlwao6QuabrOa8yIPf45ICSc6LCQO/o= 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=smpXjpYVFaw1VIgXA56fO5rWxk4RTQ+z6iHQP9yUA8ipexqUzNK6WXOsgmcizk54Jr CaZ1H1Yt+waYZJ4oteT92+eKHjifAHvVvrpLsP6RxthE5SUkAVbDCkdDfha+2NwnauH1 UPwZDBiBTXoSsVyFY/3FSUQC5l/txUXRW8x6ElaRbAkRIWJUZOfr123N22COcydNjRpG 5ggR+3jJ2Ns8/dXr8BuE32iKweOWBKLIsp5khMhYt5oS+nr0yE/QcQoa/lntu1YuiNR/ 768TIViY10aNEQW00HpTMaACfCWadyfyApudxNPaIKWUfnKAUAIc+XNWXNQtjwvkJnLX 5Gig== X-Gm-Message-State: AKGB3mKuaAd83qf0R48Up3wCTM0FiRV5PxN78/KWEh6INeNrSLmNoXq+ RVX+y5TMkA5Z/j3VavLSpvxiQQ== X-Received: by 10.223.196.189 with SMTP id m58mr5471254wrf.7.1513252454687; Thu, 14 Dec 2017 03:54:14 -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 e197sm11797509wmf.42.2017.12.14.03.54.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 03:54:12 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Thu, 14 Dec 2017 12:53:58 +0100 Message-Id: <1513252441-29520-5-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513252441-29520-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1513252441-29520-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Subject: [U-Boot] [PATCH 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" }, { } };