From patchwork Wed May 17 17:13: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: 9731707 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 2F2D960230 for ; Wed, 17 May 2017 17:16:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A07F28711 for ; Wed, 17 May 2017 17:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE08287C7; Wed, 17 May 2017 17:16:48 +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 7468928797 for ; Wed, 17 May 2017 17:16:47 +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=iCW6aYgixEWpDi2vhiiZfyw5gEhobInvasSeagXLNhE=; b=kkhYuwCwzTKHRYqYbcmNccBtOR //g3DP9twOpXXE9O3haAc9Bk19r7gQRzigAcx3cfWhzLwdEbIG8yPPB8C75DoeIt9Nk77Pcc1Br53 VvgUedIijuvZiyLqSh2Iu4/VGXOy8QiRVcZ7LTPzJy+6yAHeP0wOXWat6SDoyGIs0539bmdgTqkvX YDZ2ootRNaw4UOSwAj8uheRf1jUT+5OqBuYDXYCj4Vi0sEirovFlcN+HbgPupzLEspWubmBOLWHKQ HU1WxHpqTwJ5+QAwAFH0CmIPuur1qTnoq4N0cO0LyzSs3bIEGJfYmNxiNErs5GmHJd2dnurYu5uMK QYiGyEww==; 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 1dB2Z2-0006Gp-2N; Wed, 17 May 2017 17:16:44 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dB2Ww-0003Vh-8K for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2017 17:14:37 +0000 Received: by mail-wr0-x241.google.com with SMTP id w50so2839476wrc.0 for ; Wed, 17 May 2017 10:14:13 -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=zUypiynqYLnWQ1/g/FI/BQGsM0A3zYguqWl9oLYgJOQ=; b=LLT0MV+vP1Yj0kfOkW+3uOJO9HsUsFcev8soS7fRJiEWiIzYwmYDVPibKU+L608CzJ D56rN0pka5IGVQXA+P8bo+qMfnLTP7+F4pSAbM8CcI2E4wxjyWsIEGCDc+Xpnlts5ZBe 92D/fDNwNc3+IStb9UPxeA9P8Cloe6uOT13YJjX0Ny9jK4e+qhIPZFbQRd265vcYh5EL o7UciC2HkVYRwWd2dhCsg49R9Z4XsEGH3v/+ejZoXQCrPW3okBglxm/WCfZFIWN2iBUb CJjSop4FCVHkvHk4YycEqkIgswIW+L6R0kgnDW8Xe66dieZcn88i+FR/fgM5g1rzvOqt pmzg== 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=zUypiynqYLnWQ1/g/FI/BQGsM0A3zYguqWl9oLYgJOQ=; b=XKCns53L9hMMj02bmyHItYdPQvnxWo1RD+GCxg9l96qtNfh76T7rtGhHfgC12qLz+I nU6f7uYTycdNA/WEfourbpP2fToJyCXRIwB81Ry8tHGj5SGmhEVBDAozwF+sgXTd73YU u3iNdXWHQjRGSLWRH24FYrtgQTO3X5LYe/4owIpyZHkRXz+LuduwOxLkKUCsgO9NMEsc MXhzM2KNSNh3zv+FH1J3AhvvXgB1KOsidC3tTP/Y4UcMN/UOCE4cSAE4xS0NqXMQgHN2 lavTVVvRABN1gIg6G0iIwYB07APOpx/8VWabVVYPyNk3XaL4L6tVS+yVQMFjyYoSoFnv 0scA== X-Gm-Message-State: AODbwcB1x3nBH5xF0XV0ZYwsCKN7SDVWqEfevK7jj0aJ/itoB0kdXclG BVMxn85lTMw3BA== X-Received: by 10.46.20.9 with SMTP id u9mr1299552ljd.14.1495041252312; Wed, 17 May 2017 10:14:12 -0700 (PDT) Received: from giga1.localdomain ([195.245.52.203]) by smtp.gmail.com with ESMTPSA id a17sm487498lfg.51.2017.05.17.10.14.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2017 10:14:11 -0700 (PDT) From: Alexander Sverdlin To: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hartley Sweeten , Ryan Mallon Subject: [PATCH v4 3/5] ep93xx: Add ADC platform device support to core Date: Wed, 17 May 2017 19:13:50 +0200 Message-Id: <20170517171352.20369-4-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170517171352.20369-1-alexander.sverdlin@gmail.com> References: <20170517171352.20369-1-alexander.sverdlin@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170517_101434_615751_75ECC4BF X-CRM114-Status: GOOD ( 12.22 ) 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 , Alexander Sverdlin , Peter Meerwald-Stadler , Jonathan Cameron , Hartmut Knaack 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 --- 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)