drm/nouveau: consume the return of large GSP message
[drm/drm-misc.git] / arch / arm / mach-s3c / dev-audio-s3c64xx.c
blob7ce119dc3a72170c70570a532288f594f3768d69
1 // SPDX-License-Identifier: GPL-2.0
2 //
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>
13 #include "irqs.h"
14 #include "map.h"
16 #include "devs.h"
17 #include <linux/platform_data/asoc-s3c.h>
18 #include "gpio-cfg.h"
19 #include "gpio-samsung.h"
21 static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
23 unsigned int base;
25 switch (pdev->id) {
26 case 0:
27 base = S3C64XX_GPD(0);
28 break;
29 case 1:
30 base = S3C64XX_GPE(0);
31 break;
32 case 2:
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));
37 return 0;
38 default:
39 printk(KERN_DEBUG "Invalid I2S Controller number: %d\n",
40 pdev->id);
41 return -EINVAL;
44 s3c_gpio_cfgpin_range(base, 5, S3C_GPIO_SFN(3));
46 return 0;
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",
59 .id = 0,
60 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
61 .resource = s3c64xx_iis0_resource,
62 .dev = {
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",
78 .id = 1,
79 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
80 .resource = s3c64xx_iis1_resource,
81 .dev = {
82 .platform_data = &i2s1_pdata,
85 EXPORT_SYMBOL(s3c64xx_device_iis1);