From patchwork Fri Jan 5 10:29:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 123493 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp636955qgn; Fri, 5 Jan 2018 02:35:33 -0800 (PST) X-Google-Smtp-Source: ACJfBovdcven5e2aEkvzKGPg9Tw7w1DkQPpdeZBP0Fb4rPXteaQ0uldHauyR5hQ9C7xu1ytrGcJH X-Received: by 10.80.135.186 with SMTP id a55mr3527031eda.54.1515148533244; Fri, 05 Jan 2018 02:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515148533; cv=none; d=google.com; s=arc-20160816; b=agcJggQtgTJihczPbDLZryhQpNv7TZB64RDyNRoqSNuys/1QdwaLmYch9mPzTVKyHj 4pMeQ1jJ86nnDCUCNxwKq0a3kASPqvH7buIcS6hOnuPu9V2KvEFn93wKdRBMAjZwLWgo lWBaoU6nmp4/FHeG8roNk1dxSjksqbFh4q72Fx0ujNjEyHRGNA3mTIxc3WCTccFtdi+z 540faxzuIIh1j7GJAt1bycvbKMaNI6NwIzHVzxoCjCnazjMAfBK+OaVwBLpPsvhrA/jM 2IStZW01eIFJ8zczlc5zjn9MFaiZpK42MIG1AVGLsXnLnXL/hg/lMlNNNFyFU4wTyDf6 AAiQ== 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=Sw7nfE0GzkYAy69+QPYZW9c4T2Uhq7sPFOeVCEBEdJY=; b=jEt13O/mkzyW1DJZSJc3u+Gz4CS33plgrrjkoQk46a3scDueSW4QfAiEhjtibFc9jv FlpMaUBHq+v/dRxsQ9S1JSrFDlJqLw5f02mkLksxhk4ZKvA73iLOk3iNNItyAGpFz1pT 9wQQIDlTotPiztkD96cRYisP91HFesvN8cvBdTZWeFbNYinnfJEAxLabB8rr7MaZ0UNl rCcus01UqgtO8/e/Plr6VYeLw4EHNoqM8LVzoaCql9GmvfDCEUQCUDxLbF8VLsLI3y96 xuBTqFgXTHKqWq1I8YtEmFXcZhg+tM/PG2Zpf1r8GM93dDwPu92ECGzVmQlepo6dRrEM AqEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XDf4CIU4; 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 w7si358090edi.295.2018.01.05.02.35.33; Fri, 05 Jan 2018 02:35:33 -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=XDf4CIU4; 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 D54A4C21E66; Fri, 5 Jan 2018 10:33:57 +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_H3, RCVD_IN_MSPIKE_WL, 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 E404BC21DA6; Fri, 5 Jan 2018 10:29:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F1B04C21E13; Fri, 5 Jan 2018 10:29:40 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id A81DAC21E3A for ; Fri, 5 Jan 2018 10:29:23 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id y82so5706311wmg.1 for ; Fri, 05 Jan 2018 02:29:23 -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=XDf4CIU4iSaDmT1DTfkoE0shEh+ajxBine0R4hbzAZ61DmzZHT4+rZuernhtSnIR0F nHx7U+Jth3YOrPOpRmEdUbrgZ+bSiF0k9MKzhWkCm2BjNJyAxUOq2tgk29qs1gs7aDbZ GLhT/RSqWCabqoUJ+Wh4oi1u8t4fp5P9sru/g= 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=Rj+lzZ913JfW29qWLO7dPKLhqCPspMpdDvVWtkUfrb/EeElQCMpBbfEef9Iscs4CRe OUmtVhvgEt9pyrxbku/REF0Wpc+mdF2XAwzmRWU1nmP5h0+qFkTnn9Pmhc7IqbO7FbNM nQm5qqeh/3fWXV543FpDOAQF794qREU2uyLYVdG2PSNlANmzsmw5AE7IjD6ooCTHGFuU ZyhSpb4htqqeyiaO8y8roX66fBn9T55KXPMbRzw7bdlPDMQezdBXf4X4tIsvOEJW7e8l S9Dv0uL5clX9Oarur6XOBuEuwUrVISACK497WoqvIcjmdPYMn+gNbTmgoUgtXZXAj6iY Oe7A== X-Gm-Message-State: AKGB3mIXY34/hxJFoE1stvYMcMHzD+XGnVjzIhHKwkX747aIkQdAQRM6 2ifelhn+UFc0GK7R8eY9wxKhWQ== X-Received: by 10.28.134.67 with SMTP id i64mr2164635wmd.57.1515148163258; Fri, 05 Jan 2018 02:29:23 -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 n33sm10367629wrn.76.2018.01.05.02.29.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jan 2018 02:29:22 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Fri, 5 Jan 2018 11:29:13 +0100 Message-Id: <1515148154-30138-4-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515148154-30138-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1515148154-30138-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Subject: [U-Boot] [PATCH 04/05] 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" }, { } };