Commit 8e2376ab authored by Ben Dooks's avatar Ben Dooks

ARM: Merge next-samsung-mc-adc

Merge branch 'next-samsung-mc-adc' into next-samsung-try5

Conflicts:
	arch/arm/mach-s3c6400/include/mach/map.h
	(fix ADC and RTC merge)
parents 71269364 bcedfa98
...@@ -184,7 +184,7 @@ CONFIG_S3C24XX_PWM=y ...@@ -184,7 +184,7 @@ CONFIG_S3C24XX_PWM=y
CONFIG_S3C24XX_GPIO_EXTRA=0 CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set # CONFIG_S3C2410_DMA_DEBUG is not set
CONFIG_S3C24XX_ADC=y CONFIG_S3C_ADC=y
CONFIG_PLAT_S3C=y CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
CONFIG_CPU_LLSERIAL_S3C2440=y CONFIG_CPU_LLSERIAL_S3C2440=y
......
...@@ -187,7 +187,7 @@ CONFIG_S3C24XX_GPIO_EXTRA128=y ...@@ -187,7 +187,7 @@ CONFIG_S3C24XX_GPIO_EXTRA128=y
CONFIG_PM_SIMTEC=y CONFIG_PM_SIMTEC=y
CONFIG_S3C2410_DMA=y CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set # CONFIG_S3C2410_DMA_DEBUG is not set
CONFIG_S3C24XX_ADC=y CONFIG_S3C_ADC=y
CONFIG_MACH_SMDK=y CONFIG_MACH_SMDK=y
CONFIG_PLAT_S3C=y CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2410=y CONFIG_CPU_LLSERIAL_S3C2410=y
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define S3C64XX_PA_USB_HSOTG (0x7C000000) #define S3C64XX_PA_USB_HSOTG (0x7C000000)
#define S3C64XX_PA_WATCHDOG (0x7E004000) #define S3C64XX_PA_WATCHDOG (0x7E004000)
#define S3C64XX_PA_RTC (0x7E005000) #define S3C64XX_PA_RTC (0x7E005000)
#define S3C64XX_PA_ADC (0x7E00B000)
#define S3C64XX_PA_SYSCON (0x7E00F000) #define S3C64XX_PA_SYSCON (0x7E00F000)
#define S3C64XX_PA_AC97 (0x7F001000) #define S3C64XX_PA_AC97 (0x7F001000)
#define S3C64XX_PA_IIS0 (0x7F002000) #define S3C64XX_PA_IIS0 (0x7F002000)
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#define S3C2410_ADCDLY S3C2410_ADCREG(0x08) #define S3C2410_ADCDLY S3C2410_ADCREG(0x08)
#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C) #define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)
#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) #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 */ /* ADCCON Register Bits */
......
...@@ -117,13 +117,6 @@ config S3C2410_DMA_DEBUG ...@@ -117,13 +117,6 @@ config S3C2410_DMA_DEBUG
Enable debugging output for the DMA code. This option sends info Enable debugging output for the DMA code. This option sends info
to the kernel log, at priority KERN_DEBUG. to the kernel log, at priority KERN_DEBUG.
config S3C24XX_ADC
bool "ADC common driver support"
help
Core support for the ADC block found in the S3C24XX SoC systems
for drivers such as the touchscreen and hwmon to use to share
this resource.
# SPI default pin configuration code # SPI default pin configuration code
config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13 config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
......
...@@ -38,7 +38,6 @@ obj-$(CONFIG_PM) += irq-pm.o ...@@ -38,7 +38,6 @@ obj-$(CONFIG_PM) += irq-pm.o
obj-$(CONFIG_PM) += sleep.o obj-$(CONFIG_PM) += sleep.o
obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
obj-$(CONFIG_S3C2410_DMA) += dma.o obj-$(CONFIG_S3C2410_DMA) += dma.o
obj-$(CONFIG_S3C24XX_ADC) += adc.o
obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
......
...@@ -36,6 +36,10 @@ obj-$(CONFIG_PM) += irq-pm.o ...@@ -36,6 +36,10 @@ obj-$(CONFIG_PM) += irq-pm.o
obj-$(CONFIG_S3C64XX_DMA) += dma.o obj-$(CONFIG_S3C64XX_DMA) += dma.o
# ADC support
obj-$(CONFIG_S3C_ADC) += dev-adc.o
# Device setup # Device setup
obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
......
/* linux/arch/arm/plat-s3c64xx/dev-adc.c
*
* Copyright 2010 Maurus Cuelenaere
*
* S3C64xx series device definition for ADC device
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/platform_device.h>
#include <mach/irqs.h>
#include <mach/map.h>
#include <plat/adc.h>
#include <plat/devs.h>
#include <plat/cpu.h>
static struct resource s3c_adc_resource[] = {
[0] = {
.start = S3C64XX_PA_ADC,
.end = S3C64XX_PA_ADC + SZ_256 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TC,
.end = IRQ_TC,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_ADC,
.end = IRQ_ADC,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device s3c_device_adc = {
.name = "s3c64xx-adc",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_adc_resource),
.resource = s3c_adc_resource,
};
...@@ -74,6 +74,15 @@ config SAMSUNG_GPIO_EXTRA ...@@ -74,6 +74,15 @@ config SAMSUNG_GPIO_EXTRA
provides. This allows expanding the GPIO space for use with provides. This allows expanding the GPIO space for use with
GPIO expanders. GPIO expanders.
# ADC driver
config S3C_ADC
bool "ADC common driver support"
help
Core support for the ADC block found in the Samsung SoC systems
for drivers such as the touchscreen and hwmon to use to share
this resource.
# device definitions to compile in # device definitions to compile in
config S3C_DEV_HSMMC config S3C_DEV_HSMMC
......
...@@ -20,6 +20,10 @@ obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o ...@@ -20,6 +20,10 @@ obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
obj-$(CONFIG_SAMSUNG_IRQ_UART) += irq-uart.o obj-$(CONFIG_SAMSUNG_IRQ_UART) += irq-uart.o
obj-$(CONFIG_SAMSUNG_IRQ_VIC_TIMER) += irq-vic-timer.o obj-$(CONFIG_SAMSUNG_IRQ_VIC_TIMER) += irq-vic-timer.o
# ADC
obj-$(CONFIG_S3C_ADC) += adc.o
# devices # devices
obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
......
/* arch/arm/plat-s3c24xx/adc.c /* arch/arm/plat-samsung/adc.c
* *
* Copyright (c) 2008 Simtec Electronics * Copyright (c) 2008 Simtec Electronics
* http://armlinux.simtec.co.uk/ * http://armlinux.simtec.co.uk/
* Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org> * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
* *
* S3C24XX ADC device core * Samsung ADC device core
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -37,6 +37,11 @@ ...@@ -37,6 +37,11 @@
* action is required. * action is required.
*/ */
enum s3c_cpu_type {
TYPE_S3C24XX,
TYPE_S3C64XX
};
struct s3c_adc_client { struct s3c_adc_client {
struct platform_device *pdev; struct platform_device *pdev;
struct list_head pend; struct list_head pend;
...@@ -262,7 +267,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) ...@@ -262,7 +267,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
if (!client) { if (!client) {
dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__); dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__);
return IRQ_HANDLED; goto exit;
} }
data0 = readl(adc->regs + S3C2410_ADCDAT0); data0 = readl(adc->regs + S3C2410_ADCDAT0);
...@@ -289,6 +294,11 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) ...@@ -289,6 +294,11 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
local_irq_restore(flags); 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; return IRQ_HANDLED;
} }
...@@ -410,9 +420,22 @@ static int s3c_adc_resume(struct platform_device *pdev) ...@@ -410,9 +420,22 @@ static int s3c_adc_resume(struct platform_device *pdev)
#define s3c_adc_resume NULL #define s3c_adc_resume NULL
#endif #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 = { static struct platform_driver s3c_adc_driver = {
.id_table = s3c_adc_driver_ids,
.driver = { .driver = {
.name = "s3c24xx-adc", .name = "s3c-adc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = s3c_adc_probe, .probe = s3c_adc_probe,
......
/* arch/arm/plat-s3c/include/plat/adc.h /* arch/arm/plat-samsung/include/plat/adc.h
* *
* Copyright (c) 2008 Simtec Electronics * Copyright (c) 2008 Simtec Electronics
* http://armlinux.simnte.co.uk/ * http://armlinux.simnte.co.uk/
* Ben Dooks <ben@simtec.co.uk> * Ben Dooks <ben@simtec.co.uk>
* *
* S3C24XX ADC driver information * S3C ADC driver information
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment