Add S3C64XX support to the generic Samsung ADC driver
Subsystems (3)
PATCH 2/2 Add S3C64XX support to the generic Samsung ADC driver
Add S3C64XX support to the generic Samsung ADC driver
Signed-off-by Maurus Cuelenaere <[email protected]>
--- arch/arm/mach-s3c6400/include/mach/map.h | 1 + arch/arm/plat-s3c/include/plat/regs-adc.h | 3 ++ arch/arm/plat-s3c64xx/Makefile | 4 ++ arch/arm/plat-s3c64xx/dev-adc.c | 46 +++++++++++++++++++++++++++++ arch/arm/plat-samsung/adc.c | 27 +++++++++++++++- 5 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 arch/arm/plat-s3c64xx/dev-adc.c
(quoted diff) +0 -0
b/arch/arm/mach-s3c6400/include/mach/map.h
index d4cd3ab..5a35f24 100644
arch/arm/mach-s3c6400/include/mach/map.h +1 -0
@@ -42,6 +42,7 @@#define S3C64XX_PA_FB (0x77100000)#define S3C64XX_PA_USB_HSOTG (0x7C000000)#define S3C64XX_PA_WATCHDOG (0x7E004000) +#define S3C64XX_PA_ADC (0x7E00B000)#define S3C64XX_PA_SYSCON (0x7E00F000)#define S3C64XX_PA_AC97 (0x7F001000)#define S3C64XX_PA_IIS0 (0x7F002000)
(quoted diff) +0 -0
b/arch/arm/plat-s3c/include/plat/regs-adc.h
index 4323ccc..f43c8da 100644
arch/arm/plat-s3c/include/plat/regs-adc.h +3 -0
@@ -19,6 +19,9 @@#define S3C2410_ADCDLY S3C2410_ADCREG(0x08)#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) +#define S3C64XX_ADCUPDN S3C2410_ADCREG(0x14) +#define S3C64XX_ADCCLRINT S3C2410_ADCREG(0x18) +#define S3C64XX_ADCCLRINTPNDNUP S3C2410_ADCREG(0x20)/* ADCCON Register Bits */
arch/arm/plat-s3c64xx/Makefile +4 -0
@@ -35,6 +35,10 @@ obj-$(CONFIG_PM) += irq-pm.o obj-$(CONFIG_S3C64XX_DMA) += dma.o +# ADC support + +obj-$(CONFIG_S3C_ADC) += dev-adc.o + # Device setup obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
arch/arm/plat-s3c64xx/dev-adc.c new file +46 -0
46 lines not on this page · raw message
arch/arm/plat-samsung/adc.c +25 -2
@@ -37,6 +37,11 @@* action is required. */ +enum s3c_cpu_type { +TYPE_S3C24XX , +TYPE_S3C64XX +}; +struct s3c_adc_client {struct platform_device *pdev;struct list_head pend;
@@ -262,7 +267,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)if (!client) {dev_warn (&adc->pdev->dev,"%s: no adc pending\n" , __func__); -return IRQ_HANDLED ; + goto exit; } data0 =readl (adc->regs +S3C2410_ADCDAT0 );
@@ -289,6 +294,11 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)local_irq_restore (flags); } +exit: +if (platform_get_device_id (client->pdev)->driver_data ==TYPE_S3C64XX ) { +/* Clear ADC interrupt */ +writel (0 , adc->regs +S3C64XX_ADCCLRINT ); + }return IRQ_HANDLED ; }
@@ -410,9 +420,22 @@ static int s3c_adc_resume(struct platform_device *pdev)#define s3c_adc_resume NULL#endif +static struct platform_device_id s3c_adc_driver_ids[] = { + { + .name ="s3c24xx-adc" , + .driver_data =TYPE_S3C24XX , + }, { + .name ="s3c64xx-adc" , + .driver_data =TYPE_S3C64XX , + }, + { } +}; +MODULE_DEVICE_TABLE (platform, s3c_adc_driver_ids); +static struct platform_driver s3c_adc_driver = { + .id_table = s3c_adc_driver_ids, .driver = { - .name ="s3c24xx-adc" , + .name ="s3c-adc" , .owner =THIS_MODULE , }, .probe = s3c_adc_probe,
Signature · 1 line
1.6.6