From patchwork Tue Jan 9 09:12:02 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: 123930 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3976614qgn; Tue, 9 Jan 2018 04:44:59 -0800 (PST) X-Google-Smtp-Source: ACJfBosSOF1/tVBVYZHYUKAUnimqKnSChugXHJiUBEqZ8wYJUSSMCCS3+bEbhgwn/gMIR4fEauKv X-Received: by 10.80.148.82 with SMTP id q18mr21048380eda.33.1515501899412; Tue, 09 Jan 2018 04:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501899; cv=none; d=google.com; s=arc-20160816; b=qc+//ew+OosAHQ+8D4/ERMzf97w8fAf4jJ04emgv3y8P19iCsHfDwpxH12uqgNAY5T XyhwLQ2JmDuWkRP/JuSHfwN1RTarQO3uzmMSYSwMqhShXyj/6IIcEjmUDma5SIdc/DkH Njplc0/+UvYnhMRQDdkzXw0bo8GxS8wmydRJdy2NIME2ah21dy+gyN94Hn0d1fQaU9rA 1Xcl5VZ3wTijwfxUKuZSWabORAOP8WGjhwcEdsjkiVJ0U8jpLPfnYy8B1ehhb+BExi8W hg+ULVCg01uK6tlmE///g9KKhXd+EskYtUvbVCRmDaQFEfxdhwO1q/6ylKQpRHHyiZoo bX6Q== 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=nYZKp0q5zRNUpJzLXJsoMyjbJxXGz67hV60xy1IIvHlHvaVcrGBvYj65/0nnc5cYd/ QVB3yD6IpgUpwgrfS0HduUsmjg3OPYFmVx8MAJatbzhs973InM8BF9vGsvyAEVtNLBrX vLY2nP3ost7jDXcDRlpbKmvmYjRuSmAWDlig03XGtnUKUXHQNnfnWGzgF3Ks+iag9VCa SxiQobdahkJh2Y81dsUY68VpA+xopc53+zvoZIKmEV2LExUIuLtGy3cDjed7fR363r/y y6mepjylfeuGBQNd6z7Xw4YKsyc97g2hG9mG9zoNFMrHA2qV+OFXHR+rT9rr8pl9zcIb 7HRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=jPn2W3A7; 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 p43si1159414eda.70.2018.01.09.04.44.59; Tue, 09 Jan 2018 04:44:59 -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=jPn2W3A7; 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 0C755C22019; Tue, 9 Jan 2018 12:37:09 +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 9CEC4C21FDD; Tue, 9 Jan 2018 12:34:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C57A1C22076; Tue, 9 Jan 2018 09:12:12 +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 6783AC22089 for ; Tue, 9 Jan 2018 09:12:12 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id 16so906755wry.12 for ; Tue, 09 Jan 2018 01:12:12 -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=jPn2W3A7ZAHZGadcrlr7TtP0OlF+8rmpni5uf+PmTojYtcubgdRDtQZYybz3TGhQA7 l267H61vaSf/jqCYL+6yEccAeB2LNCDgbNw3vWDR8rY0H9XvwSen5DvU0O1+tXZId/G2 8vWvn8XrOLHmjPvJkZ/IEBvG0JrTuVeJL4t1LodAAjsp5NZycH83XoCRIxo6O6BNaad7 dxa0NhbL1fm/FEJ7Ggew05DiUfXurKjYbED6gViv2QkFAVnVKO8+7NUOv8urzTaR9O+P xB9FO4cVJeI4t1EurXB4+fi9GBcUW/ONN79/X9ji4/fH/ZZZkk3uOlnzq7csVaDR5wi1 8Jvg== 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=LeweWZPhLaY5CNIGKtxZu8H6v50IcWtVm1NZbBg3qZd0X+LLh3+5LXgIdB9NiDp4LY shsSGa7W37QbPkZ2kDF0yQ2oaf+kJ5xQgDRxFHM1QMq/pbn/tVIfKtyGXVopwbuZ4mwy tBuQiMiQmXnZdPDo2JSCUKAVHSfK4S9K174JA34HqIFMSOeNC/IgsssmRHNoXN0CPPtO R387b85uztbj2lN14Q+f2mZSgACnm9QA4R79Aua4HH0hvxmIQftjKJqYoc2oJhOzFcCb NtKbR9XNA2OHSxmOGjJD/fhaDlzqY/uFd+jjQFOJZiOFV0idSgFpAPQDQtTradyCN3Cy 1OSA== X-Gm-Message-State: AKwxytcCK+XT8MIPpIS8OVo98innbHOP5ENcjsSCfybzRJa41KXnKmlr 0b7AB2lEmbQDi3/fgpu67Mo= X-Received: by 10.223.153.52 with SMTP id x49mr790621wrb.195.1515489132103; Tue, 09 Jan 2018 01:12: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 q7sm9943830wrf.31.2018.01.09.01.12.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:12:11 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, U-Boot@lists.denx.de, pbrobinson@gmail.com Date: Tue, 9 Jan 2018 10:12:02 +0100 Message-Id: <1515489123-6846-4-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515489123-6846-1-git-send-email-jorge.ramirez.ortiz@gmail.com> References: <1515489123-6846-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:32 +0000 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" 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" }, { } };