Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28c8331d authored by Tomasz Figa's avatar Tomasz Figa Committed by Kukjin Kim
Browse files

ARM: S5PV210: Remove support for board files



Since all in-tree boards have been moved to device tree, we can now drop
legacy code and make mach-s5pv210 DT-only. This patch does it.

Signed-off-by: default avatarTomasz Figa <t.figa@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent b672b27d
Loading
Loading
Loading
Loading
+0 −173
Original line number Diff line number Diff line
@@ -19,181 +19,8 @@ config CPU_S5PV210
	help
	  Enable S5PV210 CPU support

config S5PV210_SETUP_I2C1
	bool
	help
	  Common setup code for i2c bus 1.

config S5PV210_SETUP_I2C2
	bool
	help
	  Common setup code for i2c bus 2.

config S5PV210_SETUP_IDE
	bool
	help
	  Common setup code for S5PV210 IDE GPIO configurations

config S5PV210_SETUP_FB_24BPP
	bool
	help
          Common setup code for S5PV210 with an 24bpp RGB display helper.

config S5PV210_SETUP_KEYPAD
	bool
	help
	  Common setup code for keypad.

config S5PV210_SETUP_SDHCI
        bool
        select S5PV210_SETUP_SDHCI_GPIO
        help
          Internal helper functions for S5PV210 based SDHCI systems

config S5PV210_SETUP_SDHCI_GPIO
	bool
	help
	  Common setup code for SDHCI gpio.

config S5PV210_SETUP_FIMC
	bool
	help
	  Common setup code for the camera interfaces.

config S5PV210_SETUP_SPI
	bool
	help
	  Common setup code for SPI GPIO configurations.

config S5PV210_SETUP_USB_PHY
	bool
	help
	  Common setup code for USB PHY controller

menu "S5PC110 Machines"

config MACH_AQUILA
	bool "Aquila"
	select CPU_S5PV210
	select S3C_DEV_FB
	select S3C_DEV_HSMMC
	select S3C_DEV_HSMMC1
	select S3C_DEV_HSMMC2
	select S5PV210_SETUP_FB_24BPP
	select S5PV210_SETUP_SDHCI
	select S5PV210_SETUP_USB_PHY
	select S5P_DEV_FIMC0
	select S5P_DEV_FIMC1
	select S5P_DEV_FIMC2
	select S5P_DEV_ONENAND
	help
	  Machine support for the Samsung Aquila target based on S5PC110 SoC

config MACH_GONI
	bool "GONI"
	select CPU_S5PV210
	select S3C_DEV_FB
	select S3C_DEV_HSMMC
	select S3C_DEV_HSMMC1
	select S3C_DEV_HSMMC2
	select S3C_DEV_I2C1
	select S3C_DEV_I2C2
	select S3C_DEV_USB_HSOTG
	select S5PV210_SETUP_FB_24BPP
	select S5PV210_SETUP_FIMC
	select S5PV210_SETUP_I2C1
	select S5PV210_SETUP_I2C2
	select S5PV210_SETUP_KEYPAD
	select S5PV210_SETUP_SDHCI
	select S5PV210_SETUP_USB_PHY
	select S5P_DEV_FIMC0
	select S5P_DEV_FIMC1
	select S5P_DEV_FIMC2
	select S5P_DEV_MFC
	select S5P_DEV_ONENAND
	select S5P_DEV_TV
	select S5P_GPIO_INT
	select SAMSUNG_DEV_KEYPAD
	help
	  Machine support for Samsung GONI board
	  S5PC110(MCP) is one of package option of S5PV210

config MACH_SMDKC110
	bool "SMDKC110"
	select CPU_S5PV210
	select S3C_DEV_I2C1
	select S3C_DEV_I2C2
	select S3C_DEV_RTC
	select S3C_DEV_WDT
	select S5PV210_SETUP_I2C1
	select S5PV210_SETUP_I2C2
	select S5PV210_SETUP_IDE
	select S5P_DEV_FIMC0
	select S5P_DEV_FIMC1
	select S5P_DEV_FIMC2
	select S5P_DEV_MFC
	select SAMSUNG_DEV_IDE
	help
	  Machine support for Samsung SMDKC110
	  S5PC110(MCP) is one of package option of S5PV210

endmenu

menu "S5PV210 Machines"

config MACH_SMDKV210
	bool "SMDKV210"
	select CPU_S5PV210
	select S3C_DEV_FB
	select S3C_DEV_HSMMC
	select S3C_DEV_HSMMC1
	select S3C_DEV_HSMMC2
	select S3C_DEV_HSMMC3
	select S3C_DEV_I2C1
	select S3C_DEV_I2C2
	select S3C_DEV_RTC
	select S3C_DEV_USB_HSOTG
	select S3C_DEV_WDT
	select S5PV210_SETUP_FB_24BPP
	select S5PV210_SETUP_I2C1
	select S5PV210_SETUP_I2C2
	select S5PV210_SETUP_IDE
	select S5PV210_SETUP_KEYPAD
	select S5PV210_SETUP_SDHCI
	select S5PV210_SETUP_USB_PHY
	select S5P_DEV_FIMC0
	select S5P_DEV_FIMC1
	select S5P_DEV_FIMC2
	select S5P_DEV_JPEG
	select S5P_DEV_MFC
	select SAMSUNG_DEV_ADC
	select SAMSUNG_DEV_BACKLIGHT
	select SAMSUNG_DEV_IDE
	select SAMSUNG_DEV_KEYPAD
	select SAMSUNG_DEV_PWM
	select SAMSUNG_DEV_TS
	help
	  Machine support for Samsung SMDKV210

config MACH_TORBRECK
	bool "Torbreck"
	select ARCH_SPARSEMEM_ENABLE
	select CPU_S5PV210
	select S3C_DEV_HSMMC
	select S3C_DEV_HSMMC1
	select S3C_DEV_HSMMC2
	select S3C_DEV_HSMMC3
	select S3C_DEV_I2C1
	select S3C_DEV_I2C2
	select S3C_DEV_RTC
	select S3C_DEV_WDT
	select S5PV210_SETUP_I2C1
	select S5PV210_SETUP_I2C2
	select S5PV210_SETUP_SDHCI
	select SAMSUNG_DEV_IDE
	help
	  Machine support for aESOP Torbreck

config MACH_S5PV210_DT
	bool "Samsung S5PV210/S5PC110 machine using Device Tree"
	select CLKSRC_OF
+0 −19
Original line number Diff line number Diff line
@@ -12,30 +12,11 @@ obj- :=

# Core

obj-y				+= common.o
obj-$(CONFIG_PM)		+= pm.o

obj-y				+= dma.o

# machine support

obj-$(CONFIG_MACH_AQUILA)	+= mach-aquila.o
obj-$(CONFIG_MACH_GONI)		+= mach-goni.o
obj-$(CONFIG_MACH_SMDKC110)	+= mach-smdkc110.o
obj-$(CONFIG_MACH_SMDKV210)	+= mach-smdkv210.o
obj-$(CONFIG_MACH_TORBRECK)	+= mach-torbreck.o
obj-$(CONFIG_MACH_S5PV210_DT)	+= s5pv210.o
# device support

obj-y				+= dev-audio.o

obj-y					+= setup-i2c0.o
obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
obj-$(CONFIG_S5PV210_SETUP_FIMC)	+= setup-fimc.o
obj-$(CONFIG_S5PV210_SETUP_I2C1)	+= setup-i2c1.o
obj-$(CONFIG_S5PV210_SETUP_I2C2)	+= setup-i2c2.o
obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
obj-$(CONFIG_S5PV210_SETUP_SPI)		+= setup-spi.o
obj-$(CONFIG_S5PV210_SETUP_USB_PHY) += setup-usb-phy.o

arch/arm/mach-s5pv210/common.c

deleted100644 → 0
+0 −281
Original line number Diff line number Diff line
/*
 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com
 *
 * Common Codes for S5PV210
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/device.h>
#include <clocksource/samsung_pwm.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
#include <linux/serial_core.h>
#include <linux/serial_s3c.h>
#include <linux/of.h>

#include <asm/proc-fns.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include <mach/map.h>
#include <mach/regs-clock.h>

#include <plat/cpu.h>

#include <plat/devs.h>
#include <plat/sdhci.h>
#include <plat/adc-core.h>
#include <plat/ata-core.h>
#include <plat/fb-core.h>
#include <plat/fimc-core.h>
#include <plat/iic-core.h>
#include <plat/keypad-core.h>
#include <plat/pwm-core.h>
#include <plat/tv-core.h>
#include <plat/spi-core.h>

#include "common.h"

/* External clock frequency */
static unsigned long xusbxti_f;

static const char name_s5pv210[] = "S5PV210/S5PC110";

static struct cpu_table cpu_ids[] __initdata = {
	{
		.idcode		= S5PV210_CPU_ID,
		.idmask		= S5PV210_CPU_MASK,
		.map_io		= s5pv210_map_io,
		.init_clocks	= s5pv210_init_clocks,
		.init_uarts	= s5pv210_init_uarts,
		.init		= s5pv210_init,
		.name		= name_s5pv210,
	},
};

/* Initial IO mappings */

static struct map_desc s5pv210_iodesc[] __initdata = {
	{
		.virtual	= (unsigned long)S5P_VA_CHIPID,
		.pfn		= __phys_to_pfn(S5PV210_PA_CHIPID),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S3C_VA_SYS,
		.pfn		= __phys_to_pfn(S5PV210_PA_SYSCON),
		.length		= SZ_64K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S3C_VA_TIMER,
		.pfn		= __phys_to_pfn(S5PV210_PA_TIMER),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S3C_VA_WATCHDOG,
		.pfn		= __phys_to_pfn(S5PV210_PA_WATCHDOG),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S5P_VA_SROMC,
		.pfn		= __phys_to_pfn(S5PV210_PA_SROMC),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S5P_VA_SYSTIMER,
		.pfn		= __phys_to_pfn(S5PV210_PA_SYSTIMER),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S5P_VA_GPIO,
		.pfn		= __phys_to_pfn(S5PV210_PA_GPIO),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC0,
		.pfn		= __phys_to_pfn(S5PV210_PA_VIC0),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC1,
		.pfn		= __phys_to_pfn(S5PV210_PA_VIC1),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC2,
		.pfn		= __phys_to_pfn(S5PV210_PA_VIC2),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC3,
		.pfn		= __phys_to_pfn(S5PV210_PA_VIC3),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S3C_VA_UART,
		.pfn		= __phys_to_pfn(S3C_PA_UART),
		.length		= SZ_512K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S5P_VA_DMC0,
		.pfn		= __phys_to_pfn(S5PV210_PA_DMC0),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S5P_VA_DMC1,
		.pfn		= __phys_to_pfn(S5PV210_PA_DMC1),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)S3C_VA_USB_HSPHY,
		.pfn		=__phys_to_pfn(S5PV210_PA_HSPHY),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}
};

void s5pv210_restart(enum reboot_mode mode, const char *cmd)
{
	__raw_writel(0x1, S5P_SWRESET);
}

static struct samsung_pwm_variant s5pv210_pwm_variant = {
	.bits		= 32,
	.div_base	= 0,
	.has_tint_cstat	= true,
	.tclk_mask	= (1 << 5),
};

void __init samsung_set_timer_source(unsigned int event, unsigned int source)
{
	s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
	s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
}

void __init samsung_timer_init(void)
{
	unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
		IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
		IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
	};

	samsung_pwm_clocksource_init(S3C_VA_TIMER,
					timer_irqs, &s5pv210_pwm_variant);
}

/*
 * s5pv210_map_io
 *
 * register the standard cpu IO areas
 */

void __init s5pv210_init_io(struct map_desc *mach_desc, int size)
{
	/* initialize the io descriptors we need for initialization */
	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
	if (mach_desc)
		iotable_init(mach_desc, size);

	/* detect cpu id and rev. */
	s5p_init_cpu(S5P_VA_CHIPID);

	s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));

	samsung_pwm_set_platdata(&s5pv210_pwm_variant);
}

void __init s5pv210_map_io(void)
{
	/* initialise device information early */
	s5pv210_default_sdhci0();
	s5pv210_default_sdhci1();
	s5pv210_default_sdhci2();
	s5pv210_default_sdhci3();

	s3c_adc_setname("samsung-adc-v3");

	s3c_cfcon_setname("s5pv210-pata");

	s3c_fimc_setname(0, "s5pv210-fimc");
	s3c_fimc_setname(1, "s5pv210-fimc");
	s3c_fimc_setname(2, "s5pv210-fimc");

	/* the i2c devices are directly compatible with s3c2440 */
	s3c_i2c0_setname("s3c2440-i2c");
	s3c_i2c1_setname("s3c2440-i2c");
	s3c_i2c2_setname("s3c2440-i2c");

	s3c_fb_setname("s5pv210-fb");

	/* Use s5pv210-keypad instead of samsung-keypad */
	samsung_keypad_setname("s5pv210-keypad");

	/* setup TV devices */
	s5p_hdmi_setname("s5pv210-hdmi");

	s3c64xx_spi_setname("s5pv210-spi");
}

void __init s5pv210_init_clocks(int xtal)
{
	xusbxti_f = xtal;
}

void __init s5pv210_init_irq(void)
{
	u32 vic[4];	/* S5PV210 supports 4 VIC */

	s5pv210_clk_init(0, xusbxti_f, S3C_VA_SYS);

	/* All the VICs are fully populated. */
	vic[0] = ~0;
	vic[1] = ~0;
	vic[2] = ~0;
	vic[3] = ~0;

	s5p_init_irq(vic, ARRAY_SIZE(vic));
}

struct bus_type s5pv210_subsys = {
	.name		= "s5pv210-core",
	.dev_name	= "s5pv210-core",
};

static struct device s5pv210_dev = {
	.bus	= &s5pv210_subsys,
};

static int __init s5pv210_core_init(void)
{
	return subsys_system_register(&s5pv210_subsys, NULL);
}
core_initcall(s5pv210_core_init);

int __init s5pv210_init(void)
{
	printk(KERN_INFO "S5PV210: Initializing architecture\n");
	return device_register(&s5pv210_dev);
}

/* uart registration process */

void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
}
+0 −17
Original line number Diff line number Diff line
@@ -12,22 +12,5 @@
#ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H
#define __ARCH_ARM_MACH_S5PV210_COMMON_H

#include <linux/reboot.h>

void s5pv210_clk_init(unsigned long xxti_f, unsigned long xusbxti_f,
		      void __iomem *reg_base);

void s5pv210_init_io(struct map_desc *mach_desc, int size);
void s5pv210_init_irq(void);

void s5pv210_register_clocks(void);
void s5pv210_setup_clocks(void);

void s5pv210_restart(enum reboot_mode mode, const char *cmd);

extern  int s5pv210_init(void);
extern void s5pv210_map_io(void);
extern void s5pv210_init_clocks(int xtal);
extern void s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no);

#endif /* __ARCH_ARM_MACH_S5PV210_COMMON_H */

arch/arm/mach-s5pv210/dev-audio.c

deleted100644 → 0
+0 −246
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5pv210/dev-audio.c
 *
 * Copyright (c) 2010 Samsung Electronics Co. Ltd
 *	Jaswinder Singh <jassi.brar@samsung.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>

#include <plat/gpio-cfg.h>
#include <linux/platform_data/asoc-s3c.h>

#include <mach/map.h>
#include <mach/dma.h>
#include <mach/irqs.h>

#define S5PV210_AUDSS_INT_MEM	(0xC0000000)

static int s5pv210_cfg_i2s(struct platform_device *pdev)
{
	/* configure GPIO for i2s port */
	switch (pdev->id) {
	case 0:
		s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2));
		break;
	case 1:
		s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2));
		break;
	case 2:
		s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4));
		break;
	default:
		printk(KERN_ERR "Invalid Device %d\n", pdev->id);
		return -EINVAL;
	}

	return 0;
}

static struct s3c_audio_pdata i2sv5_pdata = {
	.cfg_gpio = s5pv210_cfg_i2s,
	.type = {
		.i2s = {
			.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
					 | QUIRK_NEED_RSTCLR,
			.idma_addr = S5PV210_AUDSS_INT_MEM,
		},
	},
};

static struct resource s5pv210_iis0_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_IIS0, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_I2S0_TX),
	[2] = DEFINE_RES_DMA(DMACH_I2S0_RX),
	[3] = DEFINE_RES_DMA(DMACH_I2S0S_TX),
};

struct platform_device s5pv210_device_iis0 = {
	.name = "samsung-i2s",
	.id = 0,
	.num_resources	  = ARRAY_SIZE(s5pv210_iis0_resource),
	.resource	  = s5pv210_iis0_resource,
	.dev = {
		.platform_data = &i2sv5_pdata,
	},
};

static struct s3c_audio_pdata i2sv3_pdata = {
	.cfg_gpio = s5pv210_cfg_i2s,
};

static struct resource s5pv210_iis1_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_IIS1, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_I2S1_TX),
	[2] = DEFINE_RES_DMA(DMACH_I2S1_RX),
};

struct platform_device s5pv210_device_iis1 = {
	.name		  = "samsung-i2s",
	.id		  = 1,
	.num_resources	  = ARRAY_SIZE(s5pv210_iis1_resource),
	.resource	  = s5pv210_iis1_resource,
	.dev = {
		.platform_data = &i2sv3_pdata,
	},
};

static struct resource s5pv210_iis2_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_IIS2, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_I2S2_TX),
	[2] = DEFINE_RES_DMA(DMACH_I2S2_RX),
};

struct platform_device s5pv210_device_iis2 = {
	.name		  = "samsung-i2s",
	.id		  = 2,
	.num_resources	  = ARRAY_SIZE(s5pv210_iis2_resource),
	.resource	  = s5pv210_iis2_resource,
	.dev = {
		.platform_data = &i2sv3_pdata,
	},
};

/* PCM Controller platform_devices */

static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev)
{
	switch (pdev->id) {
	case 0:
		s3c_gpio_cfgpin_range(S5PV210_GPI(0), 5, S3C_GPIO_SFN(3));
		break;
	case 1:
		s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(3));
		break;
	case 2:
		s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(2));
		break;
	default:
		printk(KERN_DEBUG "Invalid PCM Controller number!");
		return -EINVAL;
	}

	return 0;
}

static struct s3c_audio_pdata s3c_pcm_pdata = {
	.cfg_gpio = s5pv210_pcm_cfg_gpio,
};

static struct resource s5pv210_pcm0_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_PCM0, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_PCM0_TX),
	[2] = DEFINE_RES_DMA(DMACH_PCM0_RX),
};

struct platform_device s5pv210_device_pcm0 = {
	.name		  = "samsung-pcm",
	.id		  = 0,
	.num_resources	  = ARRAY_SIZE(s5pv210_pcm0_resource),
	.resource	  = s5pv210_pcm0_resource,
	.dev = {
		.platform_data = &s3c_pcm_pdata,
	},
};

static struct resource s5pv210_pcm1_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_PCM1, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_PCM1_TX),
	[2] = DEFINE_RES_DMA(DMACH_PCM1_RX),
};

struct platform_device s5pv210_device_pcm1 = {
	.name		  = "samsung-pcm",
	.id		  = 1,
	.num_resources	  = ARRAY_SIZE(s5pv210_pcm1_resource),
	.resource	  = s5pv210_pcm1_resource,
	.dev = {
		.platform_data = &s3c_pcm_pdata,
	},
};

static struct resource s5pv210_pcm2_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_PCM2, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_PCM2_TX),
	[2] = DEFINE_RES_DMA(DMACH_PCM2_RX),
};

struct platform_device s5pv210_device_pcm2 = {
	.name		  = "samsung-pcm",
	.id		  = 2,
	.num_resources	  = ARRAY_SIZE(s5pv210_pcm2_resource),
	.resource	  = s5pv210_pcm2_resource,
	.dev = {
		.platform_data = &s3c_pcm_pdata,
	},
};

/* AC97 Controller platform devices */

static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev)
{
	return s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(4));
}

static struct resource s5pv210_ac97_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_AC97, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_AC97_PCMOUT),
	[2] = DEFINE_RES_DMA(DMACH_AC97_PCMIN),
	[3] = DEFINE_RES_DMA(DMACH_AC97_MICIN),
	[4] = DEFINE_RES_IRQ(IRQ_AC97),
};

static struct s3c_audio_pdata s3c_ac97_pdata = {
	.cfg_gpio = s5pv210_ac97_cfg_gpio,
};

static u64 s5pv210_ac97_dmamask = DMA_BIT_MASK(32);

struct platform_device s5pv210_device_ac97 = {
	.name		  = "samsung-ac97",
	.id		  = -1,
	.num_resources	  = ARRAY_SIZE(s5pv210_ac97_resource),
	.resource	  = s5pv210_ac97_resource,
	.dev = {
		.platform_data = &s3c_ac97_pdata,
		.dma_mask = &s5pv210_ac97_dmamask,
		.coherent_dma_mask = DMA_BIT_MASK(32),
	},
};

/* S/PDIF Controller platform_device */

static int s5pv210_spdif_cfg_gpio(struct platform_device *pdev)
{
	s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 2, S3C_GPIO_SFN(3));

	return 0;
}

static struct resource s5pv210_spdif_resource[] = {
	[0] = DEFINE_RES_MEM(S5PV210_PA_SPDIF, SZ_256),
	[1] = DEFINE_RES_DMA(DMACH_SPDIF),
};

static struct s3c_audio_pdata samsung_spdif_pdata = {
	.cfg_gpio = s5pv210_spdif_cfg_gpio,
};

static u64 s5pv210_spdif_dmamask = DMA_BIT_MASK(32);

struct platform_device s5pv210_device_spdif = {
	.name		= "samsung-spdif",
	.id		= -1,
	.num_resources	= ARRAY_SIZE(s5pv210_spdif_resource),
	.resource	= s5pv210_spdif_resource,
	.dev = {
		.platform_data = &samsung_spdif_pdata,
		.dma_mask = &s5pv210_spdif_dmamask,
		.coherent_dma_mask = DMA_BIT_MASK(32),
	},
};
Loading