Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231471
b: refs/heads/master
c: 0536d0d
h: refs/heads/master
i:
  231469: c193c1e
  231467: efbd2eb
  231463: 74037ae
  231455: 4a72378
v: v3
  • Loading branch information
Yauhen Kharuzhy authored and Kukjin Kim committed Jan 6, 2011
1 parent 6f83ca5 commit 6f4cf77
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 479c4f4aba27318d64698867a18865d29e3287a6
refs/heads/master: 0536d0d087c264f0edbb911fca6fff39bb2eb71b
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-s3c2443/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config CPU_S3C2443
select CPU_LLSERIAL_S3C2440
select SAMSUNG_CLKSRC
select S3C2443_CLOCK
select S3C_GPIO_PULL_S3C2443
help
Support for the S3C2443 SoC from the S3C24XX line

Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/arm/mach-s3c2443/s3c2443.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/serial_core.h>
#include <linux/sysdev.h>
Expand All @@ -32,6 +33,9 @@
#include <mach/regs-s3c2443-clock.h>
#include <mach/reset.h>

#include <plat/gpio-core.h>
#include <plat/gpio-cfg.h>
#include <plat/gpio-cfg-helpers.h>
#include <plat/s3c2443.h>
#include <plat/devs.h>
#include <plat/cpu.h>
Expand Down Expand Up @@ -86,6 +90,9 @@ void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)

void __init s3c2443_map_io(void)
{
s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443;
s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443;

iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
}

Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/plat-samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ config S3C_GPIO_PULL_UPDOWN
help
Internal configuration to enable the correct GPIO pull helper

config S3C_GPIO_PULL_S3C2443
bool
select S3C_GPIO_PULL_UPDOWN
help
Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO

config S3C_GPIO_PULL_DOWN
bool
help
Expand Down
42 changes: 42 additions & 0 deletions trunk/arch/arm/plat-samsung/gpio-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,48 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip,
pup &= 0x3;
return (__force s3c_gpio_pull_t)pup;
}

#ifdef CONFIG_S3C_GPIO_PULL_S3C2443
int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
unsigned int off, s3c_gpio_pull_t pull)
{
switch (pull) {
case S3C_GPIO_PULL_NONE:
pull = 0x01;
break;
case S3C_GPIO_PULL_UP:
pull = 0x00;
break;
case S3C_GPIO_PULL_DOWN:
pull = 0x02;
break;
}
return s3c_gpio_setpull_updown(chip, off, pull);
}

s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
unsigned int off)
{
s3c_gpio_pull_t pull;

pull = s3c_gpio_getpull_updown(chip, off);

switch (pull) {
case 0x00:
pull = S3C_GPIO_PULL_UP;
break;
case 0x01:
case 0x03:
pull = S3C_GPIO_PULL_NONE;
break;
case 0x02:
pull = S3C_GPIO_PULL_DOWN;
break;
}

return pull;
}
#endif
#endif

#if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ extern int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
* This helper function reads the state of the pull-{up,down} resistor for the
* given GPIO in the same case as s3c_gpio_setpull_upown.
*/
extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip *chip,
extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
unsigned int off);

#endif /* __PLAT_GPIO_CFG_HELPERS_H */
Expand Down

0 comments on commit 6f4cf77

Please sign in to comment.