From patchwork Fri Aug 3 12:35:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 1270581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 910EBDF25A for ; Fri, 3 Aug 2012 12:39:31 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SxH6o-0005HW-MQ; Fri, 03 Aug 2012 12:36:02 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SxH6l-0005HI-Nf for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2012 12:36:00 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q73CZkHE001490; Fri, 3 Aug 2012 07:35:47 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q73CZhBc016177; Fri, 3 Aug 2012 18:05:43 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 3 Aug 2012 18:05:43 +0530 Received: from a0131647.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q73CZcVE031120; Fri, 3 Aug 2012 18:05:38 +0530 From: Sourav Poddar To: , , , , , , Subject: [PATCH] hwmon: tmp102: Add device tree support Date: Fri, 3 Aug 2012 18:05:50 +0530 Message-ID: <1343997350-676-1-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sourav Poddar , Santosh Shilimkar , Benoit Cousson , Felipe Balbi X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org update tmp102 temperature sensor to also use device tree. Cc: Benoit Cousson Cc: Felipe Balbi Cc: Santosh Shilimkar Acked-by: Felipe Balbi Signed-off-by: Sourav Poddar --- drivers/hwmon/tmp102.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index 0d466b9..a8a9060 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c @@ -26,6 +26,7 @@ #include #include #include +#include #define DRIVER_NAME "tmp102" @@ -284,8 +285,19 @@ static const struct i2c_device_id tmp102_id[] = { }; MODULE_DEVICE_TABLE(i2c, tmp102_id); +#ifdef CONFIG_OF +static const struct of_device_id temperature_dt_match[] = { + { .compatible = "ti,tmp102" }, + {}, +}; +MODULE_DEVICE_TABLE(of, temperature_dt_match); +#endif + static struct i2c_driver tmp102_driver = { - .driver.name = DRIVER_NAME, + .driver = { + .name = DRIVER_NAME, + .of_match_table = of_match_ptr(temperature_dt_match), + }, .driver.pm = TMP102_DEV_PM_OPS, .probe = tmp102_probe, .remove = __devexit_p(tmp102_remove),