From patchwork Wed Dec 17 03:55:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Y Vo X-Patchwork-Id: 422170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7C8551400DD for ; Wed, 17 Dec 2014 14:56:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbaLQD4K (ORCPT ); Tue, 16 Dec 2014 22:56:10 -0500 Received: from exprod5og121.obsmtp.com ([64.18.0.139]:60603 "HELO exprod5og121.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751254AbaLQD4J (ORCPT ); Tue, 16 Dec 2014 22:56:09 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]) (using TLSv1) by exprod5ob121.postini.com ([64.18.4.12]) with SMTP ID DSNKVJD+2K0/hrK85oZKyB5QdTWFB4wdSLLT@postini.com; Tue, 16 Dec 2014 19:56:09 PST Received: by mail-pd0-f169.google.com with SMTP id z10so15349467pdj.28 for ; Tue, 16 Dec 2014 19:56:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NeAP4x2hjIzpSG9Vmnxq44sX5adnzu8+TFkZFLce2tE=; b=dGbx5tiA2AmNlJXntgvQpHSohAP54C48pg21UbC8ebpxe4ccn9jARyxc207m0rGVcq Zf4pl9yj9IwrmlelOJluvJdCoM0yc+MhzatPMD11gGWRCImxKwjgQ2bUIYFGE+5AQHBW s916Za+8EIPu5DFAjWoLoYVCBgqqL0k8hZLwr2V+Z9T3L0ig0ybk8BsKKG0ekAhzoX81 F7vgwOAts1xORi9Q3EvsDk3OfQ9IGc6ABQEpbKgtr+r+JzbjKWDwwsooqYvYMsBMPy9D i16ctcFokXAMGljcCbEHKz8jmAvtnP2Z6Epl32aEVmzwKpkElJDCQwazHpUMC2xNSV3b CNRQ== X-Gm-Message-State: ALoCoQk8qbO2W414LaOY/BLWCXgxYPj8a19x+gd57JoL+i0qGv8XzppbRficp7lrprK1pRYO1qcSMVRlDP3BrSB6wU7lE53SM/0DkxbtjUVenDALEsiFX21det16K44fE1Nv3GbSkLaENy2VnyzjsYBiAuVcmPivmg== X-Received: by 10.66.186.110 with SMTP id fj14mr62903239pac.98.1418788568567; Tue, 16 Dec 2014 19:56:08 -0800 (PST) X-Received: by 10.66.186.110 with SMTP id fj14mr62903225pac.98.1418788568497; Tue, 16 Dec 2014 19:56:08 -0800 (PST) Received: from denmail01.apm.com ([118.69.219.197]) by mx.google.com with ESMTPSA id o3sm2397731pdn.29.2014.12.16.19.56.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 19:56:07 -0800 (PST) From: Y Vo To: linus.walleij@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Y Vo , Phong Vo , Toan Le , patches@apm.com Subject: [PATCH v2 3/3] arm64:dts: Add APM X-Gene standby GPIO controller DTS entries Date: Wed, 17 Dec 2014 10:55:49 +0700 Message-Id: <1418788549-27108-4-git-send-email-yvo@apm.com> X-Mailer: git-send-email 1.8.4.474.g128a96c In-Reply-To: <1418788549-27108-1-git-send-email-yvo@apm.com> References: <1418788549-27108-1-git-send-email-yvo@apm.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add standby domain gpio controller for APM X-Gene SoC platform. Signed-off-by: Y Vo --- arch/arm64/boot/dts/apm-storm.dtsi | 13 +++++++++++++ drivers/gpio/gpio-xgene-sb.c | 18 +++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi index 295c72d..e2454a2 100644 --- a/arch/arm64/boot/dts/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm-storm.dtsi @@ -587,6 +587,19 @@ phy-names = "sata-phy"; }; + sbgpio: sbgpio@17001000{ + compatible = "apm,xgene-gpio-sb"; + reg = <0x0 0x17001000 0x0 0x400>; + #gpio-cells = <2>; + gpio-controller; + interrupts = <0x0 0x28 0x1>, + <0x0 0x29 0x1>, + <0x0 0x2a 0x1>, + <0x0 0x2b 0x1>, + <0x0 0x2c 0x1>, + <0x0 0x2d 0x1>; + }; + rtc: rtc@10510000 { compatible = "apm,xgene-rtc"; reg = <0x0 0x10510000 0x0 0x400>; diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c index 7668626..425234b 100644 --- a/drivers/gpio/gpio-xgene-sb.c +++ b/drivers/gpio/gpio-xgene-sb.c @@ -44,14 +44,10 @@ #define MPA_GPIO_SEL_LO 0x0294 #define MPA_GPIO_SEL_HIGH 0x029c -#define GICD_SPI_BASE 0x78010000 -#define GICD_SPIR1 0x00000d08 - struct xgene_gpio_sb { struct of_mm_gpio_chip mm; u32 *irq; u32 nirq; - void __iomem *gic_regs; spinlock_t lock; /* mutual exclusion */ }; @@ -75,14 +71,9 @@ static void xgene_gpio_set_bit(void __iomem *reg, u32 gpio, int val) static int xgene_gpio_sb_get(struct gpio_chip *gc, u32 gpio) { struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); - struct xgene_gpio_sb *chip = to_xgene_gpio_sb(mm_gc); u32 data; - if (chip->irq[gpio]) { - data = ioread32(chip->gic_regs + GICD_SPIR1); - } else { - data = ioread32(mm_gc->regs + MPA_GPIO_IN_ADDR); - } + data = ioread32(mm_gc->regs + MPA_GPIO_IN_ADDR); return (data & GPIO_MASK(gpio)) ? 1 : 0; } @@ -167,10 +158,6 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev) mm->gc.ngpio = XGENE_MAX_GPIO_DS; apm_gc->nirq = XGENE_MAX_GPIO_DS_IRQ; - apm_gc->gic_regs = ioremap(GICD_SPI_BASE, 16); - if (!apm_gc->gic_regs) - return -ENOMEM; - apm_gc->irq = devm_kzalloc(&pdev->dev, sizeof(u32) * XGENE_MAX_GPIO_DS, GFP_KERNEL); if (!apm_gc->irq) @@ -202,7 +189,8 @@ static int xgene_gpio_sb_remove(struct platform_device *pdev) { struct of_mm_gpio_chip *mm = platform_get_drvdata(pdev); - return gpiochip_remove(&mm->gc); + gpiochip_remove(&mm->gc); + return 0; } static const struct of_device_id xgene_gpio_sb_of_match[] = {