From patchwork Sat Feb 20 17:59:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 8367581 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 CE69F9F52D for ; Sat, 20 Feb 2016 18:02:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE60A20501 for ; Sat, 20 Feb 2016 18:02:23 +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 EB64B204D1 for ; Sat, 20 Feb 2016 18:02:22 +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 1aXBpv-00064j-3F; Sat, 20 Feb 2016 18:00:55 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXBpM-0004dU-52 for linux-arm-kernel@lists.infradead.org; Sat, 20 Feb 2016 18:00:22 +0000 Received: by mail-wm0-x233.google.com with SMTP id g62so111557753wme.0 for ; Sat, 20 Feb 2016 09:59:59 -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-transfer-encoding; bh=HXleItFzG5ac/NNUr4+EsPFIsZyn5tLxmNj/SUKkGY8=; b=NIjxX03j29SuJIaGPjCOmPpwqc75IIPMW1/WlufzVCyHvGL/3j4yiZgvEec7kOACPp xn+H7VRrgK0W7JYBCOWfp8sn6oSnHXDvFUJZX3DIaG4GD+fwkfVMULvvqOgykjlFwpBM AQRLWGPfkJUJG/oI2hbZZquv0rfM7GX5iAja4PQyDQziyi/bv4MUisgJiSOMHeL3XlP0 j3g3UzK/MWOWhG2khQr5JES6QUzhM14v1RS8Z794ynyeDJXjcoNxHjCm5l8RrlE+Xujv jhUCNdcs1nINOP5o4rZs7nJwatV42lmeqKTcOOUm+crWeoZZUasQ+Z1iNDhCI0n378me 2Phg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HXleItFzG5ac/NNUr4+EsPFIsZyn5tLxmNj/SUKkGY8=; b=LDIuN1NmPA+RFXn452rrJLaR3ClIN+4RBv9uNmrps1l9l2Qe5tmCccwv67mRCv32VL 5S8QeVxfe2I5stKWxOcu+P0BGwX7XeEblSKWiE9wgZTon6NXFIHZ9AGWsvB1GBOyAecq SylUOWCM+Z14d2F6qxKJUjjLlthEmgjbO2dwPCy19WBnwerV9/5k40aWBY2VUm0QL4U0 BPyuIb6S42932/ATc4bUE3TCsSZhxR2g0NrZSCnifvkT73vR14OZDC7TpM/79/sZMZI8 Q1iSJL09E7Dl7VlRDTZAYDQyK8+JMT6tXZutXRHUuc5W0SS60mZ8PXV50VeH2cnJi34G woag== X-Gm-Message-State: AG10YOQhxklfI/fl7YnUnMfGnGnmCov7IcxGZlS6BXdP8TteMGSk2ZWIJ//D52tKmQUCTw== X-Received: by 10.28.35.14 with SMTP id j14mr3762766wmj.80.1455991198618; Sat, 20 Feb 2016 09:59:58 -0800 (PST) Received: from [192.168.1.20] (x5d845bdb.dyn.telefonica.de. [93.132.91.219]) by smtp.gmail.com with ESMTPSA id n9sm16502487wjy.36.2016.02.20.09.59.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 20 Feb 2016 09:59:58 -0800 (PST) Subject: [PATCH v2 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: <56C88EDD.3040007@gmail.com> <56C88FCB.30008@gmail.com> <56C88FFD.9050504@gmail.com> From: Alexander Sverdlin Message-ID: <56C8A99C.7080201@gmail.com> Date: Sat, 20 Feb 2016 18:59:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56C88FFD.9050504@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160220_100020_494701_DA36C8BE X-CRM114-Status: GOOD ( 12.75 ) 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.1 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)