From patchwork Sat Jun 30 12:08:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 1134291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 32D5240AC1 for ; Sat, 30 Jun 2012 12:13:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SkwUm-000060-TU; Sat, 30 Jun 2012 12:09:49 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SkwUP-0008Tx-HJ for linux-arm-kernel@lists.infradead.org; Sat, 30 Jun 2012 12:09:25 +0000 Received: by eekd17 with SMTP id d17so1693728eek.36 for ; Sat, 30 Jun 2012 05:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Bhwry6FDpv8mYCy8PKSBhd7p/anEBqfv3WuL8Zpjp4I=; b=hyref2WX8MOG/Pi/E/qz0Dy7bXcaP9i02xP+8NTSv4XS6Txf1EHSLkfNynnCYHnNhf 9FYNwq2GvuNplXVSeDM8VGSLLBAv3/iAJ1nV+hoEu63IOfGVeDSjvIs9d7ssqUQb4Y2k XI3vjmdUFH8mQMRwya4kSqxNf/ZEt1LTLCAW2llfigE2y5dFYd67vH8Bk0h5K0P37i6D JBNxRy9v3m65Q40enFWlTV9QlJ4hJYcGJtGwfG3E4UAgHEibpYcdPNIzYAlWFXH9rauV sXgJZKw0OHWAFCqWqI4mZZTOrAELsfNnyCNmBzZl9V2vk2L5L53/OPDPXUCAiqjYKXOV ewlg== Received: by 10.14.187.11 with SMTP id x11mr1521716eem.57.1341058164435; Sat, 30 Jun 2012 05:09:24 -0700 (PDT) Received: from localhost.localdomain (031011252076.warszawa.vectranet.pl. [31.11.252.76]) by mx.google.com with ESMTPS id a16sm16456798eeg.0.2012.06.30.05.09.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Jun 2012 05:09:23 -0700 (PDT) From: Sylwester Nawrocki To: kgene.kim@samsung.com Subject: [PATCH 02/10] ARM: S3C24XX: Convert SMDK board file to the gpiolib API Date: Sat, 30 Jun 2012 14:08:54 +0200 Message-Id: <1341058142-30438-3-git-send-email-sylvester.nawrocki@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1341058142-30438-1-git-send-email-sylvester.nawrocki@gmail.com> References: <1341058142-30438-1-git-send-email-sylvester.nawrocki@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sylvester.nawrocki[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Sylwester Nawrocki , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ben-linux@fluff.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Replace SoC specific GPIO functions with the gpiolib API. The LED gpios are freed right after they are initially configured so they can be acquired in the s3c24xx_led driver. This change is required for converting the s3c24xx_led driver to the gpiolib API. Signed-off-by: Sylwester Nawrocki --- This change is only compile tested, since I don't have the board. Thus it would be good if someone could test this and provide a Tested-by tag. --- arch/arm/mach-s3c24xx/common-smdk.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c index 084604b..87e75a2 100644 --- a/arch/arm/mach-s3c24xx/common-smdk.c +++ b/arch/arm/mach-s3c24xx/common-smdk.c @@ -182,19 +182,21 @@ static struct platform_device __initdata *smdk_devs[] = { &smdk_led7, }; +static const struct gpio smdk_led_gpios[] = { + { S3C2410_GPF(4), GPIOF_OUT_INIT_HIGH, NULL }, + { S3C2410_GPF(5), GPIOF_OUT_INIT_HIGH, NULL }, + { S3C2410_GPF(6), GPIOF_OUT_INIT_HIGH, NULL }, + { S3C2410_GPF(7), GPIOF_OUT_INIT_HIGH, NULL }, +}; + void __init smdk_machine_init(void) { /* Configure the LEDs (even if we have no LED support)*/ - s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); - s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); - s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); - s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); - - s3c2410_gpio_setpin(S3C2410_GPF(4), 1); - s3c2410_gpio_setpin(S3C2410_GPF(5), 1); - s3c2410_gpio_setpin(S3C2410_GPF(6), 1); - s3c2410_gpio_setpin(S3C2410_GPF(7), 1); + int ret = gpio_request_array(smdk_led_gpios, + ARRAY_SIZE(smdk_led_gpios)); + if (!WARN_ON(ret < 0)) + gpio_free_array(smdk_led_gpios, ARRAY_SIZE(smdk_led_gpios)); if (machine_is_smdk2443()) smdk_nand_info.twrph0 = 50;