diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-09-27 11:51:26 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-09-27 11:51:26 +0100 |
commit | 464fc937c80ec25b1ac1a8c289a40a290e830e66 (patch) | |
tree | 81442d16f5c58207274949371ea6ec5089c757d8 /arch | |
parent | cd38bcdac64aec45575ed58de66db4a2fbf1914d (diff) | |
parent | fa5743d920385c2cf344bb1a0b964af8a9511d85 (diff) |
Merge commit 'refs/remotes/openmoko/andy-tracking' into drm-tracking
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/configs/gta01_moredrivers_defconfig | 8 | ||||
-rw-r--r-- | arch/arm/configs/gta02_micro_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/configs/gta02_moredrivers_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/configs/gta02_packaging_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-gta01.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2442/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/adc.h | 10 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/adc.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 1 |
11 files changed, 36 insertions, 17 deletions
diff --git a/arch/arm/configs/gta01_moredrivers_defconfig b/arch/arm/configs/gta01_moredrivers_defconfig index 36d2b170b52..411acab046f 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 @@ -1192,11 +1192,7 @@ CONFIG_SSB_POSSIBLE=y CONFIG_MFD_PCF50606=y CONFIG_PCF50606_ADC=y CONFIG_PCF50606_GPO=y -CONFIG_MFD_GLAMO=y -CONFIG_MFD_GLAMO_FB=y -CONFIG_MFD_GLAMO_SPI_GPIO=y -CONFIG_MFD_GLAMO_SPI_FB=y -CONFIG_MFD_GLAMO_MCI=y +# CONFIG_MFD_GLAMO is not set # # Multimedia devices 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/Kconfig b/arch/arm/mach-s3c2410/Kconfig index f4f7af180aa..02f406bea08 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig @@ -155,6 +155,7 @@ config MACH_NEO1973_GTA01 select PCF50606_WATCHDOG select POWER_SUPPLY select BATTERY_GTA01 + select S3C24XX_ADC help Say Y here if you are using the FIC Neo1973 GSM Phone diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c index 8a13a4adcfd..21726956ff6 100644 --- a/arch/arm/mach-s3c2410/mach-gta01.c +++ b/arch/arm/mach-s3c2410/mach-gta01.c @@ -560,6 +560,7 @@ static struct platform_device *gta01_devices[] __initdata = { &s3c_device_sdi, &s3c_device_usbgadget, &s3c_device_nand, + &s3c_device_adc, &s3c_device_ts, }; diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig index aa184ba7586..13fb5e190b4 100644 --- a/arch/arm/mach-s3c2442/Kconfig +++ b/arch/arm/mach-s3c2442/Kconfig @@ -36,6 +36,7 @@ config MACH_NEO1973_GTA02 select S3C_PWM select FIQ select S3C_DEV_USB_HOST + select S3C24XX_ADC help Say Y here if you are using the FIC Neo1973 GSM Phone diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 0a93749ef8c..42b8cea9ff1 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -1562,6 +1562,7 @@ static struct platform_device *gta02_devices[] __initdata = { &s3c_device_usbgadget, &s3c_device_nand, >a02_nor_flash, + &s3c_device_adc, &s3c24xx_pwm_device, >a02_led_dev, diff --git a/arch/arm/plat-s3c/include/plat/adc.h b/arch/arm/plat-s3c/include/plat/adc.h index 43df2a404b0..d847bd476b6 100644 --- a/arch/arm/plat-s3c/include/plat/adc.h +++ b/arch/arm/plat-s3c/include/plat/adc.h @@ -19,10 +19,12 @@ struct s3c_adc_client; extern int s3c_adc_start(struct s3c_adc_client *client, unsigned int channel, unsigned int nr_samples); -extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, - void (*select)(unsigned selected), - void (*conv)(unsigned d0, unsigned d1), - unsigned int is_ts); +extern struct s3c_adc_client * + s3c_adc_register(struct platform_device *pdev, + void (*select)(unsigned selected), + void (*conv)(unsigned d0, unsigned d1, + unsigned *samples_left), + unsigned int is_ts); extern void s3c_adc_release(struct s3c_adc_client *client); diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c index 9a5c767e0a4..9056bcc6c17 100644 --- a/arch/arm/plat-s3c24xx/adc.c +++ b/arch/arm/plat-s3c24xx/adc.c @@ -45,7 +45,8 @@ struct s3c_adc_client { unsigned char channel; void (*select_cb)(unsigned selected); - void (*convert_cb)(unsigned val1, unsigned val2); + void (*convert_cb)(unsigned val1, unsigned val2, + unsigned *samples_left); }; struct adc_device { @@ -57,6 +58,7 @@ struct adc_device { void __iomem *regs; unsigned int prescale; + unsigned int delay; int irq; }; @@ -67,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); } @@ -158,7 +169,8 @@ static void s3c_adc_default_select(unsigned select) struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, void (*select)(unsigned int selected), - void (*conv)(unsigned d0, unsigned d1), + void (*conv)(unsigned d0, unsigned d1, + unsigned *samples_left), unsigned int is_ts) { struct s3c_adc_client *client; @@ -210,9 +222,10 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) data1 = readl(adc->regs + S3C2410_ADCDAT1); adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); - (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff); + client->nr_samples--; + (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff, &client->nr_samples); - if (--client->nr_samples > 0) { + if (client->nr_samples > 0) { /* fire another conversion for this */ client->select_cb(1); @@ -244,6 +257,7 @@ static int s3c_adc_probe(struct platform_device *pdev) adc->pdev = pdev; adc->prescale = S3C2410_ADCCON_PRSCVL(49); + adc->delay = 0x2710; adc->irq = platform_get_irq(pdev, 1); if (adc->irq <= 0) { @@ -283,6 +297,7 @@ static int s3c_adc_probe(struct platform_device *pdev) writel(adc->prescale | S3C2410_ADCCON_PRSCEN, adc->regs + S3C2410_ADCCON); + writel(adc->delay, adc->regs + S3C2410_ADCDLY); dev_info(dev, "attached adc driver\n"); @@ -338,6 +353,7 @@ static int s3c_adc_resume(struct platform_device *pdev) writel(adc->prescale | S3C2410_ADCCON_PRSCEN, adc->regs + S3C2410_ADCCON); + writel(adc->delay, adc->regs + S3C2410_ADCDLY); return 0; } 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); |