From patchwork Wed Jul 23 10:53:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 34145 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BFC7D2206B for ; Wed, 23 Jul 2014 10:58:39 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id tr6sf6948111ieb.2 for ; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:subject:date :message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Mv5wG8dTxEa9sL7uNVUaPwmASdK5mr4r9rjZaeWMw3U=; b=Kbu6L3BkaW1aISYOwMXONUrsCgtiaorPNUprVck2at5gmpDAtx03GMguMr3XuzX4WX GFzWyMbUFL7jabhyQgHWYPQADY6r5hU35YqxW3dqyDRSyG8kxc+egBV3ms84/9uhpC13 SGimjqAHTq7QgPt8gLs3uyVFFC8ZvXsuZNApXGCKETOIWPWxCnB8lv2G+QH5saowqnH9 Ow4dmseiwVc6POP1QXjZS0s2Ii6yfFLXRlnFmAGkSg3lzx15tNWfKDT8Qi+Zdgqn/LbU IC03J3qCNHI4n/CntBZwlgpDucXxQ4CzUtmU/0pDlEpNiSEpO3jAYf3ndf+5Z70ENuhl Gvbw== X-Gm-Message-State: ALoCoQk+uuRoZ+A+UDFsIMZNyA+Df2SittP6r2hjD6hVZFJt6CCsMnS9gGOqha/l13v4PVSx2Hoz X-Received: by 10.42.207.5 with SMTP id fw5mr469986icb.20.1406113119264; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.171 with SMTP id 40ls274282qgx.9.gmail; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr950420vcb.2.1406113119148; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id dx8si1535105vdb.24.2014.07.23.03.58.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 03:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so1755290vcb.39 for ; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr558290vca.45.1406113119078; Wed, 23 Jul 2014 03:58:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp269016vcb; Wed, 23 Jul 2014 03:58:38 -0700 (PDT) X-Received: by 10.70.50.137 with SMTP id c9mr373750pdo.101.1406113118272; Wed, 23 Jul 2014 03:58:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py12si2171158pab.17.2014.07.23.03.58.37 for ; Wed, 23 Jul 2014 03:58:38 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758095AbaGWK6d (ORCPT + 15 others); Wed, 23 Jul 2014 06:58:33 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:59095 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932272AbaGWKyU (ORCPT ); Wed, 23 Jul 2014 06:54:20 -0400 Received: by mail-we0-f182.google.com with SMTP id k48so996711wev.27 for ; Wed, 23 Jul 2014 03:54:19 -0700 (PDT) X-Received: by 10.180.149.161 with SMTP id ub1mr2135741wib.32.1406112858947; Wed, 23 Jul 2014 03:54:18 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-406-71.w82-125.abo.wanadoo.fr. [82.125.33.71]) by mx.google.com with ESMTPSA id es9sm1112100wjd.1.2014.07.23.03.54.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 03:54:18 -0700 (PDT) From: Daniel Lezcano To: linux-kernel@vger.kernel.org Subject: [PATCH 10/25] clocksource: sh_mtu2: Add DT support Date: Wed, 23 Jul 2014 12:53:52 +0200 Message-Id: <1406112847-26275-10-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406112847-26275-1-git-send-email-daniel.lezcano@linaro.org> References: <53CF93B2.6040903@linaro.org> <1406112847-26275-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Laurent Pinchart Document DT bindings and parse them in the MTU2 driver. Signed-off-by: Laurent Pinchart Tested-by: Wolfram Sang --- .../devicetree/bindings/timer/renesas,mtu2.txt | 39 ++++++++++++++++++++ drivers/clocksource/sh_mtu2.c | 8 ++++ 2 files changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/renesas,mtu2.txt diff --git a/Documentation/devicetree/bindings/timer/renesas,mtu2.txt b/Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file mode 100644 index 0000000..917453f --- /dev/null +++ b/Documentation/devicetree/bindings/timer/renesas,mtu2.txt @@ -0,0 +1,39 @@ +* Renesas R-Car Multi-Function Timer Pulse Unit 2 (MTU2) + +The MTU2 is a multi-purpose, multi-channel timer/counter with configurable +clock inputs and programmable compare match. + +Channels share hardware resources but their counter and compare match value +are independent. The MTU2 hardware supports five channels indexed from 0 to 4. + +Required Properties: + + - compatible: must contain "renesas,mtu2" + + - reg: base address and length of the registers block for the timer module. + + - interrupts: interrupt specifiers for the timer, one for each entry in + interrupt-names. + - interrupt-names: must contain one entry named "tgi?a" for each enabled + channel, where "?" is the channel index expressed as one digit from "0" to + "4". + + - clocks: a list of phandle + clock-specifier pairs, one for each entry + in clock-names. + - clock-names: must contain "fck" for the functional clock. + + +Example: R7S72100 (RZ/A1H) MTU2 node + + mtu2: timer@fcff0000 { + compatible = "renesas,mtu2"; + reg = <0xfcff0000 0x400>; + interrupts = <0 139 IRQ_TYPE_LEVEL_HIGH>, + <0 146 IRQ_TYPE_LEVEL_HIGH>, + <0 150 IRQ_TYPE_LEVEL_HIGH>, + <0 154 IRQ_TYPE_LEVEL_HIGH>, + <0 159 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tgi0a", "tgi1a", "tgi2a", "tgi3a", "tgi4a"; + clocks = <&mstp3_clks R7S72100_CLK_MTU2>; + clock-names = "fck"; + }; diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index b0c229f..3d88698 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -500,11 +501,18 @@ static const struct platform_device_id sh_mtu2_id_table[] = { }; MODULE_DEVICE_TABLE(platform, sh_mtu2_id_table); +static const struct of_device_id sh_mtu2_of_table[] __maybe_unused = { + { .compatible = "renesas,mtu2" }, + { } +}; +MODULE_DEVICE_TABLE(of, sh_mtu2_of_table); + static struct platform_driver sh_mtu2_device_driver = { .probe = sh_mtu2_probe, .remove = sh_mtu2_remove, .driver = { .name = "sh_mtu2", + .of_match_table = of_match_ptr(sh_mtu2_of_table), }, .id_table = sh_mtu2_id_table, };