From 037e0b76c64f2d3203bceba48e60e6a35ed6d605 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:28 +0000 Subject: [PATCH] --- yaml --- r: 123872 b: refs/heads/master c: 5b323c7beb1b10b137f9e21981050319d89d55dd h: refs/heads/master v: v3 --- [refs] | 2 +- .../arch/arm/mach-s3c2410/include/mach/gpio.h | 6 - .../arch/arm/mach-s3c2410/include/mach/irqs.h | 2 + .../arch/arm/mach-s3c2410/include/mach/map.h | 1 + trunk/arch/arm/mach-s3c2412/clock.c | 1 - trunk/arch/arm/mach-s3c2412/mach-jive.c | 6 +- trunk/arch/arm/mach-s3c2440/Kconfig | 2 - trunk/arch/arm/mach-s3c2440/mach-anubis.c | 5 - trunk/arch/arm/mach-s3c2440/mach-at2440evb.c | 44 --- trunk/arch/arm/mach-s3c2443/Kconfig | 1 + trunk/arch/arm/mach-s3c2443/clock.c | 2 - trunk/arch/arm/mach-s3c2443/mach-smdk2443.c | 2 +- .../arch/arm/mach-s3c6400/include/mach/map.h | 9 + .../arm/mach-s3c6400/include/mach/pwm-clock.h | 56 --- .../mach-s3c6400/include/mach/uncompress.h | 2 - trunk/arch/arm/mach-s3c6410/Kconfig | 1 + trunk/arch/arm/mach-s3c6410/mach-smdk6410.c | 2 + trunk/arch/arm/plat-s3c/Kconfig | 16 +- trunk/arch/arm/plat-s3c/Makefile | 6 +- trunk/arch/arm/plat-s3c/dev-hsmmc.c | 47 +++ trunk/arch/arm/plat-s3c/include/plat/adc.h | 29 -- trunk/arch/arm/plat-s3c/include/plat/clock.h | 5 - trunk/arch/arm/plat-s3c/include/plat/cpu.h | 1 - trunk/arch/arm/plat-s3c/include/plat/devs.h | 4 +- .../arm/plat-s3c/include/plat/regs-timer.h | 8 - .../arm/plat-s3c/include/plat/uncompress.h | 28 -- trunk/arch/arm/plat-s3c/pwm-clock.c | 67 ++-- trunk/arch/arm/plat-s3c/time.c | 66 +--- trunk/arch/arm/plat-s3c24xx/Kconfig | 28 -- trunk/arch/arm/plat-s3c24xx/Makefile | 1 - trunk/arch/arm/plat-s3c24xx/adc.c | 372 ------------------ trunk/arch/arm/plat-s3c24xx/devs.c | 40 +- .../arm/plat-s3c24xx/include/mach/pwm-clock.h | 55 --- trunk/arch/arm/plat-s3c24xx/s3c2410-clock.c | 1 - trunk/arch/arm/plat-s3c64xx/clock.c | 24 -- .../arch/arm/plat-s3c64xx/include/plat/pll.h | 6 +- .../plat-s3c64xx/include/plat/regs-clock.h | 4 +- .../arm/plat-s3c64xx/include/plat/regs-sys.h | 24 -- trunk/arch/arm/plat-s3c64xx/irq-eint.c | 2 +- trunk/arch/arm/plat-s3c64xx/s3c6400-clock.c | 1 - 40 files changed, 153 insertions(+), 826 deletions(-) delete mode 100644 trunk/arch/arm/mach-s3c6400/include/mach/pwm-clock.h create mode 100644 trunk/arch/arm/plat-s3c/dev-hsmmc.c delete mode 100644 trunk/arch/arm/plat-s3c/include/plat/adc.h delete mode 100644 trunk/arch/arm/plat-s3c24xx/adc.c delete mode 100644 trunk/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h delete mode 100644 trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h diff --git a/[refs] b/[refs] index a42908de6004..8f10923482ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f2754378f3522a42daafdbb9d2385f341008454 +refs/heads/master: 5b323c7beb1b10b137f9e21981050319d89d55dd diff --git a/trunk/arch/arm/mach-s3c2410/include/mach/gpio.h b/trunk/arch/arm/mach-s3c2410/include/mach/gpio.h index e0349af8a483..3b52b86498a6 100644 --- a/trunk/arch/arm/mach-s3c2410/include/mach/gpio.h +++ b/trunk/arch/arm/mach-s3c2410/include/mach/gpio.h @@ -15,10 +15,4 @@ #define gpio_set_value __gpio_set_value #define gpio_cansleep __gpio_cansleep -/* some boards require extra gpio capacity to support external - * devices that need GPIO. - */ - -#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) - #include diff --git a/trunk/arch/arm/mach-s3c2410/include/mach/irqs.h b/trunk/arch/arm/mach-s3c2410/include/mach/irqs.h index 950c71bf1489..fa8764b05692 100644 --- a/trunk/arch/arm/mach-s3c2410/include/mach/irqs.h +++ b/trunk/arch/arm/mach-s3c2410/include/mach/irqs.h @@ -134,6 +134,8 @@ #define IRQ_S3C2443_HSMMC S3C2410_IRQ(20) /* IRQ_SDI */ #define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */ +#define IRQ_HSMMC0 IRQ_S3C2443_HSMMC + #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15) #define IRQ_S3C2443_LCD3 S3C2410_IRQSUB(16) diff --git a/trunk/arch/arm/mach-s3c2410/include/mach/map.h b/trunk/arch/arm/mach-s3c2410/include/mach/map.h index 918e3463297f..d5ae6823fed4 100644 --- a/trunk/arch/arm/mach-s3c2410/include/mach/map.h +++ b/trunk/arch/arm/mach-s3c2410/include/mach/map.h @@ -102,5 +102,6 @@ #define S3C24XX_PA_NAND S3C2410_PA_NAND #define S3C_PA_UART S3C24XX_PA_UART +#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC #endif /* __ASM_ARCH_MAP_H */ diff --git a/trunk/arch/arm/mach-s3c2412/clock.c b/trunk/arch/arm/mach-s3c2412/clock.c index a037df5e1c2d..3ce15e082e77 100644 --- a/trunk/arch/arm/mach-s3c2412/clock.c +++ b/trunk/arch/arm/mach-s3c2412/clock.c @@ -767,6 +767,5 @@ int __init s3c2412_baseclk_add(void) s3c2412_clkcon_enable(clkp, 0); } - s3c_pwmclk_init(); return 0; } diff --git a/trunk/arch/arm/mach-s3c2412/mach-jive.c b/trunk/arch/arm/mach-s3c2412/mach-jive.c index 5e758cf8bf82..25ff1ec9f8ad 100644 --- a/trunk/arch/arm/mach-s3c2412/mach-jive.c +++ b/trunk/arch/arm/mach-s3c2412/mach-jive.c @@ -398,12 +398,11 @@ static struct s3c2410_spigpio_info jive_lcd_spi = { .bus_num = 1, .pin_clk = S3C2410_GPG8, .pin_mosi = S3C2410_GPB8, - .num_chipselect = 1, .chip_select = jive_lcd_spi_chipselect, }; static struct platform_device jive_device_lcdspi = { - .name = "spi_s3c24xx_gpio", + .name = "s3c24xx-spi-gpio", .id = 1, .num_resources = 0, .dev.platform_data = &jive_lcd_spi, @@ -420,12 +419,11 @@ static struct s3c2410_spigpio_info jive_wm8750_spi = { .bus_num = 2, .pin_clk = S3C2410_GPB4, .pin_mosi = S3C2410_GPB9, - .num_chipselect = 1, .chip_select = jive_wm8750_chipselect, }; static struct platform_device jive_device_wm8750 = { - .name = "spi_s3c24xx_gpio", + .name = "s3c24xx-spi-gpio", .id = 2, .num_resources = 0, .dev.platform_data = &jive_wm8750_spi, diff --git a/trunk/arch/arm/mach-s3c2440/Kconfig b/trunk/arch/arm/mach-s3c2440/Kconfig index cde5ae9a4340..57b9c57ff2b4 100644 --- a/trunk/arch/arm/mach-s3c2440/Kconfig +++ b/trunk/arch/arm/mach-s3c2440/Kconfig @@ -32,7 +32,6 @@ config MACH_ANUBIS select S3C24XX_DCLK select PM_SIMTEC if PM select HAVE_PATA_PLATFORM - select S3C24XX_GPIO_EXTRA64 help Say Y here if you are using the Simtec Electronics ANUBIS development system @@ -42,7 +41,6 @@ config MACH_OSIRIS select CPU_S3C2440 select S3C24XX_DCLK select PM_SIMTEC if PM - select S3C24XX_GPIO_EXTRA128 help Say Y here if you are using the Simtec IM2440D20 module, also known as the Osiris. diff --git a/trunk/arch/arm/mach-s3c2440/mach-anubis.c b/trunk/arch/arm/mach-s3c2440/mach-anubis.c index f151f8939929..334379bdfc6e 100644 --- a/trunk/arch/arm/mach-s3c2440/mach-anubis.c +++ b/trunk/arch/arm/mach-s3c2440/mach-anubis.c @@ -366,8 +366,6 @@ static struct sm501_initdata anubis_sm501_initdata = { .mask = 0, }, - .devices = SM501_USE_GPIO, - /* set the SDRAM and bus clocks */ .mclk = 72 * MHZ, .m1xclk = 144 * MHZ, @@ -375,12 +373,10 @@ static struct sm501_initdata anubis_sm501_initdata = { static struct sm501_platdata_gpio_i2c anubis_sm501_gpio_i2c[] = { [0] = { - .bus_num = 1, .pin_scl = 44, .pin_sda = 45, }, [1] = { - .bus_num = 2, .pin_scl = 40, .pin_sda = 41, }, @@ -388,7 +384,6 @@ static struct sm501_platdata_gpio_i2c anubis_sm501_gpio_i2c[] = { static struct sm501_platdata anubis_sm501_platdata = { .init = &anubis_sm501_initdata, - .gpio_base = -1, .gpio_i2c = anubis_sm501_gpio_i2c, .gpio_i2c_nr = ARRAY_SIZE(anubis_sm501_gpio_i2c), }; diff --git a/trunk/arch/arm/mach-s3c2440/mach-at2440evb.c b/trunk/arch/arm/mach-s3c2440/mach-at2440evb.c index 4539b1d95877..07b42a0207d1 100644 --- a/trunk/arch/arm/mach-s3c2440/mach-at2440evb.c +++ b/trunk/arch/arm/mach-s3c2440/mach-at2440evb.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -46,7 +45,6 @@ #include #include #include -#include static struct map_desc at2440evb_iodesc[] __initdata = { /* Nothing here */ @@ -164,43 +162,6 @@ static struct platform_device at2440evb_device_eth = { }, }; -static struct s3c24xx_mci_pdata at2440evb_mci_pdata = { - .gpio_detect = S3C2410_GPG10, -}; - -/* 7" LCD panel */ - -static struct s3c2410fb_display at2440evb_lcd_cfg __initdata = { - - .lcdcon5 = S3C2410_LCDCON5_FRM565 | - S3C2410_LCDCON5_INVVLINE | - S3C2410_LCDCON5_INVVFRAME | - S3C2410_LCDCON5_PWREN | - S3C2410_LCDCON5_HWSWP, - - .type = S3C2410_LCDCON1_TFT, - - .width = 800, - .height = 480, - - .pixclock = 33333, /* HCLK 60 MHz, divisor 2 */ - .xres = 800, - .yres = 480, - .bpp = 16, - .left_margin = 88, - .right_margin = 40, - .hsync_len = 128, - .upper_margin = 32, - .lower_margin = 11, - .vsync_len = 2, -}; - -static struct s3c2410fb_mach_info at2440evb_fb_info __initdata = { - .displays = &at2440evb_lcd_cfg, - .num_displays = 1, - .default_display = 0, -}; - static struct platform_device *at2440evb_devices[] __initdata = { &s3c_device_usb, &s3c_device_wdt, @@ -208,16 +169,12 @@ static struct platform_device *at2440evb_devices[] __initdata = { &s3c_device_i2c, &s3c_device_rtc, &s3c_device_nand, - &s3c_device_sdi, - &s3c_device_lcd, &at2440evb_device_eth, }; static void __init at2440evb_map_io(void) { s3c_device_nand.dev.platform_data = &at2440evb_nand_info; - s3c_device_sdi.name = "s3c2440-sdi"; - s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); s3c24xx_init_clocks(16934400); @@ -226,7 +183,6 @@ static void __init at2440evb_map_io(void) static void __init at2440evb_init(void) { - s3c24xx_fb_set_platdata(&at2440evb_fb_info); platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); } diff --git a/trunk/arch/arm/mach-s3c2443/Kconfig b/trunk/arch/arm/mach-s3c2443/Kconfig index 14252f573754..212141baebec 100644 --- a/trunk/arch/arm/mach-s3c2443/Kconfig +++ b/trunk/arch/arm/mach-s3c2443/Kconfig @@ -24,6 +24,7 @@ config MACH_SMDK2443 bool "SMDK2443" select CPU_S3C2443 select MACH_SMDK + select S3C_DEV_HSMMC help Say Y here if you are using an SMDK2443 diff --git a/trunk/arch/arm/mach-s3c2443/clock.c b/trunk/arch/arm/mach-s3c2443/clock.c index fdd4ec335a77..363f39608783 100644 --- a/trunk/arch/arm/mach-s3c2443/clock.c +++ b/trunk/arch/arm/mach-s3c2443/clock.c @@ -1107,6 +1107,4 @@ void __init s3c2443_init_clocks(int xtal) (clkp->enable)(clkp, 0); } - - s3c_pwmclk_init(); } diff --git a/trunk/arch/arm/mach-s3c2443/mach-smdk2443.c b/trunk/arch/arm/mach-s3c2443/mach-smdk2443.c index a7fe65f3dcc1..815a3bd1d37b 100644 --- a/trunk/arch/arm/mach-s3c2443/mach-smdk2443.c +++ b/trunk/arch/arm/mach-s3c2443/mach-smdk2443.c @@ -104,7 +104,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = { static struct platform_device *smdk2443_devices[] __initdata = { &s3c_device_wdt, &s3c_device_i2c, - &s3c_device_hsmmc, + &s3c_device_hsmmc0, }; static void __init smdk2443_map_io(void) diff --git a/trunk/arch/arm/mach-s3c6400/include/mach/map.h b/trunk/arch/arm/mach-s3c6400/include/mach/map.h index 618f09d637b2..aadaaaf2d8b6 100644 --- a/trunk/arch/arm/mach-s3c6400/include/mach/map.h +++ b/trunk/arch/arm/mach-s3c6400/include/mach/map.h @@ -17,6 +17,12 @@ #include +/* HSMMC units */ +#define S3C64XX_PA_HSMMC(x) (0x7C200000 + ((x) * 0x100000)) +#define S3C64XX_PA_HSMMC0 S3C64XX_PA_HSMMC(0) +#define S3C64XX_PA_HSMMC1 S3C64XX_PA_HSMMC(1) +#define S3C64XX_PA_HSMMC2 S3C64XX_PA_HSMMC(2) + #define S3C_PA_UART (0x7F005000) #define S3C_PA_UART0 (S3C_PA_UART + 0x00) #define S3C_PA_UART1 (S3C_PA_UART + 0x400) @@ -49,5 +55,8 @@ /* compatibiltiy defines. */ #define S3C_PA_TIMER S3C64XX_PA_TIMER +#define S3C_PA_HSMMC0 S3C64XX_PA_HSMMC0 +#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1 +#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2 #endif /* __ASM_ARCH_6400_MAP_H */ diff --git a/trunk/arch/arm/mach-s3c6400/include/mach/pwm-clock.h b/trunk/arch/arm/mach-s3c6400/include/mach/pwm-clock.h deleted file mode 100644 index b25bedee0d52..000000000000 --- a/trunk/arch/arm/mach-s3c6400/include/mach/pwm-clock.h +++ /dev/null @@ -1,56 +0,0 @@ -/* linux/arch/arm/mach-s3c6400/include/mach/pwm-clock.h - * - * Copyright 2008 Openmoko, Inc. - * Copyright 2008 Simtec Electronics - * Ben Dooks - * http://armlinux.simtec.co.uk/ - * - * S3C64xx - pwm clock and timer support - */ - -/** - * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk - * @tcfg: The timer TCFG1 register bits shifted down to 0. - * - * Return true if the given configuration from TCFG1 is a TCLK instead - * any of the TDIV clocks. - */ -static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) -{ - return tcfg >= S3C64XX_TCFG1_MUX_TCLK; -} - -/** - * tcfg_to_divisor() - convert tcfg1 setting to a divisor - * @tcfg1: The tcfg1 setting, shifted down. - * - * Get the divisor value for the given tcfg1 setting. We assume the - * caller has already checked to see if this is not a TCLK source. - */ -static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) -{ - return 1 << tcfg1; -} - -/** - * pwm_tdiv_has_div1() - does the tdiv setting have a /1 - * - * Return true if we have a /1 in the tdiv setting. - */ -static inline unsigned int pwm_tdiv_has_div1(void) -{ - return 1; -} - -/** - * pwm_tdiv_div_bits() - calculate TCFG1 divisor value. - * @div: The divisor to calculate the bit information for. - * - * Turn a divisor into the necessary bit field for TCFG1. - */ -static inline unsigned long pwm_tdiv_div_bits(unsigned int div) -{ - return ilog2(div); -} - -#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK diff --git a/trunk/arch/arm/mach-s3c6400/include/mach/uncompress.h b/trunk/arch/arm/mach-s3c6400/include/mach/uncompress.h index c6a82a20bf2a..cc822c57cc1c 100644 --- a/trunk/arch/arm/mach-s3c6400/include/mach/uncompress.h +++ b/trunk/arch/arm/mach-s3c6400/include/mach/uncompress.h @@ -21,8 +21,6 @@ static void arch_detect_cpu(void) { /* we do not need to do any cpu detection here at the moment. */ - fifo_mask = S3C2440_UFSTAT_TXMASK; - fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; } #endif /* __ASM_ARCH_UNCOMPRESS_H */ diff --git a/trunk/arch/arm/mach-s3c6410/Kconfig b/trunk/arch/arm/mach-s3c6410/Kconfig index 75b1244cf8ab..d7ccc269086c 100644 --- a/trunk/arch/arm/mach-s3c6410/Kconfig +++ b/trunk/arch/arm/mach-s3c6410/Kconfig @@ -17,5 +17,6 @@ config CPU_S3C6410 config MACH_SMDK6410 bool "SMDK6410" select CPU_S3C6410 + select S3C_DEV_HSMMC help Machine support for the Samsung SMDK6410 diff --git a/trunk/arch/arm/mach-s3c6410/mach-smdk6410.c b/trunk/arch/arm/mach-s3c6410/mach-smdk6410.c index 9213a8ba283b..35d42e8cab92 100644 --- a/trunk/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/trunk/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -64,6 +64,8 @@ struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { }; +extern void s3c64xx_init_io(struct map_desc *, int); + static void __init smdk6410_map_io(void) { s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); diff --git a/trunk/arch/arm/plat-s3c/Kconfig b/trunk/arch/arm/plat-s3c/Kconfig index adb9060ec910..0deb1054975f 100644 --- a/trunk/arch/arm/plat-s3c/Kconfig +++ b/trunk/arch/arm/plat-s3c/Kconfig @@ -57,14 +57,6 @@ config S3C_BOOT_ERROR_RESET Say y here to use the watchdog to reset the system if the kernel decompressor detects an error during decompression. -config S3C_BOOT_UART_FORCE_FIFO - bool "Force UART FIFO on during boot process" - depends on PLAT_S3C - default y - help - Say Y here to force the UART FIFOs on during the kernel - uncompressor - comment "Power management" config S3C2410_PM_DEBUG @@ -110,3 +102,11 @@ config S3C_LOWLEVEL_UART_PORT such as the `Uncompressing...` at start time. The value of this configuration should be between zero and two. The port must have been initialised by the boot-loader before use. + +# device definitions to compile in + +config S3C_DEV_HSMMC + bool + depends on PLAT_S3C + help + Compile in platform device definitions for HSMMC code diff --git a/trunk/arch/arm/plat-s3c/Makefile b/trunk/arch/arm/plat-s3c/Makefile index a2fe3c77564e..b95a9c106467 100644 --- a/trunk/arch/arm/plat-s3c/Makefile +++ b/trunk/arch/arm/plat-s3c/Makefile @@ -14,4 +14,8 @@ obj- := obj-y += init.o obj-y += time.o obj-y += clock.o -obj-y += pwm-clock.o \ No newline at end of file +obj-y += pwm-clock.o + +# devices + +obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o diff --git a/trunk/arch/arm/plat-s3c/dev-hsmmc.c b/trunk/arch/arm/plat-s3c/dev-hsmmc.c new file mode 100644 index 000000000000..5a5ef74ebde3 --- /dev/null +++ b/trunk/arch/arm/plat-s3c/dev-hsmmc.c @@ -0,0 +1,47 @@ +/* linux/arch/arm/plat-s3c/dev-hsmmc.c + * + * Copyright (c) 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * S3C series device definition for hsmmc devices + * + * 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 +#include + +#include +#include +#include + +#define S3C_SZ_HSMMC (0x1000) + +static struct resource s3c_hsmmc_resource[] = { + [0] = { + .start = S3C_PA_HSMMC0, + .end = S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_HSMMC0, + .end = IRQ_HSMMC0, + .flags = IORESOURCE_IRQ, + } +}; + +static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL; + +struct platform_device s3c_device_hsmmc0 = { + .name = "s3c-sdhci", + .id = 0, + .num_resources = ARRAY_SIZE(s3c_hsmmc_resource), + .resource = s3c_hsmmc_resource, + .dev = { + .dma_mask = &s3c_device_hsmmc_dmamask, + .coherent_dma_mask = 0xffffffffUL + } +}; diff --git a/trunk/arch/arm/plat-s3c/include/plat/adc.h b/trunk/arch/arm/plat-s3c/include/plat/adc.h deleted file mode 100644 index 43df2a404b0b..000000000000 --- a/trunk/arch/arm/plat-s3c/include/plat/adc.h +++ /dev/null @@ -1,29 +0,0 @@ -/* arch/arm/plat-s3c/include/plat/adc.h - * - * Copyright (c) 2008 Simtec Electronics - * http://armlinux.simnte.co.uk/ - * Ben Dooks - * - * S3C24XX ADC driver information - * - * 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. -*/ - -#ifndef __ASM_PLAT_ADC_H -#define __ASM_PLAT_ADC_H __FILE__ - -struct s3c_adc_client; - -extern int s3c_adc_start(struct s3c_adc_client *client, - unsigned int channel, unsigned int nr_samples); - -extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, - void (*select)(unsigned selected), - void (*conv)(unsigned d0, unsigned d1), - unsigned int is_ts); - -extern void s3c_adc_release(struct s3c_adc_client *client); - -#endif /* __ASM_PLAT_ADC_H */ diff --git a/trunk/arch/arm/plat-s3c/include/plat/clock.h b/trunk/arch/arm/plat-s3c/include/plat/clock.h index a10622eed43a..ea1f3ffa9717 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/clock.h +++ b/trunk/arch/arm/plat-s3c/include/plat/clock.h @@ -81,8 +81,3 @@ extern void s3c2443_setup_clocks(void); /* S3C64XX specific functions and clocks */ extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable); - -/* Init for pwm clock code */ - -extern void s3c_pwmclk_init(void); - diff --git a/trunk/arch/arm/plat-s3c/include/plat/cpu.h b/trunk/arch/arm/plat-s3c/include/plat/cpu.h index e62ae0fcfe56..6d89a4637f30 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/cpu.h +++ b/trunk/arch/arm/plat-s3c/include/plat/cpu.h @@ -47,7 +47,6 @@ extern void s3c24xx_init_irq(void); extern void s3c64xx_init_irq(u32 vic0, u32 vic1); extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); -extern void s3c64xx_init_io(struct map_desc *mach_desc, int size); extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); diff --git a/trunk/arch/arm/plat-s3c/include/plat/devs.h b/trunk/arch/arm/plat-s3c/include/plat/devs.h index a689c7c5ac23..f173863b8cc7 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/devs.h +++ b/trunk/arch/arm/plat-s3c/include/plat/devs.h @@ -32,7 +32,9 @@ extern struct platform_device s3c_device_iis; extern struct platform_device s3c_device_rtc; extern struct platform_device s3c_device_adc; extern struct platform_device s3c_device_sdi; -extern struct platform_device s3c_device_hsmmc; +extern struct platform_device s3c_device_hsmmc0; +extern struct platform_device s3c_device_hsmmc1; +extern struct platform_device s3c_device_hsmmc2; extern struct platform_device s3c_device_spi0; extern struct platform_device s3c_device_spi1; diff --git a/trunk/arch/arm/plat-s3c/include/plat/regs-timer.h b/trunk/arch/arm/plat-s3c/include/plat/regs-timer.h index d097d92f8cc7..086ce2685836 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/regs-timer.h +++ b/trunk/arch/arm/plat-s3c/include/plat/regs-timer.h @@ -73,14 +73,6 @@ #define S3C2410_TCFG1_MUX_TCLK (4<<0) #define S3C2410_TCFG1_MUX_MASK (15<<0) -#define S3C64XX_TCFG1_MUX_DIV1 (0<<0) -#define S3C64XX_TCFG1_MUX_DIV2 (1<<0) -#define S3C64XX_TCFG1_MUX_DIV4 (2<<0) -#define S3C64XX_TCFG1_MUX_DIV8 (3<<0) -#define S3C64XX_TCFG1_MUX_DIV16 (4<<0) -#define S3C64XX_TCFG1_MUX_TCLK (5<<0) /* 3 sets of TCLK */ -#define S3C64XX_TCFG1_MUX_MASK (15<<0) - #define S3C2410_TCFG1_SHIFT(x) ((x) * 4) /* for each timer, we have an count buffer, an compare buffer and diff --git a/trunk/arch/arm/plat-s3c/include/plat/uncompress.h b/trunk/arch/arm/plat-s3c/include/plat/uncompress.h index 6061de87f225..eeef32c4312d 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/uncompress.h +++ b/trunk/arch/arm/plat-s3c/include/plat/uncompress.h @@ -139,28 +139,6 @@ static void arch_decomp_error(const char *x) static void error(char *err); -#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO -static inline void arch_enable_uart_fifo(void) -{ - u32 fifocon = uart_rd(S3C2410_UFCON); - - if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { - fifocon |= S3C2410_UFCON_RESETBOTH; - uart_wr(S3C2410_UFCON, fifocon); - - /* wait for fifo reset to complete */ - while (1) { - fifocon = uart_rd(S3C2410_UFCON); - if (!(fifocon & S3C2410_UFCON_RESETBOTH)) - break; - } - } -} -#else -#define arch_enable_uart_fifo() do { } while(0) -#endif - - static void arch_decomp_setup(void) { @@ -171,12 +149,6 @@ arch_decomp_setup(void) arch_detect_cpu(); arch_decomp_wdog_start(); - - /* Enable the UART FIFOs if they where not enabled and our - * configuration says we should turn them on. - */ - - arch_enable_uart_fifo(); } diff --git a/trunk/arch/arm/plat-s3c/pwm-clock.c b/trunk/arch/arm/plat-s3c/pwm-clock.c index a318215ab535..5242fb0afcca 100644 --- a/trunk/arch/arm/plat-s3c/pwm-clock.c +++ b/trunk/arch/arm/plat-s3c/pwm-clock.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -27,7 +26,6 @@ #include #include -#include /* Each of the timers 0 through 5 go through the following * clock tree, with the inputs depending on the timers. @@ -168,6 +166,11 @@ static inline struct pwm_tdiv_clk *to_tdiv(struct clk *clk) return container_of(clk, struct pwm_tdiv_clk, clk); } +static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) +{ + return 1 << (1 + tcfg1); +} + static unsigned long clk_pwm_tdiv_get_rate(struct clk *clk) { unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); @@ -176,7 +179,7 @@ static unsigned long clk_pwm_tdiv_get_rate(struct clk *clk) tcfg1 >>= S3C2410_TCFG1_SHIFT(clk->id); tcfg1 &= S3C2410_TCFG1_MUX_MASK; - if (pwm_cfg_src_is_tclk(tcfg1)) + if (tcfg1 == S3C2410_TCFG1_MUX_TCLK) divisor = to_tdiv(clk)->divisor; else divisor = tcfg_to_divisor(tcfg1); @@ -193,9 +196,7 @@ static unsigned long clk_pwm_tdiv_round_rate(struct clk *clk, parent_rate = clk_get_rate(clk->parent); divisor = parent_rate / rate; - if (divisor <= 1 && pwm_tdiv_has_div1()) - divisor = 1; - else if (divisor <= 2) + if (divisor <= 2) divisor = 2; else if (divisor <= 4) divisor = 4; @@ -209,7 +210,25 @@ static unsigned long clk_pwm_tdiv_round_rate(struct clk *clk, static unsigned long clk_pwm_tdiv_bits(struct pwm_tdiv_clk *divclk) { - return pwm_tdiv_div_bits(divclk->divisor); + unsigned long bits; + + switch (divclk->divisor) { + case 2: + bits = S3C2410_TCFG1_MUX_DIV2; + break; + case 4: + bits = S3C2410_TCFG1_MUX_DIV4; + break; + case 8: + bits = S3C2410_TCFG1_MUX_DIV8; + break; + case 16: + default: + bits = S3C2410_TCFG1_MUX_DIV16; + break; + } + + return bits; } static void clk_pwm_tdiv_update(struct pwm_tdiv_clk *divclk) @@ -250,7 +269,7 @@ static int clk_pwm_tdiv_set_rate(struct clk *clk, unsigned long rate) /* Update the current MUX settings if we are currently * selected as the clock source for this clock. */ - if (!pwm_cfg_src_is_tclk(tcfg1)) + if (tcfg1 != S3C2410_TCFG1_MUX_TCLK) clk_pwm_tdiv_update(divclk); return 0; @@ -337,7 +356,7 @@ static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent) unsigned long shift = S3C2410_TCFG1_SHIFT(id); if (parent == s3c24xx_pwmclk_tclk(id)) - bits = S3C_TCFG1_MUX_TCLK << shift; + bits = S3C2410_TCFG1_MUX_TCLK << shift; else if (parent == s3c24xx_pwmclk_tdiv(id)) bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift; else @@ -399,7 +418,7 @@ static __init int clk_pwm_tin_register(struct clk *pwm) tcfg1 >>= S3C2410_TCFG1_SHIFT(id); tcfg1 &= S3C2410_TCFG1_MUX_MASK; - if (pwm_cfg_src_is_tclk(tcfg1)) + if (tcfg1 == S3C2410_TCFG1_MUX_TCLK) parent = s3c24xx_pwmclk_tclk(id); else parent = s3c24xx_pwmclk_tdiv(id); @@ -407,16 +426,7 @@ static __init int clk_pwm_tin_register(struct clk *pwm) return clk_set_parent(pwm, parent); } -/** - * s3c_pwmclk_init() - initialise pwm clocks - * - * Initialise and register the clocks which provide the inputs for the - * pwm timer blocks. - * - * Note, this call is required by the time core, so must be called after - * the base clocks are added and before any of the initcalls are run. - */ -__init void s3c_pwmclk_init(void) +static __init int s3c24xx_pwmclk_init(void) { struct clk *clk_timers; unsigned int clk; @@ -425,7 +435,7 @@ __init void s3c_pwmclk_init(void) clk_timers = clk_get(NULL, "timers"); if (IS_ERR(clk_timers)) { printk(KERN_ERR "%s: no parent clock\n", __func__); - return; + return -EINVAL; } for (clk = 0; clk < ARRAY_SIZE(clk_timer_scaler); clk++) { @@ -433,7 +443,7 @@ __init void s3c_pwmclk_init(void) ret = s3c24xx_register_clock(&clk_timer_scaler[clk]); if (ret < 0) { printk(KERN_ERR "error adding pwm scaler%d clock\n", clk); - return; + goto err; } } @@ -441,7 +451,7 @@ __init void s3c_pwmclk_init(void) ret = s3c24xx_register_clock(&clk_timer_tclk[clk]); if (ret < 0) { printk(KERN_ERR "error adding pww tclk%d\n", clk); - return; + goto err; } } @@ -449,7 +459,7 @@ __init void s3c_pwmclk_init(void) ret = clk_pwm_tdiv_register(clk); if (ret < 0) { printk(KERN_ERR "error adding pwm%d tdiv clock\n", clk); - return; + goto err; } } @@ -457,7 +467,14 @@ __init void s3c_pwmclk_init(void) ret = clk_pwm_tin_register(&clk_tin[clk]); if (ret < 0) { printk(KERN_ERR "error adding pwm%d tin clock\n", clk); - return; + goto err; } } + + return 0; + + err: + return ret; } + +arch_initcall(s3c24xx_pwmclk_init); diff --git a/trunk/arch/arm/plat-s3c/time.c b/trunk/arch/arm/plat-s3c/time.c index 3b27b29da478..a581ff7ba664 100644 --- a/trunk/arch/arm/plat-s3c/time.c +++ b/trunk/arch/arm/plat-s3c/time.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -148,10 +147,6 @@ static struct irqaction s3c2410_timer_irq = { machine_is_anubis() || \ machine_is_osiris()) -static struct clk *tin; -static struct clk *tdiv; -static struct clk *timerclk; - /* * Set up timer interrupt, and return the current time in seconds. * @@ -167,6 +162,12 @@ static void s3c2410_timer_setup (void) tcnt = TICK_MAX; /* default value for tcnt */ + /* read the current timer configuration bits */ + + tcon = __raw_readl(S3C2410_TCON); + tcfg1 = __raw_readl(S3C2410_TCFG1); + tcfg0 = __raw_readl(S3C2410_TCFG0); + /* configure the system for whichever machine is in use */ if (use_tclk1_12()) { @@ -174,13 +175,11 @@ static void s3c2410_timer_setup (void) timer_usec_ticks = timer_mask_usec_ticks(1, 12000000); tcnt = 12000000 / HZ; - tcfg1 = __raw_readl(S3C2410_TCFG1); tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1; - __raw_writel(tcfg1, S3C2410_TCFG1); } else { unsigned long pclk; - struct clk *tscaler; + struct clk *clk; /* for the h1940 (and others), we use the pclk from the core * to generate the timer values. since values around 50 to @@ -191,25 +190,29 @@ static void s3c2410_timer_setup (void) * (8.45 ticks per usec) */ - pclk = clk_get_rate(timerclk); + /* this is used as default if no other timer can be found */ + + clk = clk_get(NULL, "timers"); + if (IS_ERR(clk)) + panic("failed to get clock for system timer"); + + clk_enable(clk); + + pclk = clk_get_rate(clk); /* configure clock tick */ timer_usec_ticks = timer_mask_usec_ticks(6, pclk); - tscaler = clk_get_parent(tdiv); + tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; + tcfg1 |= S3C2410_TCFG1_MUX4_DIV2; - clk_set_rate(tscaler, pclk / 3); - clk_set_rate(tdiv, pclk / 6); - clk_set_parent(tin, tdiv); + tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; + tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT; - tcnt = clk_get_rate(tin) / HZ; + tcnt = (pclk / 6) / HZ; } - tcon = __raw_readl(S3C2410_TCON); - tcfg0 = __raw_readl(S3C2410_TCFG0); - tcfg1 = __raw_readl(S3C2410_TCFG1); - /* timers reload after counting zero, so reduce the count by 1 */ tcnt--; @@ -245,35 +248,8 @@ static void s3c2410_timer_setup (void) __raw_writel(tcon, S3C2410_TCON); } -static void __init s3c2410_timer_resources(void) -{ - struct platform_device tmpdev; - - tmpdev.dev.bus = &platform_bus_type; - tmpdev.id = 4; - - timerclk = clk_get(NULL, "timers"); - if (IS_ERR(timerclk)) - panic("failed to get clock for system timer"); - - clk_enable(timerclk); - - if (!use_tclk1_12()) { - tin = clk_get(&tmpdev.dev, "pwm-tin"); - if (IS_ERR(tin)) - panic("failed to get pwm-tin clock for system timer"); - - tdiv = clk_get(&tmpdev.dev, "pwm-tdiv"); - if (IS_ERR(tdiv)) - panic("failed to get pwm-tdiv clock for system timer"); - } - - clk_enable(tin); -} - static void __init s3c2410_timer_init(void) { - s3c2410_timer_resources(); s3c2410_timer_setup(); setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); } diff --git a/trunk/arch/arm/plat-s3c24xx/Kconfig b/trunk/arch/arm/plat-s3c24xx/Kconfig index 2c8a2f5d75ff..f0d54fdf88d4 100644 --- a/trunk/arch/arm/plat-s3c24xx/Kconfig +++ b/trunk/arch/arm/plat-s3c24xx/Kconfig @@ -41,27 +41,6 @@ config S3C24XX_PWM Support for exporting the PWM timer blocks via the pwm device system. - -# gpio configurations - -config S3C24XX_GPIO_EXTRA - int - default 128 if S3C24XX_GPIO_EXTRA128 - default 64 if S3C24XX_GPIO_EXTRA64 - default 0 - -config S3C24XX_GPIO_EXTRA64 - bool - help - Add an extra 64 gpio numbers to the available GPIO pool. This is - available for boards that need extra gpios for external devices. - -config S3C24XX_GPIO_EXTRA128 - bool - help - Add an extra 128 gpio numbers to the available GPIO pool. This is - available for boards that need extra gpios for external devices. - config PM_SIMTEC bool help @@ -83,13 +62,6 @@ config S3C2410_DMA_DEBUG Enable debugging output for the DMA code. This option sends info to the kernel log, at priority KERN_DEBUG. -config S3C24XX_ADC - bool "ADC common driver support" - help - Core support for the ADC block found in the S3C24XX SoC systems - for drivers such as the touchscreen and hwmon to use to share - this resource. - # SPI default pin configuration code config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13 diff --git a/trunk/arch/arm/plat-s3c24xx/Makefile b/trunk/arch/arm/plat-s3c24xx/Makefile index a8cfdefc29e9..2a65ba7eb34d 100644 --- a/trunk/arch/arm/plat-s3c24xx/Makefile +++ b/trunk/arch/arm/plat-s3c24xx/Makefile @@ -31,7 +31,6 @@ obj-$(CONFIG_PM) += sleep.o obj-$(CONFIG_HAVE_PWM) += pwm.o obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o obj-$(CONFIG_S3C2410_DMA) += dma.o -obj-$(CONFIG_S3C24XX_ADC) += adc.o # SPI gpio central GPIO functions diff --git a/trunk/arch/arm/plat-s3c24xx/adc.c b/trunk/arch/arm/plat-s3c24xx/adc.c deleted file mode 100644 index 9a5c767e0a42..000000000000 --- a/trunk/arch/arm/plat-s3c24xx/adc.c +++ /dev/null @@ -1,372 +0,0 @@ -/* arch/arm/plat-s3c24xx/adc.c - * - * Copyright (c) 2008 Simtec Electronics - * http://armlinux.simtec.co.uk/ - * Ben Dooks , - * - * S3C24XX ADC device core - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* This driver is designed to control the usage of the ADC block between - * the touchscreen and any other drivers that may need to use it, such as - * the hwmon driver. - * - * Priority will be given to the touchscreen driver, but as this itself is - * rate limited it should not starve other requests which are processed in - * order that they are received. - * - * Each user registers to get a client block which uniquely identifies it - * and stores information such as the necessary functions to callback when - * action is required. - */ - -struct s3c_adc_client { - struct platform_device *pdev; - struct list_head pend; - - unsigned int nr_samples; - unsigned char is_ts; - unsigned char channel; - - void (*select_cb)(unsigned selected); - void (*convert_cb)(unsigned val1, unsigned val2); -}; - -struct adc_device { - struct platform_device *pdev; - struct platform_device *owner; - struct clk *clk; - struct s3c_adc_client *cur; - struct s3c_adc_client *ts_pend; - void __iomem *regs; - - unsigned int prescale; - - int irq; -}; - -static struct adc_device *adc_dev; - -static LIST_HEAD(adc_pending); - -#define adc_dbg(_adc, msg...) dev_dbg(&(_adc)->pdev->dev, msg) - -static inline void s3c_adc_convert(struct adc_device *adc) -{ - unsigned con = readl(adc->regs + S3C2410_ADCCON); - - con |= S3C2410_ADCCON_ENABLE_START; - writel(con, adc->regs + S3C2410_ADCCON); -} - -static inline void s3c_adc_select(struct adc_device *adc, - struct s3c_adc_client *client) -{ - unsigned con = readl(adc->regs + S3C2410_ADCCON); - - client->select_cb(1); - - con &= ~S3C2410_ADCCON_MUXMASK; - con &= ~S3C2410_ADCCON_STDBM; - con &= ~S3C2410_ADCCON_STARTMASK; - - if (!client->is_ts) - con |= S3C2410_ADCCON_SELMUX(client->channel); - - writel(con, adc->regs + S3C2410_ADCCON); -} - -static void s3c_adc_dbgshow(struct adc_device *adc) -{ - adc_dbg(adc, "CON=%08x, TSC=%08x, DLY=%08x\n", - readl(adc->regs + S3C2410_ADCCON), - readl(adc->regs + S3C2410_ADCTSC), - readl(adc->regs + S3C2410_ADCDLY)); -} - -void s3c_adc_try(struct adc_device *adc) -{ - struct s3c_adc_client *next = adc->ts_pend; - - if (!next && !list_empty(&adc_pending)) { - next = list_first_entry(&adc_pending, - struct s3c_adc_client, pend); - list_del(&next->pend); - } else - adc->ts_pend = NULL; - - if (next) { - adc_dbg(adc, "new client is %p\n", next); - adc->cur = next; - s3c_adc_select(adc, next); - s3c_adc_convert(adc); - s3c_adc_dbgshow(adc); - } -} - -int s3c_adc_start(struct s3c_adc_client *client, - unsigned int channel, unsigned int nr_samples) -{ - struct adc_device *adc = adc_dev; - unsigned long flags; - - if (!adc) { - printk(KERN_ERR "%s: failed to find adc\n", __func__); - return -EINVAL; - } - - if (client->is_ts && adc->ts_pend) - return -EAGAIN; - - local_irq_save(flags); - - client->channel = channel; - client->nr_samples = nr_samples; - - if (client->is_ts) - adc->ts_pend = client; - else - list_add_tail(&client->pend, &adc_pending); - - if (!adc->cur) - s3c_adc_try(adc); - local_irq_restore(flags); - - return 0; -} -EXPORT_SYMBOL_GPL(s3c_adc_start); - -static void s3c_adc_default_select(unsigned select) -{ -} - -struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, - void (*select)(unsigned int selected), - void (*conv)(unsigned d0, unsigned d1), - unsigned int is_ts) -{ - struct s3c_adc_client *client; - - WARN_ON(!pdev); - WARN_ON(!conv); - - if (!select) - select = s3c_adc_default_select; - - if (!conv || !pdev) - return ERR_PTR(-EINVAL); - - client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL); - if (!client) { - dev_err(&pdev->dev, "no memory for adc client\n"); - return ERR_PTR(-ENOMEM); - } - - client->pdev = pdev; - client->is_ts = is_ts; - client->select_cb = select; - client->convert_cb = conv; - - return client; -} -EXPORT_SYMBOL_GPL(s3c_adc_register); - -void s3c_adc_release(struct s3c_adc_client *client) -{ - /* We should really check that nothing is in progress. */ - kfree(client); -} -EXPORT_SYMBOL_GPL(s3c_adc_release); - -static irqreturn_t s3c_adc_irq(int irq, void *pw) -{ - struct adc_device *adc = pw; - struct s3c_adc_client *client = adc->cur; - unsigned long flags; - unsigned data0, data1; - - if (!client) { - dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__); - return IRQ_HANDLED; - } - - data0 = readl(adc->regs + S3C2410_ADCDAT0); - data1 = readl(adc->regs + S3C2410_ADCDAT1); - adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); - - (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff); - - if (--client->nr_samples > 0) { - /* fire another conversion for this */ - - client->select_cb(1); - s3c_adc_convert(adc); - } else { - local_irq_save(flags); - (client->select_cb)(0); - adc->cur = NULL; - - s3c_adc_try(adc); - local_irq_restore(flags); - } - - return IRQ_HANDLED; -} - -static int s3c_adc_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct adc_device *adc; - struct resource *regs; - int ret; - - adc = kzalloc(sizeof(struct adc_device), GFP_KERNEL); - if (adc == NULL) { - dev_err(dev, "failed to allocate adc_device\n"); - return -ENOMEM; - } - - adc->pdev = pdev; - adc->prescale = S3C2410_ADCCON_PRSCVL(49); - - adc->irq = platform_get_irq(pdev, 1); - if (adc->irq <= 0) { - dev_err(dev, "failed to get adc irq\n"); - ret = -ENOENT; - goto err_alloc; - } - - ret = request_irq(adc->irq, s3c_adc_irq, 0, dev_name(dev), adc); - if (ret < 0) { - dev_err(dev, "failed to attach adc irq\n"); - goto err_alloc; - } - - adc->clk = clk_get(dev, "adc"); - if (IS_ERR(adc->clk)) { - dev_err(dev, "failed to get adc clock\n"); - ret = PTR_ERR(adc->clk); - goto err_irq; - } - - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!regs) { - dev_err(dev, "failed to find registers\n"); - ret = -ENXIO; - goto err_clk; - } - - adc->regs = ioremap(regs->start, resource_size(regs)); - if (!adc->regs) { - dev_err(dev, "failed to map registers\n"); - ret = -ENXIO; - goto err_clk; - } - - clk_enable(adc->clk); - - writel(adc->prescale | S3C2410_ADCCON_PRSCEN, - adc->regs + S3C2410_ADCCON); - - dev_info(dev, "attached adc driver\n"); - - platform_set_drvdata(pdev, adc); - adc_dev = adc; - - return 0; - - err_clk: - clk_put(adc->clk); - - err_irq: - free_irq(adc->irq, adc); - - err_alloc: - kfree(adc); - return ret; -} - -static int s3c_adc_remove(struct platform_device *pdev) -{ - struct adc_device *adc = platform_get_drvdata(pdev); - - iounmap(adc->regs); - free_irq(adc->irq, adc); - clk_disable(adc->clk); - clk_put(adc->clk); - kfree(adc); - - return 0; -} - -#ifdef CONFIG_PM -static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct adc_device *adc = platform_get_drvdata(pdev); - u32 con; - - con = readl(adc->regs + S3C2410_ADCCON); - con |= S3C2410_ADCCON_STDBM; - writel(con, adc->regs + S3C2410_ADCCON); - - clk_disable(adc->clk); - - return 0; -} - -static int s3c_adc_resume(struct platform_device *pdev) -{ - struct adc_device *adc = platform_get_drvdata(pdev); - - clk_enable(adc->clk); - - writel(adc->prescale | S3C2410_ADCCON_PRSCEN, - adc->regs + S3C2410_ADCCON); - - return 0; -} - -#else -#define s3c_adc_suspend NULL -#define s3c_adc_resume NULL -#endif - -static struct platform_driver s3c_adc_driver = { - .driver = { - .name = "s3c24xx-adc", - .owner = THIS_MODULE, - }, - .probe = s3c_adc_probe, - .remove = __devexit_p(s3c_adc_remove), - .suspend = s3c_adc_suspend, - .resume = s3c_adc_resume, -}; - -static int __init adc_init(void) -{ - int ret; - - ret = platform_driver_register(&s3c_adc_driver); - if (ret) - printk(KERN_ERR "%s: failed to add adc driver\n", __func__); - - return ret; -} - -arch_initcall(adc_init); diff --git a/trunk/arch/arm/plat-s3c24xx/devs.c b/trunk/arch/arm/plat-s3c24xx/devs.c index 9826efb91e48..3a2fcd94791e 100644 --- a/trunk/arch/arm/plat-s3c24xx/devs.c +++ b/trunk/arch/arm/plat-s3c24xx/devs.c @@ -372,20 +372,12 @@ static struct resource s3c_adc_resource[] = { }; struct platform_device s3c_device_adc = { - .name = "s3c24xx-adc", + .name = "s3c2410-adc", .id = -1, .num_resources = ARRAY_SIZE(s3c_adc_resource), .resource = s3c_adc_resource, }; -/* HWMON */ - -struct platform_device s3c_device_hwmon = { - .name = "s3c24xx-hwmon", - .id = -1, - .dev.parent = &s3c_device_adc.dev, -}; - /* SDI */ static struct resource s3c_sdi_resource[] = { @@ -411,36 +403,6 @@ struct platform_device s3c_device_sdi = { EXPORT_SYMBOL(s3c_device_sdi); -/* High-speed MMC/SD */ - -static struct resource s3c_hsmmc_resource[] = { - [0] = { - .start = S3C2443_PA_HSMMC, - .end = S3C2443_PA_HSMMC + S3C2443_SZ_HSMMC - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_S3C2443_HSMMC, - .end = IRQ_S3C2443_HSMMC, - .flags = IORESOURCE_IRQ, - } -}; - -static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL; - -struct platform_device s3c_device_hsmmc = { - .name = "s3c-sdhci", - .id = -1, - .num_resources = ARRAY_SIZE(s3c_hsmmc_resource), - .resource = s3c_hsmmc_resource, - .dev = { - .dma_mask = &s3c_device_hsmmc_dmamask, - .coherent_dma_mask = 0xffffffffUL - } -}; - - - /* SPI (0) */ static struct resource s3c_spi0_resource[] = { diff --git a/trunk/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h b/trunk/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h deleted file mode 100644 index a087de21bc20..000000000000 --- a/trunk/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h +++ /dev/null @@ -1,55 +0,0 @@ -/* linux/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h - * - * Copyright 2008 Simtec Electronics - * Ben Dooks - * http://armlinux.simtec.co.uk/ - * - * S3C24xx - pwm clock and timer support - */ - -/** - * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk - * @cfg: The timer TCFG1 register bits shifted down to 0. - * - * Return true if the given configuration from TCFG1 is a TCLK instead - * any of the TDIV clocks. - */ -static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) -{ - return tcfg == S3C2410_TCFG1_MUX_TCLK; -} - -/** - * tcfg_to_divisor() - convert tcfg1 setting to a divisor - * @tcfg1: The tcfg1 setting, shifted down. - * - * Get the divisor value for the given tcfg1 setting. We assume the - * caller has already checked to see if this is not a TCLK source. - */ -static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) -{ - return 1 << (1 + tcfg1); -} - -/** - * pwm_tdiv_has_div1() - does the tdiv setting have a /1 - * - * Return true if we have a /1 in the tdiv setting. - */ -static inline unsigned int pwm_tdiv_has_div1(void) -{ - return 0; -} - -/** - * pwm_tdiv_div_bits() - calculate TCFG1 divisor value. - * @div: The divisor to calculate the bit information for. - * - * Turn a divisor into the necessary bit field for TCFG1. - */ -static inline unsigned long pwm_tdiv_div_bits(unsigned int div) -{ - return ilog2(div) - 1; -} - -#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK diff --git a/trunk/arch/arm/plat-s3c24xx/s3c2410-clock.c b/trunk/arch/arm/plat-s3c24xx/s3c2410-clock.c index b61bdb793734..4e07943c1e29 100644 --- a/trunk/arch/arm/plat-s3c24xx/s3c2410-clock.c +++ b/trunk/arch/arm/plat-s3c24xx/s3c2410-clock.c @@ -272,6 +272,5 @@ int __init s3c2410_baseclk_add(void) (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on", (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on"); - s3c_pwmclk_init(); return 0; } diff --git a/trunk/arch/arm/plat-s3c64xx/clock.c b/trunk/arch/arm/plat-s3c64xx/clock.c index 5a1e97e1f8f6..2d2e83a036c4 100644 --- a/trunk/arch/arm/plat-s3c64xx/clock.c +++ b/trunk/arch/arm/plat-s3c64xx/clock.c @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -34,31 +33,10 @@ struct clk clk_27m = { .rate = 27000000, }; -static int clk_48m_ctrl(struct clk *clk, int enable) -{ - unsigned long flags; - u32 val; - - /* can't rely on clock lock, this register has other usages */ - local_irq_save(flags); - - val = __raw_readl(S3C64XX_OTHERS); - if (enable) - val |= S3C64XX_OTHERS_USBMASK; - else - val &= ~S3C64XX_OTHERS_USBMASK; - - __raw_writel(val, S3C64XX_OTHERS); - local_irq_restore(flags); - - return 0; -} - struct clk clk_48m = { .name = "clk_48m", .id = -1, .rate = 48000000, - .enable = clk_48m_ctrl, }; static int inline s3c64xx_gate(void __iomem *reg, @@ -277,6 +255,4 @@ void s3c64xx_register_clocks(void) (clkp->enable)(clkp, 0); } - - s3c_pwmclk_init(); } diff --git a/trunk/arch/arm/plat-s3c64xx/include/plat/pll.h b/trunk/arch/arm/plat-s3c64xx/include/plat/pll.h index 90bbd72fdc4e..1a8576422f17 100644 --- a/trunk/arch/arm/plat-s3c64xx/include/plat/pll.h +++ b/trunk/arch/arm/plat-s3c64xx/include/plat/pll.h @@ -12,9 +12,9 @@ * published by the Free Software Foundation. */ -#define S3C6400_PLL_MDIV_MASK ((1 << (25-16+1)) - 1) -#define S3C6400_PLL_PDIV_MASK ((1 << (13-8+1)) - 1) -#define S3C6400_PLL_SDIV_MASK ((1 << (2-0+1)) - 1) +#define S3C6400_PLL_MDIV_MASK ((1 << (25-16)) - 1) +#define S3C6400_PLL_PDIV_MASK ((1 << (13-8)) - 1) +#define S3C6400_PLL_SDIV_MASK ((1 << (2-0)) - 1) #define S3C6400_PLL_MDIV_SHIFT (16) #define S3C6400_PLL_PDIV_SHIFT (8) #define S3C6400_PLL_SDIV_SHIFT (0) diff --git a/trunk/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/trunk/arch/arm/plat-s3c64xx/include/plat/regs-clock.h index b1082c163247..78938a5e1d20 100644 --- a/trunk/arch/arm/plat-s3c64xx/include/plat/regs-clock.h +++ b/trunk/arch/arm/plat-s3c64xx/include/plat/regs-clock.h @@ -205,8 +205,8 @@ #define S3C6400_CLKSRC_MMC2_SHIFT (22) #define S3C6400_CLKSRC_MMC1_MASK (0x3 << 20) #define S3C6400_CLKSRC_MMC1_SHIFT (20) -#define S3C6400_CLKSRC_MMC0_MASK (0x3 << 18) -#define S3C6400_CLKSRC_MMC0_SHIFT (18) +#define S3C6400_CLKSRC_MMC0_MASK (0xf << 1) +#define S3C6400_CLKSRC_MMC0_SHIFT (1) #define S3C6400_CLKSRC_SPI1_MASK (0x3 << 16) #define S3C6400_CLKSRC_SPI1_SHIFT (16) #define S3C6400_CLKSRC_SPI0_MASK (0x3 << 14) diff --git a/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h b/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h deleted file mode 100644 index d8ed82917096..000000000000 --- a/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h +++ /dev/null @@ -1,24 +0,0 @@ -/* arch/arm/plat-s3c64xx/include/plat/regs-sys.h - * - * Copyright 2008 Openmoko, Inc. - * Copyright 2008 Simtec Electronics - * Ben Dooks - * http://armlinux.simtec.co.uk/ - * - * S3C64XX system register definitions - * - * 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. -*/ - -#ifndef __PLAT_REGS_SYS_H -#define __PLAT_REGS_SYS_H __FILE__ - -#define S3C_SYSREG(x) (S3C_VA_SYS + (x)) - -#define S3C64XX_OTHERS S3C_SYSREG(0x900) - -#define S3C64XX_OTHERS_USBMASK (1 << 16) - -#endif /* _PLAT_REGS_SYS_H */ diff --git a/trunk/arch/arm/plat-s3c64xx/irq-eint.c b/trunk/arch/arm/plat-s3c64xx/irq-eint.c index 1f7cc0067f5c..8c01f9cd94b6 100644 --- a/trunk/arch/arm/plat-s3c64xx/irq-eint.c +++ b/trunk/arch/arm/plat-s3c64xx/irq-eint.c @@ -82,7 +82,7 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) if (offs > 27) return -EINVAL; - if (offs <= 15) + if (offs > 15) reg = S3C64XX_EINT0CON0; else reg = S3C64XX_EINT0CON1; diff --git a/trunk/arch/arm/plat-s3c64xx/s3c6400-clock.c b/trunk/arch/arm/plat-s3c64xx/s3c6400-clock.c index 8d9a0cada668..64a9721cccb0 100644 --- a/trunk/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/trunk/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -620,7 +620,6 @@ static struct clk *clks[] __initdata = { &clk_iis_cd1, &clk_pcm_cd, &clk_mout_epll.clk, - &clk_fout_epll, &clk_mout_mpll.clk, &clk_dout_mpll, &clk_mmc0.clk,