Merge branch 'fixes/2637-rc5/s3c24xx' of git://git.fluff.org/bjdooks/linux

* 'fixes/2637-rc5/s3c24xx' of git://git.fluff.org/bjdooks/linux:
ARM: S3C24XX: Fix mess with gpio {set,get}_pull callbacks
ARM: mini2440: Fix Kconfig to allow kernel to build
ARM: S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition
ARM: S3C2443: Select properly ARM core type
ARM: SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST

+89 -21
+1 -1
arch/arm/mach-s3c2412/Kconfig
··· 16 config CPU_S3C2412_ONLY 17 bool 18 depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ 19 - !CPU_2416 && !CPU_S3C2440 && !CPU_S3C2442 && \ 20 !CPU_S3C2443 && CPU_S3C2412 21 default y if CPU_S3C2412 22
··· 16 config CPU_S3C2412_ONLY 17 bool 18 depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ 19 + !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \ 20 !CPU_S3C2443 && CPU_S3C2412 21 default y if CPU_S3C2412 22
+3
arch/arm/mach-s3c2416/Kconfig
··· 35 config MACH_SMDK2416 36 bool "SMDK2416" 37 select CPU_S3C2416 38 select S3C_DEV_FB 39 select S3C_DEV_HSMMC 40 select S3C_DEV_HSMMC1 41 select S3C2416_PM if PM 42 help 43 Say Y here if you are using an SMDK2416
··· 35 config MACH_SMDK2416 36 bool "SMDK2416" 37 select CPU_S3C2416 38 + select MACH_SMDK 39 select S3C_DEV_FB 40 select S3C_DEV_HSMMC 41 select S3C_DEV_HSMMC1 42 + select S3C_DEV_NAND 43 + select S3C_DEV_USB_HOST 44 select S3C2416_PM if PM 45 help 46 Say Y here if you are using an SMDK2416
+4
arch/arm/mach-s3c2440/Kconfig
··· 18 config CPU_S3C2442 19 bool 20 select CPU_ARM920T 21 select S3C2410_CLOCK 22 select S3C2410_GPIO 23 select S3C2410_PM if PM ··· 179 bool "MINI2440 development board" 180 select CPU_S3C2440 181 select EEPROM_AT24 182 select LEDS_TRIGGER_BACKLIGHT 183 select S3C_DEV_NAND 184 select S3C_DEV_USB_HOST
··· 18 config CPU_S3C2442 19 bool 20 select CPU_ARM920T 21 + select S3C_GPIO_PULL_DOWN 22 select S3C2410_CLOCK 23 select S3C2410_GPIO 24 select S3C2410_PM if PM ··· 178 bool "MINI2440 development board" 179 select CPU_S3C2440 180 select EEPROM_AT24 181 + select NEW_LEDS 182 + select LEDS_CLASS 183 + select LEDS_TRIGGER 184 select LEDS_TRIGGER_BACKLIGHT 185 select S3C_DEV_NAND 186 select S3C_DEV_USB_HOST
+8 -3
arch/arm/mach-s3c2440/s3c2440.c
··· 46 { 47 printk("S3C2440: Initialising architecture\n"); 48 49 - s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; 50 - s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; 51 - 52 /* change irq for watchdog */ 53 54 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; ··· 54 /* register our system device for everything else */ 55 56 return sysdev_register(&s3c2440_sysdev); 57 }
··· 46 { 47 printk("S3C2440: Initialising architecture\n"); 48 49 /* change irq for watchdog */ 50 51 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; ··· 57 /* register our system device for everything else */ 58 59 return sysdev_register(&s3c2440_sysdev); 60 + } 61 + 62 + void __init s3c2440_map_io(void) 63 + { 64 + s3c244x_map_io(); 65 + 66 + s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; 67 + s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; 68 }
+14
arch/arm/mach-s3c2440/s3c2442.c
··· 32 #include <linux/interrupt.h> 33 #include <linux/ioport.h> 34 #include <linux/mutex.h> 35 #include <linux/clk.h> 36 #include <linux/io.h> 37 ··· 44 45 #include <plat/clock.h> 46 #include <plat/cpu.h> 47 48 /* S3C2442 extended clock support */ 49 ··· 168 printk("S3C2442: Initialising architecture\n"); 169 170 return sysdev_register(&s3c2442_sysdev); 171 }
··· 32 #include <linux/interrupt.h> 33 #include <linux/ioport.h> 34 #include <linux/mutex.h> 35 + #include <linux/gpio.h> 36 #include <linux/clk.h> 37 #include <linux/io.h> 38 ··· 43 44 #include <plat/clock.h> 45 #include <plat/cpu.h> 46 + #include <plat/s3c244x.h> 47 + 48 + #include <plat/gpio-core.h> 49 + #include <plat/gpio-cfg.h> 50 + #include <plat/gpio-cfg-helpers.h> 51 52 /* S3C2442 extended clock support */ 53 ··· 162 printk("S3C2442: Initialising architecture\n"); 163 164 return sysdev_register(&s3c2442_sysdev); 165 + } 166 + 167 + void __init s3c2442_map_io(void) 168 + { 169 + s3c244x_map_io(); 170 + 171 + s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1down; 172 + s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1down; 173 }
+1
arch/arm/mach-s3c2443/Kconfig
··· 5 config CPU_S3C2443 6 bool 7 depends on ARCH_S3C2410 8 select S3C2443_DMA if S3C2410_DMA 9 select CPU_LLSERIAL_S3C2440 10 select SAMSUNG_CLKSRC
··· 5 config CPU_S3C2443 6 bool 7 depends on ARCH_S3C2410 8 + select CPU_ARM920T 9 select S3C2443_DMA if S3C2410_DMA 10 select CPU_LLSERIAL_S3C2440 11 select SAMSUNG_CLKSRC
+4 -4
arch/arm/plat-s3c24xx/cpu.c
··· 88 { 89 .idcode = 0x32440000, 90 .idmask = 0xffffffff, 91 - .map_io = s3c244x_map_io, 92 .init_clocks = s3c244x_init_clocks, 93 .init_uarts = s3c244x_init_uarts, 94 .init = s3c2440_init, ··· 97 { 98 .idcode = 0x32440001, 99 .idmask = 0xffffffff, 100 - .map_io = s3c244x_map_io, 101 .init_clocks = s3c244x_init_clocks, 102 .init_uarts = s3c244x_init_uarts, 103 .init = s3c2440_init, ··· 106 { 107 .idcode = 0x32440aaa, 108 .idmask = 0xffffffff, 109 - .map_io = s3c244x_map_io, 110 .init_clocks = s3c244x_init_clocks, 111 .init_uarts = s3c244x_init_uarts, 112 .init = s3c2442_init, ··· 115 { 116 .idcode = 0x32440aab, 117 .idmask = 0xffffffff, 118 - .map_io = s3c244x_map_io, 119 .init_clocks = s3c244x_init_clocks, 120 .init_uarts = s3c244x_init_uarts, 121 .init = s3c2442_init,
··· 88 { 89 .idcode = 0x32440000, 90 .idmask = 0xffffffff, 91 + .map_io = s3c2440_map_io, 92 .init_clocks = s3c244x_init_clocks, 93 .init_uarts = s3c244x_init_uarts, 94 .init = s3c2440_init, ··· 97 { 98 .idcode = 0x32440001, 99 .idmask = 0xffffffff, 100 + .map_io = s3c2440_map_io, 101 .init_clocks = s3c244x_init_clocks, 102 .init_uarts = s3c244x_init_uarts, 103 .init = s3c2440_init, ··· 106 { 107 .idcode = 0x32440aaa, 108 .idmask = 0xffffffff, 109 + .map_io = s3c2442_map_io, 110 .init_clocks = s3c244x_init_clocks, 111 .init_uarts = s3c244x_init_uarts, 112 .init = s3c2442_init, ··· 115 { 116 .idcode = 0x32440aab, 117 .idmask = 0xffffffff, 118 + .map_io = s3c2442_map_io, 119 .init_clocks = s3c244x_init_clocks, 120 .init_uarts = s3c244x_init_uarts, 121 .init = s3c2442_init,
-2
arch/arm/plat-s3c24xx/gpiolib.c
··· 82 struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { 83 .set_config = s3c_gpio_setcfg_s3c24xx, 84 .get_config = s3c_gpio_getcfg_s3c24xx, 85 - .set_pull = s3c_gpio_setpull_1up, 86 - .get_pull = s3c_gpio_getpull_1up, 87 }; 88 89 struct s3c_gpio_chip s3c24xx_gpios[] = {
··· 82 struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { 83 .set_config = s3c_gpio_setcfg_s3c24xx, 84 .get_config = s3c_gpio_getcfg_s3c24xx, 85 }; 86 87 struct s3c_gpio_chip s3c24xx_gpios[] = {
+6 -1
arch/arm/plat-s3c24xx/include/plat/s3c244x.h
··· 21 #else 22 #define s3c244x_init_clocks NULL 23 #define s3c244x_init_uarts NULL 24 - #define s3c244x_map_io NULL 25 #endif 26 27 #ifdef CONFIG_CPU_S3C2440 28 extern int s3c2440_init(void); 29 #else 30 #define s3c2440_init NULL 31 #endif 32 33 #ifdef CONFIG_CPU_S3C2442 34 extern int s3c2442_init(void); 35 #else 36 #define s3c2442_init NULL 37 #endif
··· 21 #else 22 #define s3c244x_init_clocks NULL 23 #define s3c244x_init_uarts NULL 24 #endif 25 26 #ifdef CONFIG_CPU_S3C2440 27 extern int s3c2440_init(void); 28 + 29 + extern void s3c2440_map_io(void); 30 #else 31 #define s3c2440_init NULL 32 + #define s3c2440_map_io NULL 33 #endif 34 35 #ifdef CONFIG_CPU_S3C2442 36 extern int s3c2442_init(void); 37 + 38 + extern void s3c2442_map_io(void); 39 #else 40 #define s3c2442_init NULL 41 + #define s3c2442_map_io NULL 42 #endif
+37 -10
arch/arm/plat-samsung/gpio-config.c
··· 280 } 281 #endif 282 283 - #ifdef CONFIG_S3C_GPIO_PULL_UP 284 - int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, 285 - unsigned int off, s3c_gpio_pull_t pull) 286 { 287 void __iomem *reg = chip->base + 0x08; 288 u32 pup = __raw_readl(reg); 289 290 - pup = __raw_readl(reg); 291 - 292 - if (pup == S3C_GPIO_PULL_UP) 293 pup &= ~(1 << off); 294 - else if (pup == S3C_GPIO_PULL_NONE) 295 pup |= (1 << off); 296 else 297 return -EINVAL; ··· 299 return 0; 300 } 301 302 - s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, 303 - unsigned int off) 304 { 305 void __iomem *reg = chip->base + 0x08; 306 u32 pup = __raw_readl(reg); 307 308 pup &= (1 << off); 309 - return pup ? S3C_GPIO_PULL_NONE : S3C_GPIO_PULL_UP; 310 } 311 #endif /* CONFIG_S3C_GPIO_PULL_UP */ 312 313 #ifdef CONFIG_S5P_GPIO_DRVSTR 314 s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
··· 280 } 281 #endif 282 283 + #if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN) 284 + static int s3c_gpio_setpull_1(struct s3c_gpio_chip *chip, 285 + unsigned int off, s3c_gpio_pull_t pull, 286 + s3c_gpio_pull_t updown) 287 { 288 void __iomem *reg = chip->base + 0x08; 289 u32 pup = __raw_readl(reg); 290 291 + if (pull == updown) 292 pup &= ~(1 << off); 293 + else if (pull == S3C_GPIO_PULL_NONE) 294 pup |= (1 << off); 295 else 296 return -EINVAL; ··· 300 return 0; 301 } 302 303 + static s3c_gpio_pull_t s3c_gpio_getpull_1(struct s3c_gpio_chip *chip, 304 + unsigned int off, s3c_gpio_pull_t updown) 305 { 306 void __iomem *reg = chip->base + 0x08; 307 u32 pup = __raw_readl(reg); 308 309 pup &= (1 << off); 310 + return pup ? S3C_GPIO_PULL_NONE : updown; 311 + } 312 + #endif /* CONFIG_S3C_GPIO_PULL_UP || CONFIG_S3C_GPIO_PULL_DOWN */ 313 + 314 + #ifdef CONFIG_S3C_GPIO_PULL_UP 315 + s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, 316 + unsigned int off) 317 + { 318 + return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_UP); 319 + } 320 + 321 + int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, 322 + unsigned int off, s3c_gpio_pull_t pull) 323 + { 324 + return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_UP); 325 } 326 #endif /* CONFIG_S3C_GPIO_PULL_UP */ 327 + 328 + #ifdef CONFIG_S3C_GPIO_PULL_DOWN 329 + s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip, 330 + unsigned int off) 331 + { 332 + return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_DOWN); 333 + } 334 + 335 + int s3c_gpio_setpull_1down(struct s3c_gpio_chip *chip, 336 + unsigned int off, s3c_gpio_pull_t pull) 337 + { 338 + return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_DOWN); 339 + } 340 + #endif /* CONFIG_S3C_GPIO_PULL_DOWN */ 341 342 #ifdef CONFIG_S5P_GPIO_DRVSTR 343 s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
+11
arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
··· 210 unsigned int off); 211 212 /** 213 * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. 214 * @chip: The gpio chip that is being configured. 215 * @off: The offset for the GPIO being configured.
··· 210 unsigned int off); 211 212 /** 213 + * s3c_gpio_getpull_1down() - Get configuration for choice of down or none 214 + * @chip: The gpio chip that the GPIO pin belongs to 215 + * @off: The offset to the pin to get the configuration of. 216 + * 217 + * This helper function reads the state of the pull-down resistor for the 218 + * given GPIO in the same case as s3c_gpio_setpull_1down. 219 + */ 220 + extern s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip, 221 + unsigned int off); 222 + 223 + /** 224 * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. 225 * @chip: The gpio chip that is being configured. 226 * @off: The offset for the GPIO being configured.