From patchwork Sat Jun 3 23:26:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 9764555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 656C460363 for ; Sat, 3 Jun 2017 23:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C22280DE for ; Sat, 3 Jun 2017 23:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 475F628464; Sat, 3 Jun 2017 23:28:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C17F9280DE for ; Sat, 3 Jun 2017 23:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=G8I0u7DTyRxss5x9H+QgTBHx1xkIgQbVtwWYrCxBP64=; b=MRPprmtenRaOiWm0EnvBHpLcA5 KHQWoyihoIjw5QEw6iht9LZs9BeTcjptpx2/wzuRYAh8+nF1Ip+Yr2Y+/0TdkICRkwBzYH3xjiNRF 3h+bNavzUzX5ycUORrr5GQQWlKWBuMtZlUzHj1MpTS2UY8/7Ay+rO1ufsbSVOERrnoaBoIF2U3mG2 mQBy3t0j611mK6vba9JkO/n9HQejlYXD/Ybgj9NVcmYWrDpUFCWgVsR/WRKlT8vxhvrDGjrIVumUY pcXGDNEA1+vT7be0yXymbNcvYdysEpZ9BwyHV+at7DQnORTigV/d7dw15pCiQibUeDxiQOVkQj//t 1f3ccFKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dHIT1-0001Sq-RM; Sat, 03 Jun 2017 23:28:23 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dHISa-0000c7-Sf for linux-arm-kernel@lists.infradead.org; Sat, 03 Jun 2017 23:28:02 +0000 Received: by mail-lf0-x242.google.com with SMTP id u62so6869691lfg.0 for ; Sat, 03 Jun 2017 16:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pZFg7oBylVCk65bJMiO3FNGXV1glKQh7XjpkUPbkh/8=; b=cn3kw3vUn3vxGpZDIbP+bHVDbNAiDpbSr3zFBz+I34bOQq0js/h5r7BYunfWuYj2BK o8FV8cxDvv1YDFtEgre92fUuez6EgddrynpmZ48dGgrNevgutD4tJwTA7V0LcIGvZw3e ABYwSgYNz3wIfRexfkGeJCN5G3FHoTqP2jgU+jFk8gAdVX58AnkbhP48Lj3jZZPrvv4q xpSohT8XWFMX7v9I1hb2QVZ1Sqh0ENBYeHR5tvlY/qoThFRgPeALZkWf7TvixckEmGVu VRXVp2wQb5C6M0lBUbgIQ8BVuYEA+drzl7Y4KgQ1z0+GbMkMSiCfB4L4PrL7luXkUdnE 1hiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pZFg7oBylVCk65bJMiO3FNGXV1glKQh7XjpkUPbkh/8=; b=dsf7M3ybYxlztp7fuut/RFB+O6DzRjSWjARoLnDiUiuE5/VyR4qkxII52hrgJZU2z0 j+hJswCDe7cgXF7HzYOJf8z6tv2PBZTtl5f/ypBR40XYyYd162faBpp1fF+QcvCjiEWE BNbgWVvJHs70+lNuEtczD8lSvpF8DI6n8AGgyXkqHeu/XdHe+T/IE2pLPJlpj+eHEnoo qiQpoYc3Fmqy0ol3BoMWmBJbZ/Mo9Ezb8T/2UQA7oAp0xZS8iGlq2ucxOeRYEGqRb5Bd JmvVyWOB4O0d7xI4P7R0eHt/IrdvSr43h5Era/JC01HdPSRi0sgWBfu9OOcCPpVWdZGH m1/w== X-Gm-Message-State: AODbwcCESynbAJROYjjHAkhHj9joZ7BJ3+N7kAnOW8AZldVfgqzawfq1 YyGcCQfJVMfrug== X-Received: by 10.25.44.208 with SMTP id s199mr3434352lfs.180.1496532454646; Sat, 03 Jun 2017 16:27:34 -0700 (PDT) Received: from giga1.localdomain ([195.245.52.203]) by smtp.gmail.com with ESMTPSA id 10sm1078869ljf.36.2017.06.03.16.27.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jun 2017 16:27:33 -0700 (PDT) From: Alexander Sverdlin To: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 3/5] ep93xx: Add ADC platform device support to core Date: Sun, 4 Jun 2017 01:26:50 +0200 Message-Id: <20170603232652.21401-4-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170603232652.21401-1-alexander.sverdlin@gmail.com> References: <20170603232652.21401-1-alexander.sverdlin@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170603_162757_799079_6008EC98 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , Ryan Mallon , Hartley Sweeten , Peter Meerwald-Stadler , Hartmut Knaack , Alexander Sverdlin , Jonathan Cameron MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Acked-by: Ryan Mallon --- 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 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 *************************************************************************/ diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 4c0bbd97f741..db0839691ef5 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 7bf7ff8beae7..d20e631164cf 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)