From patchwork Tue Jul 5 16:44:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9214879 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 22A3D6048F for ; Tue, 5 Jul 2016 16:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13F7A27B13 for ; Tue, 5 Jul 2016 16:45:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0268127B2F; Tue, 5 Jul 2016 16:45:22 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 7B1D827B13 for ; Tue, 5 Jul 2016 16:45:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754700AbcGEQoj (ORCPT ); Tue, 5 Jul 2016 12:44:39 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:48551 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbcGEQoh (ORCPT ); Tue, 5 Jul 2016 12:44:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=8WYt3WaTIuR6JRUwdxNSw0d60Fd66n3M8J5/ah9ahGQ=; b=GHLF4/dHIHGb8O tI+d9xc7poHv3V2iUubsAHQHPJmEkyBJd5nIYElzPlzn3b4datluH0826fofcfR3/hhq9xLe6pVL9 ZoBboVsknEwdJR3wyjzwtafwX7Q0nm6ZEhxxrbuGe249T/DIjxBBT6yvfykP00xzW2ciOt+mWesmZ Mhd64YVLL8+M4rxxq4Hctmo1qJz56p6Ouim96ePAMXhSZUKYhgzbKkIUQHGzv6PESIhXP/LTpFDpJ KxCUPCWECJLsuyKGR3Dn09zuUQcvqwfBJ9FzrYLDOGBcf1PwwkFJkw0iJcGkJkEevj4UHdPETgMO4 AUv99b7+J3WCIE9aNWvQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:58622 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1bKTSc-0013fy-2T; Tue, 05 Jul 2016 16:44:34 +0000 From: Guenter Roeck To: Rob Herring Cc: Mark Rutland , Joachim Eastwood , Jean Delvare , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, Guenter Roeck Subject: [PATCH 2/3] hwmon: (jc42) Add support for generic JC-42.4 devicetree binding Date: Tue, 5 Jul 2016 09:44:32 -0700 Message-Id: <1467737073-7949-2-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1467737073-7949-1-git-send-email-linux@roeck-us.net> References: <1467737073-7949-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: 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 With this change, JC-42.4 compatible temperature sensors can be configured in devicetree by providing a generic "jedec,jc-42.4-temp" binding. Signed-off-by: Guenter Roeck --- drivers/hwmon/jc42.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index 9887d3224a86..374630bab137 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c @@ -31,6 +31,7 @@ #include #include #include +#include /* Addresses to scan */ static const unsigned short normal_i2c[] = { @@ -537,11 +538,20 @@ static const struct i2c_device_id jc42_id[] = { }; MODULE_DEVICE_TABLE(i2c, jc42_id); +#ifdef CONFIG_OF +static const struct of_device_id jc42_of_ids[] = { + { .compatible = "jedec,jc-42.4-temp", }, + { } +}; +MODULE_DEVICE_TABLE(of, jc42_of_ids); +#endif + static struct i2c_driver jc42_driver = { .class = I2C_CLASS_SPD, .driver = { .name = "jc42", .pm = JC42_DEV_PM_OPS, + .of_match_table = of_match_ptr(jc42_of_ids), }, .probe = jc42_probe, .remove = jc42_remove,