From patchwork Thu Oct 10 20:30:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184387 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1C1414ED for ; Thu, 10 Oct 2019 20:47:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3AC3214E0 for ; Thu, 10 Oct 2019 20:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfJJUrL (ORCPT ); Thu, 10 Oct 2019 16:47:11 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:44461 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbfJJUrL (ORCPT ); Thu, 10 Oct 2019 16:47:11 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N5UoU-1i2es011GU-016zYG; Thu, 10 Oct 2019 22:46:54 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann , Jacek Anaszewski , Pavel Machek , Dan Murphy , Ulf Hansson , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH 22/36] ARM: s3c: leds: move setpull() calls into board files Date: Thu, 10 Oct 2019 22:30:06 +0200 Message-Id: <20191010203043.1241612-22-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:I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SGnse+bEoPoiC5+cpKkG/CVosQj4RwxJF6 azmCqWbFFri4rO3D7Cx5IjqRjOszEhV4CLpM9JKkHftUplP2u0R6Ro0DQbIK8/H2tizfEjGrD D1BhRf1YcUd6Pd7ONehA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The leds-s3c24xx driver calls the private s3c_gpio_setpull() interface for each gpio line, but doing this requires access to the machine header files. Move those calls into the machine init functions for any board that uses the driver. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/common-smdk.c | 6 ++++-- arch/arm/mach-s3c24xx/mach-mini2440.c | 6 ++++++ arch/arm/mach-s3c24xx/mach-n30.c | 5 +++++ arch/arm/mach-s3c24xx/mach-qt2410.c | 1 + arch/arm/mach-s3c24xx/mach-vr1000.c | 7 +++++++ drivers/leds/leds-s3c24xx.c | 7 ------- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c index 58e30cad386c..5392d5106b4b 100644 --- a/arch/arm/mach-s3c24xx/common-smdk.c +++ b/arch/arm/mach-s3c24xx/common-smdk.c @@ -189,11 +189,13 @@ static const struct gpio smdk_led_gpios[] = { void __init smdk_machine_init(void) { /* Configure the LEDs (even if we have no LED support)*/ + int i, ret; - int ret = gpio_request_array(smdk_led_gpios, - ARRAY_SIZE(smdk_led_gpios)); + 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)); + for (i = 0; i < ARRAY_SIZE(smdk_led_gpios); i++) + s3c_gpio_setpull(smdk_led_gpios[i].gpio, S3C_GPIO_PULL_NONE); if (machine_is_smdk2443()) smdk_nand_info.twrph0 = 50; diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index bb44b8704d64..894d43ff94f1 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c @@ -690,6 +690,12 @@ static void __init mini2440_init(void) s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); + /* LEDs: no point in having a pull-up if we are always driving */ + s3c_gpio_setpull(S3C2410_GPB(5), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPB(6), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPB(7), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPB(8), S3C_GPIO_PULL_NONE); + if (features.lcd_index != -1) { int li; diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c index 1836f1cc0992..5f5ca4b7015c 100644 --- a/arch/arm/mach-s3c24xx/mach-n30.c +++ b/arch/arm/mach-s3c24xx/mach-n30.c @@ -571,6 +571,11 @@ static void __init n30_init(void) S3C2410_MISCCR_USBSUSPND0 | S3C2410_MISCCR_USBSUSPND1, 0x0); + /* LEDs: no point in having a pull-up if we are always driving */ + s3c_gpio_setpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c index 3cf8423c76c6..6686f02a3f4f 100644 --- a/arch/arm/mach-s3c24xx/mach-qt2410.c +++ b/arch/arm/mach-s3c24xx/mach-qt2410.c @@ -332,6 +332,7 @@ static void __init qt2410_machine_init(void) /* set initial state of the LED GPIO */ WARN_ON(gpio_request_one(S3C2410_GPB(0), GPIOF_OUT_INIT_HIGH, NULL)); + s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE); gpio_free(S3C2410_GPB(0)); s3c24xx_udc_set_platdata(&qt2410_udc_cfg); diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c index 853e74f9b8b5..ca2f874a637e 100644 --- a/arch/arm/mach-s3c24xx/mach-vr1000.c +++ b/arch/arm/mach-s3c24xx/mach-vr1000.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -322,6 +323,12 @@ static void __init vr1000_init(void) i2c_register_board_info(0, vr1000_i2c_devs, ARRAY_SIZE(vr1000_i2c_devs)); + + /* LEDs: no point in having a pull-up if we are always driving */ + s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_NONE); + s3c_gpio_setpull(S3C2410_GPB(2), S3C_GPIO_PULL_NONE); + nor_simtec_init(); simtec_audio_add(NULL, true, NULL); diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c index f8b8d6e313ee..bc67e5d344a6 100644 --- a/drivers/leds/leds-s3c24xx.c +++ b/drivers/leds/leds-s3c24xx.c @@ -16,9 +16,6 @@ #include #include -#include -#include - /* our context */ struct s3c24xx_gpio_led { @@ -73,10 +70,6 @@ static int s3c24xx_led_probe(struct platform_device *dev) if (ret < 0) return ret; - /* no point in having a pull-up if we are always driving */ - - s3c_gpio_setpull(pdata->gpio, S3C_GPIO_PULL_NONE); - if (pdata->flags & S3C24XX_LEDF_TRISTATE) gpio_direction_input(pdata->gpio); else