Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp921259imm; Sat, 22 Sep 2018 13:59:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV61rNWb4GAjEUu3BpQa5fZq7XPjrd8A0kMjLcpIls+HgQ7vjOOfaARRWKyFvthV7n1v0QZw1 X-Received: by 2002:a17:902:a5cc:: with SMTP id t12-v6mr711547plq.229.1537649958160; Sat, 22 Sep 2018 13:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537649958; cv=none; d=google.com; s=arc-20160816; b=KyupWKafJB5nT8KmseazqTbRppp6SlYoossX/j7BWX3Kt3jt+AZ1IN+EIYGiQ3YTwa OybrDgZwYV7Mj3RSRb5/kID4EkvuZqf2GM39gLFrC7IsyL7FG3WsGLxNCQ+SuDXzZWfE oTzi1ME4zVT+UcbCDfFdfDca92gAAhxHJ/m8+1ewqzbs0AS4ddROfdfSaHiDzspAIBAI 0b0lnUTjxemxmGrU98LW32SMEt00E/OLcO0iExzqML0uQxN+AZz+FQE+km78TWAsUZt0 Eci85FAYTNY2Az1ZfIhqqp7GhHrtxUDiZQf+qN1uaHKlLBsLuXrWevL7STsrpn3bAxYk kllg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=IHsv1kVPjHiFN5CDlRUXNfvFEO14wRvjZvBGLfsjNrM=; b=x3HX3kSirCYyAM9yv3RzpJmkVQvIZlGPtjeKcMjaFfUFTctxlUtfc3dV+6Owdd4LGC ZxXgIv5dPKlQqpgFOLczK/e3zfPlJmOY9FdFhc0jOh23dpUvc9jPXUZPcrQWg9hOqm27 8Tj63tByjPPqk/IVupPNgmYb+ZBE7gb4wucAdvfpFN1ZPFl7P7Sc9t3QIbkhuAe8DBqe u4tqCfhNnHV9SL5n+Rvu79KvQP+0GTAys2C/irpGy1q1s6bCAk2IcizB8yjxNjEhTmwm m+MGAxd7jDrZbks4Hej/mc/K7jTGQ2VuDQbyfQssQkA3ue7WtI1ADL5ztbPuNiSh/JXw joCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="DkR/JujG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si29784508plt.325.2018.09.22.13.59.02; Sat, 22 Sep 2018 13:59:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="DkR/JujG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbeIWCxo (ORCPT + 99 others); Sat, 22 Sep 2018 22:53:44 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:45490 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbeIWCxm (ORCPT ); Sat, 22 Sep 2018 22:53:42 -0400 Received: by mail-io1-f66.google.com with SMTP id e12-v6so14950791iok.12; Sat, 22 Sep 2018 13:58:47 -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=IHsv1kVPjHiFN5CDlRUXNfvFEO14wRvjZvBGLfsjNrM=; b=DkR/JujGC6QZq7kfnWQQqTt91/Kgjfiu5RXrScIz+dJibGoo53UjxUHicbdKFk5izg t03xYzy2NwUX5gbjUD1NYEAqMq/3V1xhpPUSsp/uSOZaWQZ4/cGSYqRtukDA3wh1eziW 9VX60W3LD9/lGO53Md1wvDVMNehMbB7/HRx1o/lXybX36LbJGtUSizcxU78oIyCtQj5a WfjLOwwiXTV1HD6U1cGzTqi/rH0D1jINskphnQQRYB/d0CfB5lo11Oivj6CO22t93RUo 5YkVwFJcIyvneRY8QC8ut74PsLDYUHhHNi5Y5muP0m65Xi9ogDJyPjDKrutKmhm/uSXp 7mhA== 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=IHsv1kVPjHiFN5CDlRUXNfvFEO14wRvjZvBGLfsjNrM=; b=Z9ZAC45rrYvwNPpW/hOAlLZPNeGtusjjghXJSBLI0V4HsstPYyOB93Mn8zeiSFoW4G oQu3PVwh8BZmL0dkZVJ5B4TWoVPCWtzCQUJBnlUIdHqByqt/A1qYQ0Wyjpa8DLlxASqo SPfk8A+fnoOgD7kz0KgcBJJLVej9yBlpsBXYpDmg4iytvpIYODotg3xX1gg3fHdKyJaX DUGg9MlIybx6A4+owNbh5M6TS83c603GheK0uNS92w6kIyNn1pc7EnyI9ROhOo96pkoT qRgfCuBi62avGRoBlh0BuzXuJsmPN5awIrK6wQmDMyloQi5+832mjK5sW3+ncHzKlhPZ EGxA== X-Gm-Message-State: ABuFfoj6m6bjmagfeGxUNZraO8JNrs+JUoLwDCgf83/mEJTlot5lgZL7 EPE/OMAqFz6x0ilLKI9EGg== X-Received: by 2002:a6b:c085:: with SMTP id q127-v6mr2896530iof.255.1537649927138; Sat, 22 Sep 2018 13:58:47 -0700 (PDT) Received: from localhost.localdomain (CPE1cabc0918a93-CM1cabc0918a90.cpe.net.cable.rogers.com. [99.229.26.117]) by smtp.gmail.com with ESMTPSA id k62-v6sm4465306itc.21.2018.09.22.13.58.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 13:58:46 -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 v3 2/2] iio: light: bh1750: Add device tree support Date: Sat, 22 Sep 2018 16:57:54 -0400 Message-Id: <20180922205754.6100-2-decatf@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180922205754.6100-1-decatf@gmail.com> References: <20180922205754.6100-1-decatf@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add device tree support for ROHM BH1750 series ambient light sensors. Signed-off-by: ryang --- Changes in v2: - Export module device table Changes in v3: - Remove of_match_ptr so that bh1750_of_match is available without CONFIG_OF. 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, -- 2.17.1