Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2770398imm; Sun, 16 Sep 2018 02:45:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZY3wBFy/G1mQQiimr/9zHuvhe3X6d9fbl2qTQ72WgLQGqbx6221XMgcu5wxM8bJDs+srH9 X-Received: by 2002:a62:5d03:: with SMTP id r3-v6mr20925899pfb.150.1537091146423; Sun, 16 Sep 2018 02:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537091146; cv=none; d=google.com; s=arc-20160816; b=N9xQfTD7WSv8nyQEnPZPjx9P8NgXpAgca6M6AO3LgM8YJxnNW+f+RZHE+6SLAmKCE1 WG1DNO5dMQf2/Wfstm6HEGl2ecUeAYF9wD4orVF4oOh0hJCI0pSWvd4H7lZEm/sYUkUR /AJzVWx0jHSbK7Q5hyh9zehdIUlKwDWoCMPIt/3758TAFZxlusqPGe0/NFMmqhlfwhz+ +4v442WH8zn1XQxEBq7NMVrPo8u4pVoiDiYLkix7SN2iImKajccmqorfIT03vRc+7YaT 1WoatKZwZGEv6ATmBTFYfQAnq5uvUo4G/2K2OszlSD9f/nzmeU9pEUCsDQVe/+ajM2At clUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mIE+8jGk7mqBVB56oN5r9GZqabs71t9gyJ79GK7hjY8=; b=dMPFOBu82+H2lx8NpUtklgjeg+qcBElXSu+XfrFhFhpdjhsQ5UVWjTGeB0fLuzyvrU XIA0GvOmmXHrK0uI9OSaqZ9Kyqh/i6H5nXp1kYkG6LNd1w02drXmVee0OLXmuIGW78rX Km/38zGF4TFm+lMpth1NNB+6X4iiH/BDHbYnkJcn+f7DIH3EOryHIRDjm6qLaRS84aZF SE3emP+9TpTaBSlRA/PMsNPCk3mOrPKlaCoBO5Rt3YZByRm/qmiOo+P9zpG7ipk9CbNI nJ0WuIAUrpCBheDLR6y0AekVELE/FBYywWpGi8J+/cP5+mQ/epZ3Fh2Zq9ROKlIGRGDC yAmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BtFtsrg3; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j38-v6si12153706pgj.613.2018.09.16.02.45.31; Sun, 16 Sep 2018 02:45:46 -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=@kernel.org header.s=default header.b=BtFtsrg3; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbeIPPHq (ORCPT + 99 others); Sun, 16 Sep 2018 11:07:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbeIPPHq (ORCPT ); Sun, 16 Sep 2018 11:07:46 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ADF92087E; Sun, 16 Sep 2018 09:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1537091125; bh=vVt/mQWCTpC1dp6dJ+o5VLhq7AtKcJU3iNvTg17WBGY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BtFtsrg3oXS59CueOdeQtzKAL2XR0+ziCSd0oG2CWOB2e+Xzkkw6uykZQGvBY/0gB 8kDtmTF4csyhgQJP8+gDnaihUu/ePjERO6IpFkGmAQf83Olf+Pon0FYLE8hGAotKZU PK0bNbKJ3TuYEmuzUssH/x15hQlfnGDCT7AJszvs= Date: Sun, 16 Sep 2018 10:45:26 +0100 From: Jonathan Cameron To: ryang 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 Subject: Re: [PATCH 2/2] iio: light: bh1750: Add device tree support Message-ID: <20180916104526.2c386591@archlinux> In-Reply-To: <387c145949692c0318f90d98426be95c82ea2e58.1537033044.git.decatf@gmail.com> References: <387c145949692c0318f90d98426be95c82ea2e58.1537033044.git.decatf@gmail.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Sep 2018 13:42:14 -0400 ryang wrote: > Add device tree support for ROHM BH1750 series ambient light sensors. > > Signed-off-by: ryang Just to check, how is it picking up on the enum value which is provided in the i2c_device_id entries? i.e. What is setting id->driver_data in the probe? There may be something in the i2c core that I'm missing that will do the association but I don't remember anything trying to do this. Jonathan > --- > drivers/iio/light/bh1750.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c > index a814828e69f5..50b599abb383 100644 > --- a/drivers/iio/light/bh1750.c > +++ b/drivers/iio/light/bh1750.c > @@ -315,9 +315,19 @@ 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", }, > + { } > +}; > + > static struct i2c_driver bh1750_driver = { > .driver = { > .name = "bh1750", > + .of_match_table = of_match_ptr(bh1750_of_match), > .pm = BH1750_PM_OPS, > }, > .probe = bh1750_probe,