Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp926086imm; Sat, 22 Sep 2018 14:06:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV61rL0UX0/jaMM2qG/3REa2CdIf4wAL510i1uwrQ00rwvQxfJCU5+vT96hVAsP3wrA2OjkTv X-Received: by 2002:a65:614a:: with SMTP id o10-v6mr3459736pgv.387.1537650376858; Sat, 22 Sep 2018 14:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537650376; cv=none; d=google.com; s=arc-20160816; b=T5onYyzieEhkMvG4LYCKDvnkMEpJO5q+brP8L17/W/1Ul7kELDEmZHlAwMutZO/HMK NVXyksnoKfUYiXeK8ZBr2fFe+piwcxsU3NkvOxgbdWytYnrKmUsdZafwvEaREIcw0uiF 27ydwh22AfqPGIuQbtYtuqBADqv3ySpMmLt5eAzOjDmU7J5UcQG+ijlUmO/j/UGINvTz nK/k2nGFIpICf0WB0besgUrDUIxoWlTPzoIwkvBT31/seBOVNrkHuCPf26f5ccO/DDSH zHzGOFEUQQlueud9gELEq1lWynThvLu3ebeo2SVdifIYyJuwIDFnLkcsj9jBdYsJ+v88 ax0w== 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=Okr0gpZasaFK+qBiTnPoSbne6DKDnF/3u/L88sI9zXn88DG8A0MOcyYwjgA3b4jp+E jU5ZhUBWJjzAJt/y3bMsjHTQgX9VBohYpUrNzIBr3fz3vAIn0H0BjpcUhnLMfZla7eqg cnSD2rfdyLKAo0nehxRpyzN6K99v43Cm2LpzJXtHOED//lcW2RC/Ie+aNqfWDZ7ojR35 lKMxyNzXh5PnUkCRh3McgYcQLpbg/Pe5wZVFYcUk2VhKaJwMTMJ2Z6+N2JADGgX/0dpl 6S2iF765rRKqdjc6NSmGYfPTgi4YJWpt6TzQD6DOmqqV5goC2GgyzRG98BJ9neeiwXp8 qrAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VArYk0Zw; 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 187-v6si1810746pfz.119.2018.09.22.14.06.02; Sat, 22 Sep 2018 14:06:16 -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=VArYk0Zw; 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 S1728279AbeIWDAv (ORCPT + 99 others); Sat, 22 Sep 2018 23:00:51 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:36006 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727052AbeIWDAu (ORCPT ); Sat, 22 Sep 2018 23:00:50 -0400 Received: by mail-io1-f68.google.com with SMTP id q5-v6so15001388iop.3; Sat, 22 Sep 2018 14:05:53 -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=VArYk0ZwKqfpsu23LJuTDU/QXaSYybhX7viKFjGC0ehAhGUHMXvkco/e9X+s1PaYnh LG5X1EvwDsvlndjAOFEOwzNllAdpE5/gill6AZ1beu4WLyxgfQo5bL8rPSGTlp6QmI3F gl2vsdjvIkRKkjenLFS0gZfL3gB2+Jd/9dezchLyrfkdRnni5WAUN4wq9VFNwNfih809 luKAL8PjqOiCacAKNDC73kQoaSpLjzluP+N6GlkAPJZET+i2CCzu8EN7GynnPBg7nCm/ i3s6tDP+X78u7Dj9LTPJvRRwXrW0ncc5rGMzYEiqhJaNSqyGw4Gm+ejNYJ0xY1N0i7ui KaJQ== 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=LE6wEcitc+xB0De01Bj4q1KWZssyI0zY+YU8fq2utnqUcjhsDYht1MWDgt5yPedIOs iehTQf8s03i2aBXJmf9Ypem5BfPq151TaYnrQLRePynfzyuD9GUPgssc1Gl9Zhp+EjMy irWAlnMyrVMwcIBOcrO085kQ2n4SPi0+9cDQGDWATAYQhofBY1fsw+vObmOe3ZqxQQ6F uUd7I1Kj5sXLS8IAmaBN7GNjSJ8vp/fUsd1uFSctiL/cVvHq+/72wgcPQTSdIbZlY+X+ R5nkcSXT5l9LNMkyHTyoNNBwxo15e/9fA34UVbqmz0K9bPJSwoj73qY3uDaP15WwH/7i 9XXA== X-Gm-Message-State: ABuFfojtvOaCsAILtzrf79qFVKJ8WzGp90pJiDlrGMOywFKBSnt0R0Ni 85ETeJN8pJZOHFVax0b3K8CPA+0= X-Received: by 2002:a6b:9704:: with SMTP id z4-v6mr3035101iod.110.1537650353284; Sat, 22 Sep 2018 14:05:53 -0700 (PDT) Received: from localhost.localdomain (CPE1cabc0918a93-CM1cabc0918a90.cpe.net.cable.rogers.com. [99.229.26.117]) by smtp.gmail.com with ESMTPSA id t24-v6sm4206532ite.12.2018.09.22.14.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Sep 2018 14:05:52 -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 17:05:39 -0400 Message-Id: <20180922210539.6670-2-decatf@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180922210539.6670-1-decatf@gmail.com> References: <20180922210539.6670-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