]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ARM: s3c24xx: move iis pinctrl config into boards
authorArnd Bergmann <arnd@arndb.de>
Thu, 6 Aug 2020 18:20:45 +0000 (20:20 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Thu, 20 Aug 2020 15:40:57 +0000 (17:40 +0200)
The s3c_gpio_cfgall_range() function is an internal interface of the
samsung gpio driver and should not be called directly by drivers, so
move the iis pin initialization into the boards.

This means the pin configuration is only run once at early boot, rather
than each time the driver binds, but the effect should be the same.

Note that the s3c2412-i2s driver has no boards using it in mainline linux,
the driver gets selected for the jive machine but is never instantiated.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-28-krzk@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
16 files changed:
arch/arm/mach-s3c24xx/mach-gta02.c
arch/arm/mach-s3c24xx/mach-h1940.c
arch/arm/mach-s3c24xx/mach-mini2440.c
arch/arm/mach-s3c24xx/mach-n30.c
arch/arm/mach-s3c24xx/mach-nexcoder.c
arch/arm/mach-s3c24xx/mach-otom.c
arch/arm/mach-s3c24xx/mach-qt2410.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c24xx/mach-rx3715.c
arch/arm/mach-s3c24xx/mach-smdk2410.c
arch/arm/mach-s3c24xx/mach-smdk2413.c
arch/arm/mach-s3c24xx/mach-smdk2440.c
arch/arm/mach-s3c24xx/mach-vstms.c
arch/arm/mach-s3c24xx/simtec-audio.c
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c

index 46a80fae7056cd431cc58ca4d70aba073414a343..3c7f2a3d00a555fb87dcdffba290f404c35bf63e 100644 (file)
@@ -538,6 +538,10 @@ static void __init gta02_machine_init(void)
 
        i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
 
+       /* 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);
+
        gpiod_add_lookup_table(&gta02_audio_gpio_table);
        platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
        pm_power_off = gta02_poweroff;
index c7269cd26ba8d5dfa4f419ad73e662dcbf4e605c..1f18ac4e84b2984857b74ac32678e592c1f9cead 100644 (file)
@@ -707,6 +707,9 @@ static void __init h1940_init(void)
        s3c24xx_fb_set_platdata(&h1940_fb_info);
        gpiod_add_lookup_table(&h1940_mmc_gpio_table);
        gpiod_add_lookup_table(&h1940_audio_gpio_table);
+       /* 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);
        s3c24xx_mci_set_platdata(&h1940_mmc_cfg);
        s3c24xx_udc_set_platdata(&h1940_udc_cfg);
        s3c24xx_ts_set_platdata(&h1940_ts_cfg);
index 65f48094114e644b58693cc1a53e60a4175db5a1..0bd2746f19a68358b6526a12c709f28335a110f1 100644 (file)
@@ -714,6 +714,11 @@ static void __init mini2440_init(void)
                s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP);
                s3c_gpio_cfgpin(mini2440_buttons[i].gpio, S3C2410_GPIO_INPUT);
        }
+
+       /* 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);
+
        if (features.lcd_index != -1) {
                int li;
 
index 152f09242579451c3053d64f75727799742a7ab8..9410fcb82340f54aeecf2004c6ed5ecffb77c28b 100644 (file)
@@ -36,6 +36,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 #include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
@@ -599,6 +600,10 @@ static void __init n30_init(void)
                              S3C2410_MISCCR_USBSUSPND0 |
                              S3C2410_MISCCR_USBSUSPND1, 0x0);
 
+       /* 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);
+
        if (machine_is_n30()) {
                /* Turn off suspend on both USB ports, and switch the
                 * selectable USB port to USB device mode. */
index 5385437ef46406accf9f3ad1fafc6bfabacd6606..ec23b115261e4e9388183cdc2c492503a6e7c743 100644 (file)
@@ -143,6 +143,11 @@ static void __init nexcoder_init_time(void)
 static void __init nexcoder_init(void)
 {
        s3c_i2c0_set_platdata(NULL);
+
+       /* 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);
+
        platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices));
 };
 
index e7eec5ccddb316ec822222920034016b91b34d19..1f777ab4ced778aa9725df69c08021d13121fd20 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/mach/irq.h>
 
 #include <mach/regs-gpio.h>
+#include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
@@ -105,6 +107,10 @@ static void __init otom11_init_time(void)
 static void __init otom11_init(void)
 {
        s3c_i2c0_set_platdata(NULL);
+
+       /* 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);
        platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
 }
 
index 4ac3d0531992189f4df5eef95577beb994815194..5e33f3da629eb395339beb1fe0de97c0dac86b30 100644 (file)
@@ -341,6 +341,9 @@ static void __init qt2410_machine_init(void)
        s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
        s3c_i2c0_set_platdata(NULL);
 
+       /* 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);
        gpiod_add_lookup_table(&qt2410_spi_gpiod_table);
        s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE);
        gpiod_add_lookup_table(&qt2410_led_gpio_table);
index a5461b2227bd5937bddaddb2e254b9531dfefe8d..86d348f3397234f7d3d9d22675dacb49f0f5ba6c 100644 (file)
@@ -828,6 +828,9 @@ static void __init rx1950_init_machine(void)
 
        pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup));
        gpiod_add_lookup_table(&rx1950_audio_gpio_table);
+       /* 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);
        platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
 
        i2c_register_board_info(0, rx1950_i2c_devices,
index 617392de01accf328446c3f4dc99f29dbe333e79..fc197cee77a0eee1a0deb12b8148c1a06cdf12d9 100644 (file)
@@ -38,6 +38,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 #include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
@@ -197,6 +198,9 @@ static void __init rx3715_init_machine(void)
 
        s3c_nand_set_platdata(&rx3715_nand_info);
        s3c24xx_fb_set_platdata(&rx3715_fb_info);
+       /* 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);
        platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
 }
 
index 1d4d8735f2834a2d5b6e17d685f118cc51b68362..c78fe1d8802c1120dd347fd476c85558aed643dc 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/serial_s3c.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -92,6 +94,9 @@ static void __init smdk2410_init(void)
 {
        s3c_i2c0_set_platdata(NULL);
        platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
+       /* 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);
        smdk_machine_init();
 }
 
index 9782cc3e698cc9e760c08509bfb3710bad2a2db6..287bd502a030b4d6a1a3502c847e82e5e1b0b63f 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/platform_data/i2c-s3c2410.h>
 #include <mach/gpio-samsung.h>
 #include <mach/fb.h>
+#include <plat/gpio-cfg.h>
 
 #include <plat/devs.h>
 #include <plat/cpu.h>
@@ -118,6 +119,9 @@ static void __init smdk2413_machine_init(void)
 
        s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
        s3c_i2c0_set_platdata(NULL);
+       /* 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);
 
        platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
        smdk_machine_init();
index bd6a351055189495735d034be7993fe5b2a83082..5939372ecec21fc5c3d80bfb11a43f05692d472c 100644 (file)
@@ -28,6 +28,8 @@
 
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
+#include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <mach/fb.h>
 #include <linux/platform_data/i2c-s3c2410.h>
@@ -165,7 +167,9 @@ static void __init smdk2440_machine_init(void)
 {
        s3c24xx_fb_set_platdata(&smdk2440_fb_info);
        s3c_i2c0_set_platdata(NULL);
-
+       /* 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);
        platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
        smdk_machine_init();
 }
index f0acbaa6dfd67889122bcdc44be160a20c387717..c6e777aab24e62d6009a911300d3d8db702567aa 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
+#include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <mach/fb.h>
 
@@ -147,7 +149,9 @@ static void __init vstms_init(void)
 {
        s3c_i2c0_set_platdata(NULL);
        s3c_nand_set_platdata(&vstms_nand_info);
-
+       /* 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);
        platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
 }
 
index cfe78bf8cc9b3f7352e71f7a65fa64431334d3f4..af87261e6a590fee478bbc4fca0222070953c3b7 100644 (file)
@@ -13,6 +13,8 @@
 #include <linux/io.h>
 
 #include <mach/regs-gpio.h>
+#include <mach/gpio-samsung.h>
+#include <plat/gpio-cfg.h>
 
 #include <linux/platform_data/asoc-s3c24xx_simtec.h>
 #include <plat/devs.h>
@@ -64,6 +66,10 @@ int __init simtec_audio_add(const char *name, bool has_lr_routing,
        if (has_lr_routing)
                simtec_audio_platdata.startup = simtec_audio_startup_lrroute;
 
+       /* 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);
+
        platform_device_register(&s3c_device_iis);
        platform_device_register(&simtec_audio_dev);
        return 0;
index edfa9d11d2e5f051eb19ca04db82da5377b91b94..81f416ac457e0b61de488efa0c7bab43702b6ac8 100644 (file)
@@ -19,9 +19,6 @@
 #include <sound/soc.h>
 #include <sound/pcm_params.h>
 
-#include <mach/gpio-samsung.h>
-#include <plat/gpio-cfg.h>
-
 #include "dma.h"
 #include "regs-i2s-v2.h"
 #include "s3c2412-i2s.h"
@@ -70,10 +67,6 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
        if (ret)
                goto err;
 
-       /* 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);
-
        return 0;
 
 err:
index 60bfaed5f7a6e555304a39accd29f7674018a15d..50c08008aacb8c1fbebf2bd82b29d6d4deef212d 100644 (file)
 #include <sound/soc.h>
 #include <sound/pcm_params.h>
 
-#include <mach/gpio-samsung.h>
-#include <plat/gpio-cfg.h>
 #include "regs-iis.h"
-
 #include "dma.h"
 #include "s3c24xx-i2s.h"
 
@@ -348,10 +345,6 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
        if (ret)
                return ret;
 
-       /* 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);
-
        writel(S3C2410_IISCON_IISEN, s3c24xx_i2s.regs + S3C2410_IISCON);
 
        s3c24xx_snd_txctrl(0);