diff options
| -rw-r--r-- | arch/arm/mach-s3c2410/h1940-bluetooth.c | 13 | ||||
| -rw-r--r-- | arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 57 | ||||
| -rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 169 | ||||
| -rw-r--r-- | arch/arm/mach-s3c2440/Kconfig | 7 | ||||
| -rw-r--r-- | arch/arm/mach-s3c2440/mach-rx1950.c | 218 | ||||
| -rw-r--r-- | arch/arm/plat-s3c24xx/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/plat-s3c24xx/gpiolib.c | 2 |
7 files changed, 399 insertions, 68 deletions
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c index 8cdeb14af592..8aa2f1902a94 100644 --- a/arch/arm/mach-s3c2410/h1940-bluetooth.c +++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c | |||
| @@ -30,7 +30,7 @@ static void h1940bt_enable(int on) | |||
| 30 | { | 30 | { |
| 31 | if (on) { | 31 | if (on) { |
| 32 | /* Power on the chip */ | 32 | /* Power on the chip */ |
| 33 | h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); | 33 | gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 1); |
| 34 | /* Reset the chip */ | 34 | /* Reset the chip */ |
| 35 | mdelay(10); | 35 | mdelay(10); |
| 36 | 36 | ||
| @@ -43,7 +43,7 @@ static void h1940bt_enable(int on) | |||
| 43 | mdelay(10); | 43 | mdelay(10); |
| 44 | gpio_set_value(S3C2410_GPH(1), 0); | 44 | gpio_set_value(S3C2410_GPH(1), 0); |
| 45 | mdelay(10); | 45 | mdelay(10); |
| 46 | h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); | 46 | gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0); |
| 47 | } | 47 | } |
| 48 | } | 48 | } |
| 49 | 49 | ||
| @@ -64,7 +64,14 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) | |||
| 64 | 64 | ||
| 65 | ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); | 65 | ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); |
| 66 | if (ret) { | 66 | if (ret) { |
| 67 | dev_err(&pdev->dev, "could not get GPH1\n");\ | 67 | dev_err(&pdev->dev, "could not get GPH1\n"); |
| 68 | return ret; | ||
| 69 | } | ||
| 70 | |||
| 71 | ret = gpio_request(H1940_LATCH_BLUETOOTH_POWER, dev_name(&pdev->dev)); | ||
| 72 | if (ret) { | ||
| 73 | gpio_free(S3C2410_GPH(1)); | ||
| 74 | dev_err(&pdev->dev, "could not get BT_POWER\n"); | ||
| 68 | return ret; | 75 | return ret; |
| 69 | } | 76 | } |
| 70 | 77 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h b/arch/arm/mach-s3c2410/include/mach/h1940-latch.h index d8a832729a8a..97e42bfce81e 100644 --- a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h +++ b/arch/arm/mach-s3c2410/include/mach/h1940-latch.h | |||
| @@ -14,51 +14,30 @@ | |||
| 14 | #ifndef __ASM_ARCH_H1940_LATCH_H | 14 | #ifndef __ASM_ARCH_H1940_LATCH_H |
| 15 | #define __ASM_ARCH_H1940_LATCH_H | 15 | #define __ASM_ARCH_H1940_LATCH_H |
| 16 | 16 | ||
| 17 | #include <mach/gpio.h> | ||
| 17 | 18 | ||
| 18 | #ifndef __ASSEMBLY__ | 19 | #define H1940_LATCH_GPIO(x) (S3C_GPIO_END + (x)) |
| 19 | #define H1940_LATCH ((void __force __iomem *)0xF8000000) | ||
| 20 | #else | ||
| 21 | #define H1940_LATCH 0xF8000000 | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #define H1940_PA_LATCH (S3C2410_CS2) | ||
| 25 | 20 | ||
| 26 | /* SD layer latch */ | 21 | /* SD layer latch */ |
| 27 | 22 | ||
| 28 | #define H1940_LATCH_SDQ1 (1<<16) | 23 | #define H1940_LATCH_LCD_P0 H1940_LATCH_GPIO(0) |
| 29 | #define H1940_LATCH_LCD_P1 (1<<17) | 24 | #define H1940_LATCH_LCD_P1 H1940_LATCH_GPIO(1) |
| 30 | #define H1940_LATCH_LCD_P2 (1<<18) | 25 | #define H1940_LATCH_LCD_P2 H1940_LATCH_GPIO(2) |
| 31 | #define H1940_LATCH_LCD_P3 (1<<19) | 26 | #define H1940_LATCH_LCD_P3 H1940_LATCH_GPIO(3) |
| 32 | #define H1940_LATCH_MAX1698_nSHUTDOWN (1<<20) /* LCD backlight */ | 27 | #define H1940_LATCH_MAX1698_nSHUTDOWN H1940_LATCH_GPIO(4) |
| 33 | #define H1940_LATCH_LED_RED (1<<21) | 28 | #define H1940_LATCH_LED_RED H1940_LATCH_GPIO(5) |
| 34 | #define H1940_LATCH_SDQ7 (1<<22) | 29 | #define H1940_LATCH_SDQ7 H1940_LATCH_GPIO(6) |
| 35 | #define H1940_LATCH_USB_DP (1<<23) | 30 | #define H1940_LATCH_USB_DP H1940_LATCH_GPIO(7) |
| 36 | 31 | ||
| 37 | /* CPU layer latch */ | 32 | /* CPU layer latch */ |
| 38 | 33 | ||
| 39 | #define H1940_LATCH_UDA_POWER (1<<24) | 34 | #define H1940_LATCH_UDA_POWER H1940_LATCH_GPIO(8) |
| 40 | #define H1940_LATCH_AUDIO_POWER (1<<25) | 35 | #define H1940_LATCH_AUDIO_POWER H1940_LATCH_GPIO(9) |
| 41 | #define H1940_LATCH_SM803_ENABLE (1<<26) | 36 | #define H1940_LATCH_SM803_ENABLE H1940_LATCH_GPIO(10) |
| 42 | #define H1940_LATCH_LCD_P4 (1<<27) | 37 | #define H1940_LATCH_LCD_P4 H1940_LATCH_GPIO(11) |
| 43 | #define H1940_LATCH_CPUQ5 (1<<28) /* untraced */ | 38 | #define H1940_LATCH_SD_POWER H1940_LATCH_GPIO(12) |
| 44 | #define H1940_LATCH_BLUETOOTH_POWER (1<<29) /* active high */ | 39 | #define H1940_LATCH_BLUETOOTH_POWER H1940_LATCH_GPIO(13) |
| 45 | #define H1940_LATCH_LED_GREEN (1<<30) | 40 | #define H1940_LATCH_LED_GREEN H1940_LATCH_GPIO(14) |
| 46 | #define H1940_LATCH_LED_FLASH (1<<31) | 41 | #define H1940_LATCH_LED_FLASH H1940_LATCH_GPIO(15) |
| 47 | |||
| 48 | /* default settings */ | ||
| 49 | |||
| 50 | #define H1940_LATCH_DEFAULT \ | ||
| 51 | H1940_LATCH_LCD_P4 | \ | ||
| 52 | H1940_LATCH_SM803_ENABLE | \ | ||
| 53 | H1940_LATCH_SDQ1 | \ | ||
| 54 | H1940_LATCH_LCD_P1 | \ | ||
| 55 | H1940_LATCH_LCD_P2 | \ | ||
| 56 | H1940_LATCH_LCD_P3 | \ | ||
| 57 | H1940_LATCH_MAX1698_nSHUTDOWN | \ | ||
| 58 | H1940_LATCH_CPUQ5 | ||
| 59 | |||
| 60 | /* control functions */ | ||
| 61 | |||
| 62 | extern void h1940_latch_control(unsigned int clear, unsigned int set); | ||
| 63 | 42 | ||
| 64 | #endif /* __ASM_ARCH_H1940_LATCH_H */ | 43 | #endif /* __ASM_ARCH_H1940_LATCH_H */ |
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 98c5c9e81ee9..d7ada8c7e41f 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
| 25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
| 26 | #include <linux/pwm_backlight.h> | 26 | #include <linux/pwm_backlight.h> |
| 27 | #include <linux/i2c.h> | ||
| 27 | #include <video/platform_lcd.h> | 28 | #include <video/platform_lcd.h> |
| 28 | 29 | ||
| 29 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
| @@ -59,6 +60,14 @@ | |||
| 59 | #include <plat/mci.h> | 60 | #include <plat/mci.h> |
| 60 | #include <plat/ts.h> | 61 | #include <plat/ts.h> |
| 61 | 62 | ||
| 63 | #include <sound/uda1380.h> | ||
| 64 | |||
| 65 | #define H1940_LATCH ((void __force __iomem *)0xF8000000) | ||
| 66 | |||
| 67 | #define H1940_PA_LATCH S3C2410_CS2 | ||
| 68 | |||
| 69 | #define H1940_LATCH_BIT(x) (1 << ((x) + 16 - S3C_GPIO_END)) | ||
| 70 | |||
| 62 | static struct map_desc h1940_iodesc[] __initdata = { | 71 | static struct map_desc h1940_iodesc[] __initdata = { |
| 63 | [0] = { | 72 | [0] = { |
| 64 | .virtual = (unsigned long)H1940_LATCH, | 73 | .virtual = (unsigned long)H1940_LATCH, |
| @@ -100,9 +109,9 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] __initdata = { | |||
| 100 | 109 | ||
| 101 | /* Board control latch control */ | 110 | /* Board control latch control */ |
| 102 | 111 | ||
| 103 | static unsigned int latch_state = H1940_LATCH_DEFAULT; | 112 | static unsigned int latch_state; |
| 104 | 113 | ||
| 105 | void h1940_latch_control(unsigned int clear, unsigned int set) | 114 | static void h1940_latch_control(unsigned int clear, unsigned int set) |
| 106 | { | 115 | { |
| 107 | unsigned long flags; | 116 | unsigned long flags; |
| 108 | 117 | ||
| @@ -116,7 +125,42 @@ void h1940_latch_control(unsigned int clear, unsigned int set) | |||
| 116 | local_irq_restore(flags); | 125 | local_irq_restore(flags); |
| 117 | } | 126 | } |
| 118 | 127 | ||
| 119 | EXPORT_SYMBOL_GPL(h1940_latch_control); | 128 | static inline int h1940_gpiolib_to_latch(int offset) |
| 129 | { | ||
| 130 | return 1 << (offset + 16); | ||
| 131 | } | ||
| 132 | |||
| 133 | static void h1940_gpiolib_latch_set(struct gpio_chip *chip, | ||
| 134 | unsigned offset, int value) | ||
| 135 | { | ||
| 136 | int latch_bit = h1940_gpiolib_to_latch(offset); | ||
| 137 | |||
| 138 | h1940_latch_control(value ? 0 : latch_bit, | ||
| 139 | value ? latch_bit : 0); | ||
