diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-01-13 18:30:34 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-17 19:30:49 -0500 |
commit | bcedfa98d97e02e95bb023ab93675dbe63c508ef (patch) | |
tree | 982ad45ce6abce817a7c9d3636d3c7407fa143fa /arch/arm/plat-samsung/adc.c | |
parent | 3929e1e76d9116856a4c7a00fcce0539dd8507a0 (diff) |
ARM: S3C64XX: Add S3C64XX support to the generic Samsung ADC driver
Add S3C64XX support to the generic Samsung ADC driver
Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-samsung/adc.c')
-rw-r--r-- | arch/arm/plat-samsung/adc.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index a8843dd5e1e7..120b7902fc2f 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c | |||
@@ -37,6 +37,11 @@ | |||
37 | * action is required. | 37 | * action is required. |
38 | */ | 38 | */ |
39 | 39 | ||
40 | enum s3c_cpu_type { | ||
41 | TYPE_S3C24XX, | ||
42 | TYPE_S3C64XX | ||
43 | }; | ||
44 | |||
40 | struct s3c_adc_client { | 45 | struct s3c_adc_client { |
41 | struct platform_device *pdev; | 46 | struct platform_device *pdev; |
42 | struct list_head pend; | 47 | struct list_head pend; |
@@ -262,7 +267,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) | |||
262 | 267 | ||
263 | if (!client) { | 268 | if (!client) { |
264 | dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__); | 269 | dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__); |
265 | return IRQ_HANDLED; | 270 | goto exit; |
266 | } | 271 | } |
267 | 272 | ||
268 | data0 = readl(adc->regs + S3C2410_ADCDAT0); | 273 | data0 = readl(adc->regs + S3C2410_ADCDAT0); |
@@ -289,6 +294,11 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) | |||
289 | local_irq_restore(flags); | 294 | local_irq_restore(flags); |
290 | } | 295 | } |
291 | 296 | ||
297 | exit: | ||
298 | if (platform_get_device_id(client->pdev)->driver_data == TYPE_S3C64XX) { | ||
299 | /* Clear ADC interrupt */ | ||
300 | writel(0, adc->regs + S3C64XX_ADCCLRINT); | ||
301 | } | ||
292 | return IRQ_HANDLED; | 302 | return IRQ_HANDLED; |
293 | } | 303 | } |
294 | 304 | ||
@@ -410,9 +420,22 @@ static int s3c_adc_resume(struct platform_device *pdev) | |||
410 | #define s3c_adc_resume NULL | 420 | #define s3c_adc_resume NULL |
411 | #endif | 421 | #endif |
412 | 422 | ||
423 | static struct platform_device_id s3c_adc_driver_ids[] = { | ||
424 | { | ||
425 | .name = "s3c24xx-adc", | ||
426 | .driver_data = TYPE_S3C24XX, | ||
427 | }, { | ||
428 | .name = "s3c64xx-adc", | ||
429 | .driver_data = TYPE_S3C64XX, | ||
430 | }, | ||
431 | { } | ||
432 | }; | ||
433 | MODULE_DEVICE_TABLE(platform, s3c_adc_driver_ids); | ||
434 | |||
413 | static struct platform_driver s3c_adc_driver = { | 435 | static struct platform_driver s3c_adc_driver = { |
436 | .id_table = s3c_adc_driver_ids, | ||
414 | .driver = { | 437 | .driver = { |
415 | .name = "s3c24xx-adc", | 438 | .name = "s3c-adc", |
416 | .owner = THIS_MODULE, | 439 | .owner = THIS_MODULE, |
417 | }, | 440 | }, |
418 | .probe = s3c_adc_probe, | 441 | .probe = s3c_adc_probe, |