From patchwork Fri Dec 14 16:19:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13591 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 C5A0223FB4 for ; Fri, 14 Dec 2012 16:19:57 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 79F62A19D56 for ; Fri, 14 Dec 2012 16:19:57 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so6157655ieb.11 for ; Fri, 14 Dec 2012 08:19:57 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=83TJ+a02I+4F4/T3E1biHvK7ofimV7yL/RRces9w5sg=; b=nhLania1PnCVHBfFvncUe41l6XndXPa7I0JGq5vQKAcFwDIj4zUJ4mJc8HLeRNwidM DbxHjYLI63cd1j6i2kQ962N7OA3/zC72XNMl7GqkHwttOerSIe7uGmIfjwPeDveSNnHF asfnyMWKrLgQBQAiJryPXgjSyAZ7aDdV37B3j8xQKvT1gmp8RZEXbFrtgxDu++LK/A4N XNtot8o80WvhMK0dq+ES22V/Rp7uDyvDsjcmfuTpIcQJAbGAYliojFlWGbWF/fsDYkIt 0DDeLb540FzGFP/pONyQe94aFJwUes4KzRZlohe3vvtH3sDUWGgcKgsNMSpgviK5Ipbr /ECg== Received: by 10.50.185.166 with SMTP id fd6mr1992536igc.62.1355501996934; Fri, 14 Dec 2012 08:19:56 -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 n20csp81584igt; Fri, 14 Dec 2012 08:19:56 -0800 (PST) Received: by 10.194.93.40 with SMTP id cr8mr4569914wjb.16.1355501995883; Fri, 14 Dec 2012 08:19:55 -0800 (PST) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id dx9si7970837wib.34.2012.12.14.08.19.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Dec 2012 08:19:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.179; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.179 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-wi0-f179.google.com with SMTP id o1so586960wic.12 for ; Fri, 14 Dec 2012 08:19:55 -0800 (PST) Received: by 10.180.109.132 with SMTP id hs4mr3626707wib.1.1355501995059; Fri, 14 Dec 2012 08:19:55 -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.19.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Dec 2012 08:19:54 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Mian Yousaf Kaukab , Lee Jones , Bibek Basu Subject: [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration Date: Fri, 14 Dec 2012 16:19:23 +0000 Message-Id: <1355501979-1157-6-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: ALoCoQkSFiV0exIbGtaJ64rtV8PHMuaObdzgF1snvhMN2GYhQInb9aotngZPrWISIINjSwMX2R8/ From: Mian Yousaf Kaukab This patch extends the the platform data to include gpio direction and pullups configurations. These configurations are applied during probe(). Signed-off-by: Lee Jones Signed-off-by: Bibek Basu Signed-off-by: Mian Yousaf Kaukab Reviewed-by: Jonas ABERG Tested-by: Jonas ABERG --- drivers/gpio/gpio-ab8500.c | 12 ++++++++++++ include/linux/mfd/abx500/ab8500-gpio.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c index 77fe1d7..dd95cb3 100644 --- a/drivers/gpio/gpio-ab8500.c +++ b/drivers/gpio/gpio-ab8500.c @@ -445,6 +445,18 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev) pdata->config_reg[i]); if (ret < 0) goto out_free; + + ret = abx500_set_register_interruptible(ab8500_gpio->dev, + AB8500_MISC, i + AB8500_GPIO_DIR1_REG, + pdata->config_direction[i]); + if (ret < 0) + goto out_free; + + ret = abx500_set_register_interruptible(ab8500_gpio->dev, + AB8500_MISC, i + AB8500_GPIO_PUD1_REG, + pdata->config_pullups[i]); + if (ret < 0) + goto out_free; } ret = abx500_set_register_interruptible(ab8500_gpio->dev, AB8500_MISC, AB8500_GPIO_ALTFUN_REG, diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h index 5caa615..94e85ca 100644 --- a/include/linux/mfd/abx500/ab8500-gpio.h +++ b/include/linux/mfd/abx500/ab8500-gpio.h @@ -18,6 +18,8 @@ struct ab8500_gpio_platform_data { int gpio_base; u32 irq_base; u8 config_reg[8]; + u8 config_direction[6]; + u8 config_pullups[6]; }; enum ab8500_pin {