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: 1270481 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EA3993FC33 for ; Fri, 3 Aug 2012 12:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753720Ab2HCMge (ORCPT ); Fri, 3 Aug 2012 08:36:34 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:34989 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752669Ab2HCMgc (ORCPT ); Fri, 3 Aug 2012 08:36:32 -0400 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: , , , , , , CC: Sourav Poddar , Benoit Cousson , Felipe Balbi , Santosh Shilimkar 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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),