From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sourav Poddar 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: khali@linux-fr.org, linux@roeck-us.net, lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sourav Poddar , Santosh Shilimkar , Benoit Cousson , Felipe Balbi List-Id: devicetree@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), -- 1.7.1