From patchwork Mon Apr 2 18:33:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stigge@antcom.de X-Patchwork-Id: 150200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ey0-f184.google.com (mail-ey0-f184.google.com [209.85.215.184]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 22E04B6EE7 for ; Tue, 3 Apr 2012 04:33:24 +1000 (EST) Received: by eaaa11 with SMTP id a11sf1611134eaa.11 for ; Mon, 02 Apr 2012 11:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-feas-system-wl :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=jEqGgnSuIrlmQT2Meac0XTs4yP6lCPl7cZHB6urM0Ik=; b=ZFRdEx5sx6VrYlhbw2wbb2GRseweQHYNRd4p629T76dQVxqszTmMP3oVt6fhntCb1S nO07yOEaPVd1CgMY/s189s3cj5wDwrmZbUpCs1ttvSbt5KIyS9rBfSIi+xsHH3fMof6N y64rewBG8YA39NV9tFVAULatJYBk/Scu2VYeE= Received: by 10.216.137.15 with SMTP id x15mr236454wei.60.1333391598518; Mon, 02 Apr 2012 11:33:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.216.211.195 with SMTP id w45ls5985922weo.5.gmail; Mon, 02 Apr 2012 11:33:17 -0700 (PDT) Received: by 10.180.94.105 with SMTP id db9mr1680336wib.2.1333391597802; Mon, 02 Apr 2012 11:33:17 -0700 (PDT) Received: by 10.180.94.105 with SMTP id db9mr1680335wib.2.1333391597747; Mon, 02 Apr 2012 11:33:17 -0700 (PDT) Received: from work-microwave.de (mail.work-microwave.de. [62.245.205.51]) by gmr-mx.google.com with ESMTPS id ga1si6707529wib.2.2012.04.02.11.33.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Apr 2012 11:33:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rst@work-microwave.de designates 62.245.205.51 as permitted sender) client-ip=62.245.205.51; Received: from rst-pc1.lan.work-microwave.de ([192.168.11.78]) (authenticated bits=0) by mail.work-microwave.de with ESMTP id q32IXFT5008150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Apr 2012 19:33:16 +0100 Received: by rst-pc1.lan.work-microwave.de (Postfix, from userid 1000) id 4220DAE065; Mon, 2 Apr 2012 20:33:15 +0200 (CEST) From: Roland Stigge To: arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, w.sang@pengutronix.de, srinivas.bakki@nxp.com, kevin.wells@nxp.com, gregkh@linuxfoundation.org, netdev@vger.kernel.org, rtc-linux@googlegroups.com, a.zummo@towertech.it, linux-watchdog@vger.kernel.org, wim@iguana.be, jonsmirl@gmail.com Cc: Roland Stigge Subject: [rtc-linux] [PATCH v2 1/8] iio: Add device tree support to LPC32xx ADC Date: Mon, 2 Apr 2012 20:33:00 +0200 Message-Id: <1333391587-26290-2-git-send-email-stigge@antcom.de> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1333391587-26290-1-git-send-email-stigge@antcom.de> References: <1333391587-26290-1-git-send-email-stigge@antcom.de> X-FEAS-SYSTEM-WL: rst@work-microwave.de, 192.168.11.78 X-Original-Sender: stigge@antcom.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of rst@work-microwave.de designates 62.245.205.51 as permitted sender) smtp.mail=rst@work-microwave.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , This patch adds device tree support to the LPC32xx's ADC. Signed-off-by: Roland Stigge --- Applies to v3.4-rc1 Documentation/devicetree/bindings/staging/iio/adc/lpc32xx-adc.txt | 16 ++++++++++ drivers/staging/iio/adc/lpc32xx_adc.c | 10 ++++++ 2 files changed, 26 insertions(+) --- /dev/null +++ linux-2.6/Documentation/devicetree/bindings/staging/iio/adc/lpc32xx-adc.txt @@ -0,0 +1,16 @@ +* NXP LPC32xx SoC ADC controller + +Required properties: +- compatible: must be "nxp,lpc32xx-adc" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: The ADC interrupt + +Example: + + adc@40048000 { + compatible = "nxp,lpc32xx-adc"; + reg = <0x40048000 0x1000>; + interrupt-parent = <&mic>; + interrupts = <39 0>; + }; --- linux-2.6.orig/drivers/staging/iio/adc/lpc32xx_adc.c +++ linux-2.6/drivers/staging/iio/adc/lpc32xx_adc.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "../iio.h" #include "../sysfs.h" @@ -221,12 +222,21 @@ static int __devexit lpc32xx_adc_remove( return 0; } +#ifdef CONFIG_OF +static const struct of_device_id lpc32xx_adc_match[] = { + { .compatible = "nxp,lpc32xx-adc" }, + {}, +}; +MODULE_DEVICE_TABLE(of, lpc32xx_adc_match); +#endif + static struct platform_driver lpc32xx_adc_driver = { .probe = lpc32xx_adc_probe, .remove = __devexit_p(lpc32xx_adc_remove), .driver = { .name = MOD_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(lpc32xx_adc_match), }, };