From patchwork Wed Jan 10 10:33:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124038 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1488568edr; Wed, 10 Jan 2018 02:37:10 -0800 (PST) X-Google-Smtp-Source: ACJfBovXJ8QUYwAn0BW1PAerxIAFieTOQJnnmA8JA/zQrNnPiKNO8nwq4nxVHb4Ofyj0z0WDjv61 X-Received: by 10.80.207.67 with SMTP id d3mr25295082edk.119.1515580630075; Wed, 10 Jan 2018 02:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515580630; cv=none; d=google.com; s=arc-20160816; b=psbjQVdg7YL5BzGi2X1tP5VTr92juGE1r38dob7oQqcbaVyDcFZe4ZVwb3yrcN7n7w 9wRyDDARQ6rkFynBK71RsiWCtWkJ5rUkjUCCKG+0FJ1ZpsPMcWELRwYDH4jk6qEDRi5V Wg8U6TrXicZLKW5BfeQ8Cvzk/7mw7dvpam04KQ+jbRnhl5QL9plU78bcPumyvimunRB1 hd77goxiNGkN82fqFUrxVpdKUYBsDYN7e6ImkqkyHjyAzbosFtDl/fyLLICYpWZcdF8y lUTDSWGI10/QGEeaoDM9NNP/cv9hoH//+oMmI6jNuA/Ysn2sDycJTuIIgwBjv7LUp/ry OVVA== 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=tVMlIjtA+LrlSDckfZoH9wifu2aCDnMqB3qxoEe5Y9Q=; b=bT0odlDCZdkFHngOSA3hid9hKVWercbwT5v1hZM0Y7oRIfiDNG/9er/TsI275i/AjC X2Pp57KHf6T7ebm+iMfD3px1vbdTXpTvaOOV/6mwrgdGLOssEUyZpXymRywJ4EHAakEJ HNp1/4ioPUd2ByM0V+uAN5uI/0w2nY9XakBPJZBa7aw+DCKo1z1xpQ7Oosfcf0IHHnos Bign8NDNIRg/cqtRYwcJYpseou3Yc5El3RUvgdpepGqEZ5OumbCigSZI9UCkcojhNzR1 j3f1I0ksg7UyFihEB9966Mc2c7fw4g6I7Mw7eEkncru3usy4IvLGEHHbsi2CQdTdGGSB Cc0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=uyIX70Kg; 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=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n21si4508530eda.481.2018.01.10.02.37.09; Wed, 10 Jan 2018 02:37:10 -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=@gmail.com header.s=20161025 header.b=uyIX70Kg; 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=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 9662DC22184; Wed, 10 Jan 2018 10:35:30 +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=FREEMAIL_FROM, 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 48B69C21DB2; Wed, 10 Jan 2018 10:35:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 64B22C21DB2; Wed, 10 Jan 2018 10:34:08 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by lists.denx.de (Postfix) with ESMTPS id ABB9BC21E08 for ; Wed, 10 Jan 2018 10:34:03 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id 100so914977wrb.7 for ; Wed, 10 Jan 2018 02:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=WY3koBM9D/ZFr1obvalYEPs1CJa/9N70AMz/Q1BTrA8=; b=uyIX70KgMTlmAWOggsQeL25NFffswvLrmiDlsokL7wTGIuj9ddCkcwgkWQMJsderGl spxM6/BOZtB12pYqlLGVzz2kul/gdBC6MvKLjyBvwfYpCpzuOkHCDCrQMIWszNFVxM1N cXTDThWOHFWvh45d1qqQiIvGl5ag8V5kTkD+lfggSb5D0cgNGlO9mkgNkQ9whxL2rGIo FfOkg1CQHdmWKCtOI995wcln1eXoDXhqxSgOIfo8L823r9HBIUJy81tnanUDvVoNBPsG 7hEmACWbOCaOCjm4yZLgD1kMMvdm+umxiImyw0Wrg4+TU3yLEItV1q3f7aaxwj3zuRmd vylw== 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=WY3koBM9D/ZFr1obvalYEPs1CJa/9N70AMz/Q1BTrA8=; b=h9FaJGcXv8wSkkkcZrqMpXWeWl0wjKb0KQmR3WIISgeSTqnyXj6s+34twS6uL2UZYv lXW8hK2oK2DqH7y33zUoT9xtrEtsdu/LUn4cU1uQPiwzyrxjgoOAfbtAo4/L7CVTOL/W BeO9pN4TF45QBanuZtfNmYjMTQT+zv4VrZTHFLRfWsnf43s49H659gKC3eSoUjuhsiiG Oq6wbIi9hBLXFVfucWfMdDvTcA78olo8NcyvnAqgbzDDIkjbazuRVs5hsfiZpCpPxYjs MyObc00t4shrt2g3jMC7KJqFp5sWYZkSsXQy0QaUHPqpkK8ja5yo585MsbktQpwdNkvX c1wQ== X-Gm-Message-State: AKGB3mLFtZdk3DgxiqgtilrS6kEp6Ku4ezne01wJU4msl4V1SXVUVszG M/yAkl7HgpyrdxnEWBHnsuNAgA== X-Received: by 10.223.186.83 with SMTP id t19mr15939494wrg.64.1515580443130; Wed, 10 Jan 2018 02:34:03 -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 z71sm5091969wrc.11.2018.01.10.02.34.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:34:02 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:33:51 +0100 Message-Id: <1515580432-25985-4-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515580432-25985-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515580432-25985-1-git-send-email-jorge.ramirez.ortiz@gmail.com> Subject: [U-Boot] [PATCH v1 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" From: Jorge Ramirez-Ortiz 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" }, { } };