summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx/core.c
diff options
context:
space:
mode:
authorAlexander Sverdlin <alexander.sverdlin@gmail.com>2015-11-22 09:49:22 +0100
committerAlexander Sverdlin <alexander.sverdlin@gmail.com>2017-07-28 01:36:31 +0200
commit5364c6470a5d4925409c677d41b8768fbf8271a3 (patch)
tree004922ae6e8aa7ffedf5304a3e6f342013871051 /arch/arm/mach-ep93xx/core.c
parentf2322451b4cecc8f2d16b781030d1a0fc3fb071b (diff)
downloadlinux-stable-5364c6470a5d4925409c677d41b8768fbf8271a3.tar.gz
linux-stable-5364c6470a5d4925409c677d41b8768fbf8271a3.tar.bz2
linux-stable-5364c6470a5d4925409c677d41b8768fbf8271a3.zip
ARM: ep93xx: Add ADC platform device support to core
Newly provided ep93xx_register_adc() could be used by machine-specific code to create ADC platform device on Cirrus Logic EP93xx SoC-based machines. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Diffstat (limited to 'arch/arm/mach-ep93xx/core.c')
-rw-r--r--arch/arm/mach-ep93xx/core.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index c393b1b0310d..f53c61813998 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -821,6 +821,30 @@ void ep93xx_ide_release_gpio(struct platform_device *pdev)
EXPORT_SYMBOL(ep93xx_ide_release_gpio);
/*************************************************************************
+ * EP93xx ADC
+ *************************************************************************/
+static struct resource ep93xx_adc_resources[] = {
+ DEFINE_RES_MEM(EP93XX_ADC_PHYS_BASE, 0x28),
+ DEFINE_RES_IRQ(IRQ_EP93XX_TOUCH),
+};
+
+static struct platform_device ep93xx_adc_device = {
+ .name = "ep93xx-adc",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(ep93xx_adc_resources),
+ .resource = ep93xx_adc_resources,
+};
+
+void __init ep93xx_register_adc(void)
+{
+ /* Power up ADC, deactivate Touch Screen Controller */
+ ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_TIN,
+ EP93XX_SYSCON_DEVCFG_ADCPD);
+
+ platform_device_register(&ep93xx_adc_device);
+}
+
+/*************************************************************************
* EP93xx Security peripheral
*************************************************************************/