From patchwork Wed Nov 25 11:50:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 7698321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D0E039F1BE for ; Wed, 25 Nov 2015 11:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 070A5208ED for ; Wed, 25 Nov 2015 11:53:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D74A208E5 for ; Wed, 25 Nov 2015 11:53:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1Yc9-0004kc-Jg; Wed, 25 Nov 2015 11:51:57 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1YbK-00047J-6m for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2015 11:51:09 +0000 Received: by wmww144 with SMTP id w144so176671360wmw.1 for ; Wed, 25 Nov 2015 03:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=HXleItFzG5ac/NNUr4+EsPFIsZyn5tLxmNj/SUKkGY8=; b=ti6Ugwqp3HE0sXTgJSFMSTiUPs8GFigxetSHnKRIKLJKn8Hyi7SGfJupZ05pYQ0PNl H2CMD6OVtSnjZfdNX/l/6Y1FUpnw/xYKY3fddt6IB76FQ+vnc6zkjcwv3xuG/qXhljtM 9z0WSYqThBoLkc5WjStmwoN8oEbzwtU3utQiTq/ujkak3bIEML7u5KNj5uk3OWJt8LPT OuLgY7OB+ildjE7EqkUBp3/UOir7A+beiEN5n4R2tY79UGR2Tmig9st48UutKtTDHYEA Gi7eYnkabUoo5IDygn90QIV37FJwkvDUETuFdRosFcGCij2ZVGA+v94WvcQ1JH0DTtPd tQUw== X-Received: by 10.194.249.69 with SMTP id ys5mr40361929wjc.97.1448452244673; Wed, 25 Nov 2015 03:50:44 -0800 (PST) Received: from [192.168.1.20] (x5d846db9.dyn.telefonica.de. [93.132.109.185]) by smtp.gmail.com with ESMTPSA id jh4sm22670380wjb.33.2015.11.25.03.50.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Nov 2015 03:50:44 -0800 (PST) Subject: [PATCH 3/5] ep93xx: Add ADC platform device support to core To: Hartley Sweeten , Ryan Mallon , linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org References: <56558B23.4080506@gmail.com> From: Alexander Sverdlin Message-ID: <5655A092.4030804@gmail.com> Date: Wed, 25 Nov 2015 12:50:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56558B23.4080506@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151125_035106_765098_CDA2BD34 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , Russell King , Peter Meerwald , Jonathan Cameron , Hartmut Knaack Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/arm/mach-ep93xx/core.c | 24 ++++++++++++++++++++++++ arch/arm/mach-ep93xx/include/mach/platform.h | 1 + arch/arm/mach-ep93xx/soc.h | 1 + 3 files changed, 26 insertions(+) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index c393b1b..f53c618 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 *************************************************************************/ diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 4c0bbd9..db08396 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h @@ -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); diff --git a/arch/arm/mach-ep93xx/soc.h b/arch/arm/mach-ep93xx/soc.h index 7bf7ff8..d20e631 100644 --- a/arch/arm/mach-ep93xx/soc.h +++ b/arch/arm/mach-ep93xx/soc.h @@ -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)