From patchwork Thu Jan 31 09:05:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2071601 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F26FFDF2E5 for ; Thu, 31 Jan 2013 09:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208Ab3AaJF3 (ORCPT ); Thu, 31 Jan 2013 04:05:29 -0500 Received: from mail-da0-f52.google.com ([209.85.210.52]:53883 "EHLO mail-da0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853Ab3AaJF1 (ORCPT ); Thu, 31 Jan 2013 04:05:27 -0500 Received: by mail-da0-f52.google.com with SMTP id f10so1203956dak.25 for ; Thu, 31 Jan 2013 01:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:sender:message-id:to:cc:in-reply-to:references:from :subject:mime-version:content-type; bh=+3gLqgc6W2t4qbHvENX08P2OJTg7K1vtzBg42dvb8UI=; b=ICBsWtklcZyHIgIjRbeNcT4XLExO3tTO78QsZeTeh5rR16uHvL36abxWZXMuA2sc4j JDe7fUA8BhVk3QLQ7CSFG3wLNtGPC4KM7YXBBFWfdu+AfTAFcQxmTniTWGtZeDMSjkdW UZyPi8nhLAkKrVWuv4zAuq1DaCzGzVciRtugf5wGWkqhONwV8/oAVNUaiua08YU5Wg2p MesmmE0Xy2/BoyvSarHlQrpSjbBgX6vtfA4AZnyOQigK/iwjtec6qiy/yVdyJgS7yWD4 OHIY3/LIaDGbl6acIKbTXsX5jWQaXQGf1GuVzy8hFQwu3AsaHVr2XQYz7atgJrMbbfcU zz3Q== X-Received: by 10.66.72.226 with SMTP id g2mr18567657pav.67.1359623126934; Thu, 31 Jan 2013 01:05:26 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPS id nm2sm4417861pbc.43.2013.01.31.01.05.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 01:05:26 -0800 (PST) Date: Thu, 31 Jan 2013 01:05:26 -0800 (PST) Message-ID: <87obg5pvsd.wl%kuninori.morimoto.gx@renesas.com> To: Zhang Rui Cc: Simon , Magnus , linux-pm@vger.kernel.org, Kuninori Morimoto In-Reply-To: <87y5f9pvxv.wl%kuninori.morimoto.gx@renesas.com> References: <87y5f9pvxv.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/7] thermal: rcar: add Device Tree support MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Support for loading the Renesas R-Car thermal module via devicetree. Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/thermal/rcar-thermal.txt | 29 ++++++++++++++++++++ drivers/thermal/rcar_thermal.c | 7 +++++ 2 files changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/rcar-thermal.txt diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt new file mode 100644 index 0000000..28ef498 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt @@ -0,0 +1,29 @@ +* Renesas R-Car Thermal + +Required properties: +- compatible : "renesas,rcar-thermal" +- reg : Address range of the thermal registers. + The 1st reg will be recognized as common register + if it has "interrupts". + +Option properties: + +- interrupts : use interrupt + +Example (non interrupt support): + +thermal@e61f0100 { + compatible = "renesas,rcar-thermal"; + reg = <0xe61f0100 0x38>; +}; + +Example (interrupt support): + +thermal@e61f0000 { + compatible = "renesas,rcar-thermal"; + reg = <0xe61f0000 0x14 + 0xe61f0100 0x38 + 0xe61f0200 0x38 + 0xe61f0300 0x38>; + interrupts = <0 69 4>; +}; diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 80aae3c..3bd8918 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -477,9 +477,16 @@ static int rcar_thermal_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id rcar_thermal_dt_ids[] __devinitconst = { + { .compatible = "renesas,rcar-thermal", }, + {}, +}; +MODULE_DEVICE_TABLE(of, rcar_thermal_dt_ids); + static struct platform_driver rcar_thermal_driver = { .driver = { .name = "rcar_thermal", + .of_match_table = rcar_thermal_dt_ids, }, .probe = rcar_thermal_probe, .remove = rcar_thermal_remove,