From patchwork Fri Sep 28 00:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Yang X-Patchwork-Id: 10618753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C406416B1 for ; Fri, 28 Sep 2018 00:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8D592B22E for ; Fri, 28 Sep 2018 00:30:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD21C2B262; Fri, 28 Sep 2018 00:30:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 6652F2B22E for ; Fri, 28 Sep 2018 00:30:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728593AbeI1GvP (ORCPT ); Fri, 28 Sep 2018 02:51:15 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:37412 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbeI1GvO (ORCPT ); Fri, 28 Sep 2018 02:51:14 -0400 Received: by mail-io1-f68.google.com with SMTP id v14-v6so3183939iob.4; Thu, 27 Sep 2018 17:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8fYX/tru7SU4upt3mATveHwXLBh2N/bLbdz5+sc27+Q=; b=rM57r7uXkp6mUseEzOk4bMojRrSKEmfmb1bEnLl76wUtlzvokCdomZDcBoREyfiGS/ oo6ozwrJdH6wjJQ4/y0iYTMsMqaOgc/xfL6QZ/Q90riWKjtfbrUf8IlhjnpKELCDHwkn /nRrxODUFl3Yq5bRZhgrl6BNw/GwK3gYh7iy9E0zjttFeNeD5TNVJcmAA18WpiIJqqQJ ZiBuE85Hk3lECj3HD0H7QEGCfkvuQXAGc9oemaiFURfxk7IKRLoeGG1ramhRWEmTnm5U xEAyzful7SFZ+MYIdVQLcPbn+KganA2HgLF0w8+z9izi2UgeA0s+WeBTCfxrBh0qqDEq lc9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8fYX/tru7SU4upt3mATveHwXLBh2N/bLbdz5+sc27+Q=; b=QMX1JUIYzTmWxIsrMU4nji6d7pR36J4biipwA7zFaqH3WRLwdtjw+nzuWomq6FcEeg gksIUe6ov8s7rMt+Z9RE7K1uV3VNhbFqhomMjCTH5bMNWmic63pVYlikdNKJFfDMG2ne rAzjML5ehjB/SNVBrgmtCQahMHpqltAlaoZE9bYRpIG33HkD9HVup+4nSkpQYVB88St6 mECzDPFwVXWv5b1YOW5scDCFhFz/muGXi9iaXfhCZoJWFa24o/OhljGakjHESTWlqEr9 oMG747OvexI1ufAhMguRkGejlzsbXcBofi0v71spBWdbyjavu1djL5HCH9jPbuW+nHyx tURg== X-Gm-Message-State: ABuFfoh48ovQTzk2oh+7GOf8cTZA3kJJDYMXfpYGrMHNxFJfn8OTblPc ieLeAnQnhkyhu+GlzGbtMg== X-Google-Smtp-Source: ACcGV613h0pOzjIrc1b0bLX0Pbnh3JQz+9kYuuurRtZf63n66iVctN4BPM50OjeG+9ySTT3eIlyp2g== X-Received: by 2002:a6b:c917:: with SMTP id z23-v6mr10417912iof.297.1538094616421; Thu, 27 Sep 2018 17:30:16 -0700 (PDT) Received: from localhost.localdomain (CPE1cabc0918a93-CM1cabc0918a90.cpe.net.cable.rogers.com. [99.229.26.117]) by smtp.gmail.com with ESMTPSA id i8-v6sm1355106ioa.6.2018.09.27.17.30.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 17:30:15 -0700 (PDT) From: ryang To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ryang Subject: [PATCH v4 2/2] iio: light: bh1750: Add device tree support Date: Thu, 27 Sep 2018 20:29:58 -0400 Message-Id: <20180928002958.3935-2-decatf@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928002958.3935-1-decatf@gmail.com> References: <20180928002958.3935-1-decatf@gmail.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add device tree support for ROHM BH1750 series ambient light sensors. Signed-off-by: ryang --- drivers/iio/light/bh1750.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c index c3a481452b67..28347df78cff 100644 --- a/drivers/iio/light/bh1750.c +++ b/drivers/iio/light/bh1750.c @@ -307,9 +307,20 @@ static const struct i2c_device_id bh1750_id[] = { }; MODULE_DEVICE_TABLE(i2c, bh1750_id); +static const struct of_device_id bh1750_of_match[] = { + { .compatible = "rohm,bh1710", }, + { .compatible = "rohm,bh1715", }, + { .compatible = "rohm,bh1721", }, + { .compatible = "rohm,bh1750", }, + { .compatible = "rohm,bh1751", }, + { } +}; +MODULE_DEVICE_TABLE(of, bh1750_of_match); + static struct i2c_driver bh1750_driver = { .driver = { .name = "bh1750", + .of_match_table = bh1750_of_match, .pm = &bh1750_pm_ops, }, .probe = bh1750_probe,