From patchwork Mon Sep 9 15:41:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2862341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BEA59F2D6 for ; Mon, 9 Sep 2013 16:04:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D732120306 for ; Mon, 9 Sep 2013 16:04:13 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7211E20154 for ; Mon, 9 Sep 2013 16:04:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3bq-0002zP-Bt; Mon, 09 Sep 2013 15:42:40 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3b3-0001lj-SD; Mon, 09 Sep 2013 15:41:49 +0000 Received: from mail-lb0-f182.google.com ([209.85.217.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3az-0001iU-5O for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2013 15:41:46 +0000 Received: by mail-lb0-f182.google.com with SMTP id c11so5265196lbj.27 for ; Mon, 09 Sep 2013 08:41:23 -0700 (PDT) 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; bh=sU6YbB+lkh42vw1QPHFhi/K9DG1NOLk+oM6kQqESfW4=; b=VAHd0O4uPhw5iKakOyvdZ3q9ZpW5t6kLA5/0sMtVfQ3izDlaL5PaYbpNq4x4rJ++HY eGJlX55BU/BPHyRyg8DeDytDZoZk2TFLekIqPQIICZZK/QIaecWMqxBzXUT/jDZHvzY7 xz6vTKP+PihK02n4+V/CRonr7FvPXCG6oSjwTKfG8GQ3i8TAztycaZt1S0z6zAV/J8UT q9c50trDcoW7QKy8/jjnMN7QWaCZzYN0pzaPFWCoh6c4HBQmT44MimB7VXzGl2QkhAeh aDg2Z5EJGqFRPSNuGIkHjrVXbfLcqDVv8IGboAzZs+I3KES2/xrFQyv8MhguLmPtduBz VCZg== X-Gm-Message-State: ALoCoQltpvtukpCZgJ3MkoogLMF2UKG+nfPavVo1djC2crcl80Up8980yBCBCM8sJaI7eZPHe+qj X-Received: by 10.152.18.131 with SMTP id w3mr563288lad.47.1378741283633; Mon, 09 Sep 2013 08:41:23 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id ap7sm6681926lac.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:41:22 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Lennert Buytenhek , Dan Williams , Mikael Pettersson Subject: [PATCH 8/8] ARM: plat-iop: pass physical base for GPIO Date: Mon, 9 Sep 2013 17:41:19 +0200 Message-Id: <1378741279-13143-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130909_114145_564784_5C27713D X-CRM114-Status: GOOD ( 12.39 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , Alexandre Courbot , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This alters the IOP platforms to pass a physical base for their GPIO blocks and alters the driver to remap it when probing instead of relying on the virtual addresses to be used. Cc: Lennert Buytenhek Cc: Dan Williams Cc: Mikael Pettersson Signed-off-by: Linus Walleij --- arch/arm/mach-iop32x/iq31244.c | 2 +- arch/arm/mach-iop32x/iq80321.c | 2 +- arch/arm/mach-iop33x/iq80331.c | 2 +- arch/arm/mach-iop33x/iq80332.c | 2 +- drivers/gpio/gpio-iop.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c index 4441a87..cbe6df4 100644 --- a/arch/arm/mach-iop32x/iq31244.c +++ b/arch/arm/mach-iop32x/iq31244.c @@ -282,7 +282,7 @@ void ep80219_power_off(void) } static struct resource iq31244_gpio_res[] = { - DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4), 0x10), + DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x07c4), 0x10), }; static void __init iq31244_init_machine(void) diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c index b41cd49..82a1998 100644 --- a/arch/arm/mach-iop32x/iq80321.c +++ b/arch/arm/mach-iop32x/iq80321.c @@ -169,7 +169,7 @@ static struct platform_device iq80321_serial_device = { }; static struct resource iq80321_gpio_res[] = { - DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4), 0x10), + DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x07c4), 0x10), }; static void __init iq80321_init_machine(void) diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c index 25741c4..e2cb65c 100644 --- a/arch/arm/mach-iop33x/iq80331.c +++ b/arch/arm/mach-iop33x/iq80331.c @@ -123,7 +123,7 @@ static struct platform_device iq80331_flash_device = { }; static struct resource iq80331_gpio_res[] = { - DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780), 0x10), + DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10), }; static void __init iq80331_init_machine(void) diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c index a3b56e1..0b6269d 100644 --- a/arch/arm/mach-iop33x/iq80332.c +++ b/arch/arm/mach-iop33x/iq80332.c @@ -123,7 +123,7 @@ static struct platform_device iq80332_flash_device = { }; static struct resource iq80332_gpio_res[] = { - DEFINE_RES_MEM((IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780), 0x10), + DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10), }; static void __init iq80332_init_machine(void) diff --git a/drivers/gpio/gpio-iop.c b/drivers/gpio/gpio-iop.c index 0d991d7..c22a61b 100644 --- a/drivers/gpio/gpio-iop.c +++ b/drivers/gpio/gpio-iop.c @@ -110,7 +110,7 @@ static int iop3xx_gpio_probe(struct platform_device *pdev) struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = (void *) res->start; + base = devm_ioremap_resource(&pdev->dev, res); return gpiochip_add(&iop3xx_chip); }