^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) // Copyright (c) 2011 Samsung Electronics Co., Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) // http://www.samsung.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) // Base Samsung platform device definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/timer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/serial_core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/serial_s3c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/dma-mapping.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/gfp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/mtd/mtd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/mtd/onenand.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/mtd/partitions.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/mmc/host.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/ioport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/sizes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/platform_data/s3c-hsudc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include <linux/platform_data/s3c-hsotg.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include <linux/platform_data/dma-s3c24xx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #include <linux/platform_data/media/s5p_hdmi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #include <asm/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #include <asm/mach/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <mach/irqs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #include "map.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #include "gpio-samsung.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #include "gpio-cfg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #include "regs-s3c2443-clock.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #include "cpu.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #include "devs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #include <linux/soc/samsung/s3c-adc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #include <linux/platform_data/ata-samsung_cf.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #include "fb.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #include <linux/platform_data/fb-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #include <linux/platform_data/hwmon-s3c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #include <linux/platform_data/i2c-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #include "keypad.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #include <linux/platform_data/mmc-s3cmci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #include <linux/platform_data/mtd-nand-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #include "pwm-core.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #include "sdhci.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #include <linux/platform_data/touchscreen-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #include <linux/platform_data/usb-s3c2410_udc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #include <linux/platform_data/usb-ohci-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #include "usb-phy.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #include <linux/platform_data/asoc-s3c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #include <linux/platform_data/spi-s3c64xx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #define samsung_device_dma_mask (*((u64[]) { DMA_BIT_MASK(32) }))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) /* AC97 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #ifdef CONFIG_CPU_S3C2440
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) static struct resource s3c_ac97_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) [0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) struct platform_device s3c_device_ac97 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) .name = "samsung-ac97",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) .num_resources = ARRAY_SIZE(s3c_ac97_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .resource = s3c_ac97_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) #endif /* CONFIG_CPU_S3C2440 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) /* ADC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) static struct resource s3c_adc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) [1] = DEFINE_RES_IRQ(IRQ_TC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) [2] = DEFINE_RES_IRQ(IRQ_ADC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) struct platform_device s3c_device_adc = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) .name = "s3c24xx-adc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) .num_resources = ARRAY_SIZE(s3c_adc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) .resource = s3c_adc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #if defined(CONFIG_SAMSUNG_DEV_ADC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) static struct resource s3c_adc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) [1] = DEFINE_RES_IRQ(IRQ_ADC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) [2] = DEFINE_RES_IRQ(IRQ_TC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) struct platform_device s3c_device_adc = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) .name = "exynos-adc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) .num_resources = ARRAY_SIZE(s3c_adc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) .resource = s3c_adc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #endif /* CONFIG_SAMSUNG_DEV_ADC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* Camif Controller */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #ifdef CONFIG_CPU_S3C2440
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static struct resource s3c_camif_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) [0] = DEFINE_RES_MEM(S3C2440_PA_CAMIF, S3C2440_SZ_CAMIF),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) [1] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_C),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) [2] = DEFINE_RES_IRQ(IRQ_S3C2440_CAM_P),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) struct platform_device s3c_device_camif = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) .name = "s3c2440-camif",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) .num_resources = ARRAY_SIZE(s3c_camif_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) .resource = s3c_camif_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #endif /* CONFIG_CPU_S3C2440 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /* FB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #ifdef CONFIG_S3C_DEV_FB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) static struct resource s3c_fb_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) [0] = DEFINE_RES_MEM(S3C_PA_FB, SZ_16K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) [1] = DEFINE_RES_IRQ(IRQ_LCD_VSYNC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) [2] = DEFINE_RES_IRQ(IRQ_LCD_FIFO),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) [3] = DEFINE_RES_IRQ(IRQ_LCD_SYSTEM),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) struct platform_device s3c_device_fb = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) .name = "s3c-fb",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) .num_resources = ARRAY_SIZE(s3c_fb_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) .resource = s3c_fb_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) &s3c_device_fb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #endif /* CONFIG_S3C_DEV_FB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) /* HWMON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #ifdef CONFIG_S3C_DEV_HWMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) struct platform_device s3c_device_hwmon = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) .name = "s3c-hwmon",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) .dev.parent = &s3c_device_adc.dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) s3c_set_platdata(pd, sizeof(struct s3c_hwmon_pdata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) &s3c_device_hwmon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #endif /* CONFIG_S3C_DEV_HWMON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) /* HSMMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #ifdef CONFIG_S3C_DEV_HSMMC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) static struct resource s3c_hsmmc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) [0] = DEFINE_RES_MEM(S3C_PA_HSMMC0, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) [1] = DEFINE_RES_IRQ(IRQ_HSMMC0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) .max_width = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) .host_caps = (MMC_CAP_4_BIT_DATA |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) struct platform_device s3c_device_hsmmc0 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) .name = "s3c-sdhci",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) .resource = s3c_hsmmc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) .platform_data = &s3c_hsmmc0_def_platdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #endif /* CONFIG_S3C_DEV_HSMMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #ifdef CONFIG_S3C_DEV_HSMMC1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static struct resource s3c_hsmmc1_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) [0] = DEFINE_RES_MEM(S3C_PA_HSMMC1, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) [1] = DEFINE_RES_IRQ(IRQ_HSMMC1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) .max_width = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) .host_caps = (MMC_CAP_4_BIT_DATA |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) struct platform_device s3c_device_hsmmc1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) .name = "s3c-sdhci",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) .id = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) .num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) .resource = s3c_hsmmc1_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) .platform_data = &s3c_hsmmc1_def_platdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) #endif /* CONFIG_S3C_DEV_HSMMC1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) /* HSMMC2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #ifdef CONFIG_S3C_DEV_HSMMC2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) static struct resource s3c_hsmmc2_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) [0] = DEFINE_RES_MEM(S3C_PA_HSMMC2, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) [1] = DEFINE_RES_IRQ(IRQ_HSMMC2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) .max_width = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) .host_caps = (MMC_CAP_4_BIT_DATA |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) struct platform_device s3c_device_hsmmc2 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) .name = "s3c-sdhci",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) .id = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) .resource = s3c_hsmmc2_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) .platform_data = &s3c_hsmmc2_def_platdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) #endif /* CONFIG_S3C_DEV_HSMMC2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #ifdef CONFIG_S3C_DEV_HSMMC3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) static struct resource s3c_hsmmc3_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) [0] = DEFINE_RES_MEM(S3C_PA_HSMMC3, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) [1] = DEFINE_RES_IRQ(IRQ_HSMMC3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) .max_width = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) .host_caps = (MMC_CAP_4_BIT_DATA |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) struct platform_device s3c_device_hsmmc3 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) .name = "s3c-sdhci",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) .id = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) .num_resources = ARRAY_SIZE(s3c_hsmmc3_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) .resource = s3c_hsmmc3_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) .platform_data = &s3c_hsmmc3_def_platdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) #endif /* CONFIG_S3C_DEV_HSMMC3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) /* I2C */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) static struct resource s3c_i2c0_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) [0] = DEFINE_RES_MEM(S3C_PA_IIC, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) [1] = DEFINE_RES_IRQ(IRQ_IIC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) struct platform_device s3c_device_i2c0 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) .name = "s3c2410-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) .num_resources = ARRAY_SIZE(s3c_i2c0_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) .resource = s3c_i2c0_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) struct s3c2410_platform_i2c default_i2c_data __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) .flags = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) .slave_addr = 0x10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) .frequency = 100*1000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) .sda_delay = 100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) pd->bus_num = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) npd->cfg_gpio = s3c_i2c0_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) #ifdef CONFIG_S3C_DEV_I2C1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) static struct resource s3c_i2c1_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) [0] = DEFINE_RES_MEM(S3C_PA_IIC1, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) [1] = DEFINE_RES_IRQ(IRQ_IIC1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) struct platform_device s3c_device_i2c1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) .name = "s3c2410-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) .id = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) .num_resources = ARRAY_SIZE(s3c_i2c1_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) .resource = s3c_i2c1_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) pd->bus_num = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) npd->cfg_gpio = s3c_i2c1_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #endif /* CONFIG_S3C_DEV_I2C1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) #ifdef CONFIG_S3C_DEV_I2C2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) static struct resource s3c_i2c2_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) [0] = DEFINE_RES_MEM(S3C_PA_IIC2, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) [1] = DEFINE_RES_IRQ(IRQ_IIC2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) struct platform_device s3c_device_i2c2 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) .name = "s3c2410-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) .id = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) .num_resources = ARRAY_SIZE(s3c_i2c2_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) .resource = s3c_i2c2_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) pd->bus_num = 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) npd->cfg_gpio = s3c_i2c2_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) #endif /* CONFIG_S3C_DEV_I2C2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) #ifdef CONFIG_S3C_DEV_I2C3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) static struct resource s3c_i2c3_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) [0] = DEFINE_RES_MEM(S3C_PA_IIC3, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) [1] = DEFINE_RES_IRQ(IRQ_IIC3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) struct platform_device s3c_device_i2c3 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) .name = "s3c2440-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) .id = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) .num_resources = ARRAY_SIZE(s3c_i2c3_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) .resource = s3c_i2c3_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) pd->bus_num = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) npd->cfg_gpio = s3c_i2c3_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) #endif /*CONFIG_S3C_DEV_I2C3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) #ifdef CONFIG_S3C_DEV_I2C4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) static struct resource s3c_i2c4_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) [0] = DEFINE_RES_MEM(S3C_PA_IIC4, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) [1] = DEFINE_RES_IRQ(IRQ_IIC4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) struct platform_device s3c_device_i2c4 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) .name = "s3c2440-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) .id = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) .num_resources = ARRAY_SIZE(s3c_i2c4_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) .resource = s3c_i2c4_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) pd->bus_num = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) npd->cfg_gpio = s3c_i2c4_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) #endif /*CONFIG_S3C_DEV_I2C4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) #ifdef CONFIG_S3C_DEV_I2C5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) static struct resource s3c_i2c5_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) [0] = DEFINE_RES_MEM(S3C_PA_IIC5, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) [1] = DEFINE_RES_IRQ(IRQ_IIC5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) struct platform_device s3c_device_i2c5 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) .name = "s3c2440-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) .id = 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) .num_resources = ARRAY_SIZE(s3c_i2c5_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) .resource = s3c_i2c5_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) pd->bus_num = 5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c5);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) npd->cfg_gpio = s3c_i2c5_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) #endif /*CONFIG_S3C_DEV_I2C5 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) #ifdef CONFIG_S3C_DEV_I2C6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) static struct resource s3c_i2c6_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) [0] = DEFINE_RES_MEM(S3C_PA_IIC6, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) [1] = DEFINE_RES_IRQ(IRQ_IIC6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) struct platform_device s3c_device_i2c6 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) .name = "s3c2440-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) .id = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) .num_resources = ARRAY_SIZE(s3c_i2c6_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) .resource = s3c_i2c6_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) pd->bus_num = 6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) npd->cfg_gpio = s3c_i2c6_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) #endif /* CONFIG_S3C_DEV_I2C6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) #ifdef CONFIG_S3C_DEV_I2C7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) static struct resource s3c_i2c7_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) [0] = DEFINE_RES_MEM(S3C_PA_IIC7, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) [1] = DEFINE_RES_IRQ(IRQ_IIC7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) struct platform_device s3c_device_i2c7 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) .name = "s3c2440-i2c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) .id = 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) .num_resources = ARRAY_SIZE(s3c_i2c7_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) .resource = s3c_i2c7_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) struct s3c2410_platform_i2c *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) if (!pd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) pd = &default_i2c_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) pd->bus_num = 7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c7);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) npd->cfg_gpio = s3c_i2c7_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) #endif /* CONFIG_S3C_DEV_I2C7 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) /* I2S */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) static struct resource s3c_iis_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) struct platform_device s3c_device_iis = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) .name = "s3c24xx-iis",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) .num_resources = ARRAY_SIZE(s3c_iis_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) .resource = s3c_iis_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) /* IDE CFCON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) #ifdef CONFIG_SAMSUNG_DEV_IDE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) static struct resource s3c_cfcon_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) [0] = DEFINE_RES_MEM(SAMSUNG_PA_CFCON, SZ_16K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) [1] = DEFINE_RES_IRQ(IRQ_CFCON),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) struct platform_device s3c_device_cfcon = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) .num_resources = ARRAY_SIZE(s3c_cfcon_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) .resource = s3c_cfcon_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) void __init s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) s3c_set_platdata(pdata, sizeof(struct s3c_ide_platdata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) &s3c_device_cfcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) #endif /* CONFIG_SAMSUNG_DEV_IDE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) /* KEYPAD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) static struct resource samsung_keypad_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD, SZ_32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) [1] = DEFINE_RES_IRQ(IRQ_KEYPAD),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) struct platform_device samsung_device_keypad = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) .name = "samsung-keypad",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) .num_resources = ARRAY_SIZE(samsung_keypad_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) .resource = samsung_keypad_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) struct samsung_keypad_platdata *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) npd = s3c_set_platdata(pd, sizeof(*npd), &samsung_device_keypad);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) if (!npd->cfg_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) npd->cfg_gpio = samsung_keypad_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) #endif /* CONFIG_SAMSUNG_DEV_KEYPAD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) /* LCD Controller */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) static struct resource s3c_lcd_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) [0] = DEFINE_RES_MEM(S3C24XX_PA_LCD, S3C24XX_SZ_LCD),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) [1] = DEFINE_RES_IRQ(IRQ_LCD),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) struct platform_device s3c_device_lcd = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) .name = "s3c2410-lcd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) .num_resources = ARRAY_SIZE(s3c_lcd_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) .resource = s3c_lcd_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) struct s3c2410fb_mach_info *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) if (npd) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) npd->displays = kmemdup(pd->displays,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) sizeof(struct s3c2410fb_display) * npd->num_displays,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) if (!npd->displays)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) printk(KERN_ERR "no memory for LCD display data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) printk(KERN_ERR "no memory for LCD platform data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) /* NAND */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) #ifdef CONFIG_S3C_DEV_NAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) static struct resource s3c_nand_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) [0] = DEFINE_RES_MEM(S3C_PA_NAND, SZ_1M),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) struct platform_device s3c_device_nand = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) .name = "s3c2410-nand",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) .num_resources = ARRAY_SIZE(s3c_nand_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) .resource = s3c_nand_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) * s3c_nand_copy_set() - copy nand set data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) * @set: The new structure, directly copied from the old.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) * Copy all the fields from the NAND set field from what is probably __initdata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) * to new kernel memory. The code returns 0 if the copy happened correctly or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) * an error code for the calling function to display.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) * Note, we currently do not try and look to see if we've already copied the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) * data in a previous set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) void *ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) int size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) size = sizeof(struct mtd_partition) * set->nr_partitions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) if (size) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) ptr = kmemdup(set->partitions, size, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) set->partitions = ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) if (!ptr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) if (set->nr_map && set->nr_chips) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) size = sizeof(int) * set->nr_chips;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) set->nr_map = ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) if (!ptr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) struct s3c2410_platform_nand *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) int size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) /* note, if we get a failure in allocation, we simply drop out of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) * function. If there is so little memory available at initialisation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) * time then there is little chance the system is going to run.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) npd = s3c_set_platdata(nand, sizeof(*npd), &s3c_device_nand);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) if (!npd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) /* now see if we need to copy any of the nand set data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) if (size) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) struct s3c2410_nand_set *from = npd->sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) struct s3c2410_nand_set *to;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) to = kmemdup(from, size, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) npd->sets = to; /* set, even if we failed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) if (!to) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) printk(KERN_ERR "%s: no memory for sets\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) for (i = 0; i < npd->nr_sets; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) ret = s3c_nand_copy_set(to);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) if (ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) printk(KERN_ERR "%s: failed to copy set %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) __func__, i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) to++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) #endif /* CONFIG_S3C_DEV_NAND */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) /* ONENAND */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) #ifdef CONFIG_S3C_DEV_ONENAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) static struct resource s3c_onenand_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) [0] = DEFINE_RES_MEM(S3C_PA_ONENAND, SZ_1K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) [1] = DEFINE_RES_MEM(S3C_PA_ONENAND_BUF, S3C_SZ_ONENAND_BUF),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) [2] = DEFINE_RES_IRQ(IRQ_ONENAND),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) struct platform_device s3c_device_onenand = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) .name = "samsung-onenand",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) .num_resources = ARRAY_SIZE(s3c_onenand_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) .resource = s3c_onenand_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) #endif /* CONFIG_S3C_DEV_ONENAND */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) #ifdef CONFIG_S3C64XX_DEV_ONENAND1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) static struct resource s3c64xx_onenand1_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) [0] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1, SZ_1K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) [1] = DEFINE_RES_MEM(S3C64XX_PA_ONENAND1_BUF, S3C64XX_SZ_ONENAND1_BUF),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) [2] = DEFINE_RES_IRQ(IRQ_ONENAND1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) struct platform_device s3c64xx_device_onenand1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) .name = "samsung-onenand",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) .id = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) .num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) .resource = s3c64xx_onenand1_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) void __init s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) &s3c64xx_device_onenand1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) #endif /* CONFIG_S3C64XX_DEV_ONENAND1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) /* PWM Timer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) #ifdef CONFIG_SAMSUNG_DEV_PWM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) static struct resource samsung_pwm_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) DEFINE_RES_MEM(SAMSUNG_PA_TIMER, SZ_4K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) struct platform_device samsung_device_pwm = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) .name = "samsung-pwm",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) .num_resources = ARRAY_SIZE(samsung_pwm_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) .resource = samsung_pwm_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) void __init samsung_pwm_set_platdata(struct samsung_pwm_variant *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) samsung_device_pwm.dev.platform_data = pd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) #endif /* CONFIG_SAMSUNG_DEV_PWM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) /* RTC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) static struct resource s3c_rtc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) [1] = DEFINE_RES_IRQ(IRQ_RTC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) [2] = DEFINE_RES_IRQ(IRQ_TICK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) struct platform_device s3c_device_rtc = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) .name = "s3c2410-rtc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) .num_resources = ARRAY_SIZE(s3c_rtc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) .resource = s3c_rtc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) #ifdef CONFIG_S3C_DEV_RTC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) static struct resource s3c_rtc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) [0] = DEFINE_RES_MEM(S3C_PA_RTC, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) struct platform_device s3c_device_rtc = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) .name = "s3c64xx-rtc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) .num_resources = ARRAY_SIZE(s3c_rtc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) .resource = s3c_rtc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) #endif /* CONFIG_S3C_DEV_RTC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) /* SDI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) void s3c24xx_mci_def_set_power(unsigned char power_mode, unsigned short vdd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) switch (power_mode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) case MMC_POWER_ON:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) case MMC_POWER_UP:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) /* Configure GPE5...GPE10 pins in SD mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) s3c_gpio_cfgall_range(S3C2410_GPE(5), 6, S3C_GPIO_SFN(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) case MMC_POWER_OFF:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) gpio_direction_output(S3C2410_GPE(5), 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) static struct resource s3c_sdi_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) [0] = DEFINE_RES_MEM(S3C24XX_PA_SDI, S3C24XX_SZ_SDI),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) [1] = DEFINE_RES_IRQ(IRQ_SDI),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) /* This is currently here to avoid a number of if (host->pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865) * checks. Any zero fields to ensure reasonable defaults are picked. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) .no_wprotect = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) .no_detect = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) .set_power = s3c24xx_mci_def_set_power,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) struct platform_device s3c_device_sdi = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) .name = "s3c2410-sdi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) .num_resources = ARRAY_SIZE(s3c_sdi_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) .resource = s3c_sdi_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) .dev.platform_data = &s3cmci_def_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) &s3c_device_sdi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886) /* SPI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) static struct resource s3c_spi0_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI, SZ_32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) [1] = DEFINE_RES_IRQ(IRQ_SPI0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) struct platform_device s3c_device_spi0 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) .name = "s3c2410-spi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) .num_resources = ARRAY_SIZE(s3c_spi0_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) .resource = s3c_spi0_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) static struct resource s3c_spi1_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906) [0] = DEFINE_RES_MEM(S3C24XX_PA_SPI1, SZ_32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) [1] = DEFINE_RES_IRQ(IRQ_SPI1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) struct platform_device s3c_device_spi1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) .name = "s3c2410-spi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912) .id = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) .num_resources = ARRAY_SIZE(s3c_spi1_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) .resource = s3c_spi1_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) /* Touchscreen */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) static struct resource s3c_ts_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926) [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) [1] = DEFINE_RES_IRQ(IRQ_TC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) struct platform_device s3c_device_ts = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) .name = "s3c2410-ts",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) .dev.parent = &s3c_device_adc.dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) .num_resources = ARRAY_SIZE(s3c_ts_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) .resource = s3c_ts_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) s3c_set_platdata(hard_s3c2410ts_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) #ifdef CONFIG_SAMSUNG_DEV_TS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) static struct s3c2410_ts_mach_info default_ts_data __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947) .delay = 10000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) .presc = 49,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) .oversampling_shift = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952) void __init s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) if (!pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) pd = &default_ts_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) &s3c_device_adc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960) #endif /* CONFIG_SAMSUNG_DEV_TS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) /* USB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) #ifdef CONFIG_S3C_DEV_USB_HOST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) static struct resource s3c_usb_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966) [0] = DEFINE_RES_MEM(S3C_PA_USBHOST, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) [1] = DEFINE_RES_IRQ(IRQ_USBH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) struct platform_device s3c_device_ohci = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) .name = "s3c2410-ohci",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) .num_resources = ARRAY_SIZE(s3c_usb_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) .resource = s3c_usb_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982) * s3c_ohci_set_platdata - initialise OHCI device platform data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983) * @info: The platform data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985) * This call copies the @info passed in and sets the device .platform_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) * field to that copy. The @info is copied so that the original can be marked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987) * __initdata.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992) s3c_set_platdata(info, sizeof(struct s3c2410_hcd_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993) &s3c_device_ohci);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) #endif /* CONFIG_S3C_DEV_USB_HOST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997) /* USB Device (Gadget) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) static struct resource s3c_usbgadget_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) [0] = DEFINE_RES_MEM(S3C24XX_PA_USBDEV, S3C24XX_SZ_USBDEV),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) [1] = DEFINE_RES_IRQ(IRQ_USBD),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) struct platform_device s3c_device_usbgadget = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) .name = "s3c2410-usbgadget",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) .resource = s3c_usbgadget_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) /* USB HSOTG */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) #ifdef CONFIG_S3C_DEV_USB_HSOTG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) static struct resource s3c_usb_hsotg_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG, SZ_128K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) [1] = DEFINE_RES_IRQ(IRQ_OTG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) struct platform_device s3c_device_usb_hsotg = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) .name = "s3c-hsotg",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) .resource = s3c_usb_hsotg_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) struct dwc2_hsotg_plat *npd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) if (!npd->phy_init)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) npd->phy_init = s3c_usb_phy_init;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) if (!npd->phy_exit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) npd->phy_exit = s3c_usb_phy_exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) #endif /* CONFIG_S3C_DEV_USB_HSOTG */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) /* USB High Spped 2.0 Device (Gadget) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) #ifdef CONFIG_PLAT_S3C24XX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) static struct resource s3c_hsudc_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) [0] = DEFINE_RES_MEM(S3C2416_PA_HSUDC, S3C2416_SZ_HSUDC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) [1] = DEFINE_RES_IRQ(IRQ_USBD),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) struct platform_device s3c_device_usb_hsudc = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) .name = "s3c-hsudc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) .num_resources = ARRAY_SIZE(s3c_hsudc_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) .resource = s3c_hsudc_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) pd->phy_init = s3c_hsudc_init_phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) pd->phy_uninit = s3c_hsudc_uninit_phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) #endif /* CONFIG_PLAT_S3C24XX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) /* WDT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) #ifdef CONFIG_S3C_DEV_WDT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) static struct resource s3c_wdt_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) [1] = DEFINE_RES_IRQ(IRQ_WDT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) struct platform_device s3c_device_wdt = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) .name = "s3c2410-wdt",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) .num_resources = ARRAY_SIZE(s3c_wdt_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) .resource = s3c_wdt_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) #endif /* CONFIG_S3C_DEV_WDT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) #ifdef CONFIG_S3C64XX_DEV_SPI0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) static struct resource s3c64xx_spi0_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) [0] = DEFINE_RES_MEM(S3C_PA_SPI0, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) [1] = DEFINE_RES_IRQ(IRQ_SPI0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) struct platform_device s3c64xx_device_spi0 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) .name = "s3c6410-spi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) .num_resources = ARRAY_SIZE(s3c64xx_spi0_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) .resource = s3c64xx_spi0_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) int num_cs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) struct s3c64xx_spi_info pd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) /* Reject invalid configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) if (!num_cs || src_clk_nr < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117) pr_err("%s: Invalid SPI configuration\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) pd.num_cs = num_cs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) pd.src_clk_nr = src_clk_nr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) #endif /* CONFIG_S3C64XX_DEV_SPI0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) #ifdef CONFIG_S3C64XX_DEV_SPI1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) static struct resource s3c64xx_spi1_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) [0] = DEFINE_RES_MEM(S3C_PA_SPI1, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) [1] = DEFINE_RES_IRQ(IRQ_SPI1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) struct platform_device s3c64xx_device_spi1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) .name = "s3c6410-spi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) .id = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) .num_resources = ARRAY_SIZE(s3c64xx_spi1_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) .resource = s3c64xx_spi1_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) int num_cs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) struct s3c64xx_spi_info pd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) /* Reject invalid configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) if (!num_cs || src_clk_nr < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) pr_err("%s: Invalid SPI configuration\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) pd.num_cs = num_cs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) pd.src_clk_nr = src_clk_nr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) #endif /* CONFIG_S3C64XX_DEV_SPI1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) #ifdef CONFIG_S3C64XX_DEV_SPI2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) static struct resource s3c64xx_spi2_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) [0] = DEFINE_RES_MEM(S3C_PA_SPI2, SZ_256),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) [1] = DEFINE_RES_IRQ(IRQ_SPI2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) struct platform_device s3c64xx_device_spi2 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) .name = "s3c6410-spi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) .id = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) .num_resources = ARRAY_SIZE(s3c64xx_spi2_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) .resource = s3c64xx_spi2_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) .dma_mask = &samsung_device_dma_mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) .coherent_dma_mask = DMA_BIT_MASK(32),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) void __init s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) int num_cs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) struct s3c64xx_spi_info pd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) /* Reject invalid configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) if (!num_cs || src_clk_nr < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) pr_err("%s: Invalid SPI configuration\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) pd.num_cs = num_cs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) pd.src_clk_nr = src_clk_nr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi2_cfg_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) #endif /* CONFIG_S3C64XX_DEV_SPI2 */