From patchwork Fri Aug 19 04:00:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 9289307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E632600CB for ; Fri, 19 Aug 2016 04:10:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87661268AE for ; Fri, 19 Aug 2016 04:10:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7808C27FE4; Fri, 19 Aug 2016 04:10:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5676E268AE for ; Fri, 19 Aug 2016 04:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103AbcHSEKN (ORCPT ); Fri, 19 Aug 2016 00:10:13 -0400 Received: from da1vs02.rockwellcollins.com ([205.175.227.29]:30750 "EHLO da1vs02.rockwellcollins.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754056AbcHSEKN (ORCPT ); Fri, 19 Aug 2016 00:10:13 -0400 Received: from ofwda1n02.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs02.rockwellcollins.com with ESMTP; 18 Aug 2016 23:01:01 -0500 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by dtulimr01.rockwellcollins.com (Postfix) with ESMTP id 5E257600C6; Thu, 18 Aug 2016 23:01:00 -0500 (CDT) From: Matt Weber To: linux-hwmon@vger.kernel.org Cc: linux@roeck-us.net, jdelvare@suse.com, Matt Weber , Ronak Desai Subject: [PATCH] hwmon: (amc6821) basic device tree support Date: Thu, 18 Aug 2016 23:00:58 -0500 Message-Id: <1471579258-16148-1-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enables basic enumeration of a amc6821 device via device tree. Signed-off-by: Matthew Weber Signed-off-by: Ronak Desai --- drivers/hwmon/amc6821.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index 12e851a..77b5cf4 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c @@ -32,6 +32,9 @@ #include #include +#ifdef CONFIG_OF +#include +#endif /* * Addresses to scan. */ @@ -996,6 +999,12 @@ static int amc6821_probe(struct i2c_client *client, return PTR_ERR_OR_ZERO(hwmon_dev); } +#ifdef CONFIG_OF +static const struct of_device_id amc6821_dt_match[] = { + { .compatible = "ti,amc6821", .data = (void *)amc6821 }, + { } +}; +#endif static const struct i2c_device_id amc6821_id[] = { { "amc6821", amc6821 }, { } @@ -1007,6 +1016,9 @@ static struct i2c_driver amc6821_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "amc6821", +#ifdef CONFIG_OF + .of_match_table = of_match_ptr(amc6821_dt_match), +#endif }, .probe = amc6821_probe, .id_table = amc6821_id,