aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-09-18 01:45:39 -0500
committerNelson Castillo <arhuaco@freaks-unidos.net>2009-09-22 23:08:06 -0500
commit7ddf2bb46771e10d4cc7da94b3c1210426806def (patch)
tree01c461e2cbeaf743b11a4832817dab9934895d82 /arch
parent16e3d48d8ff84d279483b237c1e509ff1388eca2 (diff)
Make s3c TS driver use s3c-adc API
I had a patch by Vasily Khoruzhick <anarsoul@gmail.com> in the linux-arm-kernel as a guide for some of the changes. Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/gta01_moredrivers_defconfig2
-rw-r--r--arch/arm/configs/gta02_micro_defconfig2
-rw-r--r--arch/arm/configs/gta02_moredrivers_defconfig2
-rw-r--r--arch/arm/configs/gta02_packaging_defconfig2
-rw-r--r--arch/arm/mach-s3c2410/mach-gta01.c4
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c3
-rw-r--r--arch/arm/plat-s3c24xx/adc.c9
-rw-r--r--arch/arm/plat-s3c24xx/devs.c1
8 files changed, 21 insertions, 4 deletions
diff --git a/arch/arm/configs/gta01_moredrivers_defconfig b/arch/arm/configs/gta01_moredrivers_defconfig
index 36d2b170b52..0ed35d8bd1b 100644
--- a/arch/arm/configs/gta01_moredrivers_defconfig
+++ b/arch/arm/configs/gta01_moredrivers_defconfig
@@ -180,7 +180,7 @@ CONFIG_S3C2410_CLOCK=y
CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
-# CONFIG_S3C24XX_ADC is not set
+CONFIG_S3C24XX_ADC=y
CONFIG_MACH_NEO1973=y
CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2410_ONLY=y
diff --git a/arch/arm/configs/gta02_micro_defconfig b/arch/arm/configs/gta02_micro_defconfig
index ae30c4b1ddb..6a6ff77ea2c 100644
--- a/arch/arm/configs/gta02_micro_defconfig
+++ b/arch/arm/configs/gta02_micro_defconfig
@@ -158,7 +158,7 @@ CONFIG_S3C24XX_PWM=y
CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
-# CONFIG_S3C24XX_ADC is not set
+CONFIG_S3C24XX_ADC=y
CONFIG_MACH_NEO1973=y
CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
diff --git a/arch/arm/configs/gta02_moredrivers_defconfig b/arch/arm/configs/gta02_moredrivers_defconfig
index bd66869f74a..13b41215faa 100644
--- a/arch/arm/configs/gta02_moredrivers_defconfig
+++ b/arch/arm/configs/gta02_moredrivers_defconfig
@@ -180,7 +180,7 @@ CONFIG_S3C24XX_PWM=y
CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
-# CONFIG_S3C24XX_ADC is not set
+CONFIG_S3C24XX_ADC=y
CONFIG_MACH_SMDK=y
CONFIG_MACH_NEO1973=y
CONFIG_PLAT_S3C=y
diff --git a/arch/arm/configs/gta02_packaging_defconfig b/arch/arm/configs/gta02_packaging_defconfig
index 15defd28841..03c72d5652b 100644
--- a/arch/arm/configs/gta02_packaging_defconfig
+++ b/arch/arm/configs/gta02_packaging_defconfig
@@ -180,7 +180,7 @@ CONFIG_S3C24XX_PWM=y
CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
-# CONFIG_S3C24XX_ADC is not set
+CONFIG_S3C24XX_ADC=y
CONFIG_MACH_SMDK=y
CONFIG_MACH_NEO1973=y
CONFIG_PLAT_S3C=y
diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
index 8a13a4adcfd..339eb845744 100644
--- a/arch/arm/mach-s3c2410/mach-gta01.c
+++ b/arch/arm/mach-s3c2410/mach-gta01.c
@@ -993,6 +993,10 @@ static void __init gta01_machine_init(void)
printk(KERN_DEBUG "Enabled GSM wakeup IRQ %d (rc=%d)\n",
GTA01_IRQ_MODEM, rc);
+#ifdef CONFIG_S3C24XX_ADC
+ platform_device_register(&s3c_device_adc);
+#endif
+
pm_power_off = &gta01_power_off;
}
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index e4f052595bd..346c2298b08 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -1717,6 +1717,9 @@ static void __init gta02_machine_init(void)
gta02_vibrator_dev.dev.parent = &s3c24xx_pwm_device.dev;
platform_device_register(&gta02_vibrator_dev);
#endif
+#ifdef CONFIG_S3C24XX_ADC
+ platform_device_register(&s3c_device_adc);
+#endif
}
void DEBUG_LED(int n)
diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index a9eec95f70d..9056bcc6c17 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -69,10 +69,19 @@ static LIST_HEAD(adc_pending);
#define adc_dbg(_adc, msg...) dev_dbg(&(_adc)->pdev->dev, msg)
+#define AUTOPST (S3C2410_ADCTSC_YM_SEN | S3C2410_ADCTSC_YP_SEN | \
+ S3C2410_ADCTSC_XP_SEN | S3C2410_ADCTSC_AUTO_PST | \
+ S3C2410_ADCTSC_XY_PST(0))
+
+
static inline void s3c_adc_convert(struct adc_device *adc)
{
unsigned con = readl(adc->regs + S3C2410_ADCCON);
+ if (adc->cur->is_ts)
+ writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST,
+ adc->regs + S3C2410_ADCTSC);
+
con |= S3C2410_ADCCON_ENABLE_START;
writel(con, adc->regs + S3C2410_ADCCON);
}
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 0fdaa54ada9..eeb95f863ce 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -205,6 +205,7 @@ EXPORT_SYMBOL(s3c_device_nand);
struct platform_device s3c_device_ts = {
.name = "s3c2410-ts",
.id = -1,
+ .dev.parent = &s3c_device_adc.dev,
};
EXPORT_SYMBOL(s3c_device_ts);