ARM: ep93xx: Add ADC platform device support to core
authorAlexander Sverdlin <alexander.sverdlin@gmail.com>
Sun, 22 Nov 2015 08:49:22 +0000 (09:49 +0100)
committerAlexander Sverdlin <alexander.sverdlin@gmail.com>
Thu, 27 Jul 2017 23:36:31 +0000 (01:36 +0200)
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>
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/include/mach/platform.h
arch/arm/mach-ep93xx/soc.h

index c393b1b0310df78e3cbbea8ef9d7336de7f82d19..f53c6181399868ad232f3dcea8173349d6e76a93 100644 (file)
@@ -820,6 +820,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
  *************************************************************************/
index 4c0bbd97f741c7a6ab90de0260a77e9c4877fb82..db0839691ef5e883fd5f4ea0748f2698332e4d6a 100644 (file)
@@ -52,6 +52,7 @@ int ep93xx_i2s_acquire(void);
 void ep93xx_i2s_release(void);
 void ep93xx_register_ac97(void);
 void ep93xx_register_ide(void);
+void ep93xx_register_adc(void);
 int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
 void ep93xx_ide_release_gpio(struct platform_device *pdev);
 
index 7bf7ff8beae73f28aec97693a9cda48c6a8212bf..d20e631164cfd2dfcd1c638754691d47b0ffbb87 100644 (file)
@@ -95,6 +95,7 @@
 #define EP93XX_KEY_MATRIX_PHYS_BASE    EP93XX_APB_PHYS(0x000f0000)
 #define EP93XX_KEY_MATRIX_BASE         EP93XX_APB_IOMEM(0x000f0000)
 
+#define EP93XX_ADC_PHYS_BASE           EP93XX_APB_PHYS(0x00100000)
 #define EP93XX_ADC_BASE                        EP93XX_APB_IOMEM(0x00100000)
 #define EP93XX_TOUCHSCREEN_BASE                EP93XX_APB_IOMEM(0x00100000)