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