From patchwork Fri Dec 14 16:19:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13601 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C01AB23FB4 for ; Fri, 14 Dec 2012 16:20:12 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 73584A18D6B for ; Fri, 14 Dec 2012 16:20:12 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3226358iag.11 for ; Fri, 14 Dec 2012 08:20:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-received :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=8mF7EOhqXzYqfqq/j7ic097qxScFU2R8ZA5pkpN7Teo=; b=ZCuFTKVfp4SNoUyq1eq2vt5Em7UIXnP/fT5atvnecRR7L7ehPmD2RNTbRNozRC7CcN 4BbVIrPjqfVfBwVPdNmVO3cR8dSGY2oFf9aTmZk0ItGiZd16BrOCYqqILfJjsTKvVACR ENS8wx1DNJ8dLg+AzKmnOJy9EMwIWkaG13SrL66pIaay3CYysI64u0/9vkMQCudcP5zr PQnxtGxowSuxXRfk9+z6eRqqHsbrJn2WDeQ9M1sL9yO5JvzuNKtufHvSR5+VnunQ4jpA 2B+R6I/Y9zx673//A241RmcrEWjKuImff18LPcQl+fxr6F8zo1OFJOe+6LAm8OzEzw7l JFCQ== Received: by 10.50.42.168 with SMTP id p8mr2018810igl.57.1355502011911; Fri, 14 Dec 2012 08:20:11 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp81605igt; Fri, 14 Dec 2012 08:20:11 -0800 (PST) Received: by 10.180.20.177 with SMTP id o17mr3584371wie.18.1355502010580; Fri, 14 Dec 2012 08:20:10 -0800 (PST) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id hq18si7969751wib.38.2012.12.14.08.20.10 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Dec 2012 08:20:10 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wg0-f42.google.com with SMTP id dr1so506787wgb.1 for ; Fri, 14 Dec 2012 08:20:10 -0800 (PST) X-Received: by 10.180.107.130 with SMTP id hc2mr3602228wib.12.1355502010030; Fri, 14 Dec 2012 08:20:10 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id u6sm8325248wif.2.2012.12.14.08.20.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Dec 2012 08:20:09 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Alexandre Torgue , Lee Jones Subject: [PATCH 15/21] gpio: ab8500: Add support for the ab8540 Date: Fri, 14 Dec 2012 16:19:33 +0000 Message-Id: <1355501979-1157-16-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355501979-1157-1-git-send-email-lee.jones@linaro.org> References: <1355501979-1157-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl2j8eLknzR1S/RbAGTBIlNkP4MEaIAHubXme9Xr+VMLLw2NSRbyhLI/I3IosMjySMUghmE From: Alexandre Torgue Signed-off-by: Lee Jones Signed-off-by: Alexandre Torgue Reviewed-by: Maxime COQUELIN Reviewed-by: Marcus COOPER Reviewed-by: Mattias WALLIN --- drivers/gpio/gpio-ab8500.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c index ab6ceac..757ae34 100644 --- a/drivers/gpio/gpio-ab8500.c +++ b/drivers/gpio/gpio-ab8500.c @@ -78,6 +78,7 @@ #define AB8500_NUM_GPIO 42 #define AB9540_NUM_GPIO 54 #define AB8505_NUM_GPIO 53 +#define AB8540_NUM_GPIO 56 #define AB8500_NUM_VIR_GPIO_IRQ 16 enum ab8500_gpio_action { @@ -146,6 +147,15 @@ static struct ab8500_gpio_irq_cluster ab8505_irq_clusters[] = { {.start = 51, .end = 52}, }; +/* + * For AB8540 Only some GPIOs are interrupt capable: + * GPIO51 to GPIO54 + */ +static struct ab8500_gpio_irq_cluster ab8540_irq_clusters[] = { + {.start = 50, .end = 53}, /* GPIO numbers start from 1 */ +}; + + /** * to_ab8500_gpio() - get the pointer to ab8500_gpio * @chip: Member of the structure ab8500_gpio @@ -483,7 +493,14 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev) ab8500_gpio->irq_base = pdata->irq_base; /* Configure GPIO Settings for specific AB devices */ - if (is_ab9540(parent)) { + if (is_ab8540(parent)) { + ab8500_gpio->chip.ngpio = AB8540_NUM_GPIO; + ab8500_gpio->irq_cluster = ab8540_irq_clusters; + ab8500_gpio->irq_cluster_size = + ARRAY_SIZE(ab8540_irq_clusters); + last_gpio_sel_reg = AB9540_GPIO_SEL7_REG; + altfun_reg_index = AB9540_ALTFUN_REG_INDEX; + } else if (is_ab9540(parent)) { ab8500_gpio->chip.ngpio = AB9540_NUM_GPIO; ab8500_gpio->irq_cluster = ab9540_irq_clusters; ab8500_gpio->irq_cluster_size =