1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright 2009 Wolfson Microelectronics
4 // Mark Brown <broonie@opensource.wolfsonmicro.com>
6 #include <linux/kernel.h>
7 #include <linux/string.h>
8 #include <linux/platform_device.h>
9 #include <linux/dma-mapping.h>
10 #include <linux/gpio.h>
11 #include <linux/export.h>
17 #include <linux/platform_data/asoc-s3c.h>
19 #include "gpio-samsung.h"
21 static int s3c64xx_i2s_cfg_gpio(struct platform_device
*pdev
)
27 base
= S3C64XX_GPD(0);
30 base
= S3C64XX_GPE(0);
33 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
34 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
35 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
36 s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
39 printk(KERN_DEBUG
"Invalid I2S Controller number: %d\n",
44 s3c_gpio_cfgpin_range(base
, 5, S3C_GPIO_SFN(3));
49 static struct resource s3c64xx_iis0_resource
[] = {
50 [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS0
, SZ_256
),
53 static struct s3c_audio_pdata i2s0_pdata
= {
54 .cfg_gpio
= s3c64xx_i2s_cfg_gpio
,
57 struct platform_device s3c64xx_device_iis0
= {
58 .name
= "samsung-i2s",
60 .num_resources
= ARRAY_SIZE(s3c64xx_iis0_resource
),
61 .resource
= s3c64xx_iis0_resource
,
63 .platform_data
= &i2s0_pdata
,
66 EXPORT_SYMBOL(s3c64xx_device_iis0
);
68 static struct resource s3c64xx_iis1_resource
[] = {
69 [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS1
, SZ_256
),
72 static struct s3c_audio_pdata i2s1_pdata
= {
73 .cfg_gpio
= s3c64xx_i2s_cfg_gpio
,
76 struct platform_device s3c64xx_device_iis1
= {
77 .name
= "samsung-i2s",
79 .num_resources
= ARRAY_SIZE(s3c64xx_iis1_resource
),
80 .resource
= s3c64xx_iis1_resource
,
82 .platform_data
= &i2s1_pdata
,
85 EXPORT_SYMBOL(s3c64xx_device_iis1
);