Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1015930imu; Fri, 11 Jan 2019 13:20:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7EovolKfHlnP68P5R/9jy4DL+Se8ytBf55KUNFDsS3H7GbSmH+3Nxe7pr0qUlBzmr4xK8p X-Received: by 2002:a17:902:5a86:: with SMTP id r6mr15633241pli.301.1547241607621; Fri, 11 Jan 2019 13:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547241607; cv=none; d=google.com; s=arc-20160816; b=FCQTVPtnDzjdG3cg/VWvRrctfolekM32CHwWz2tddLuE+GCoUE24tSDJEDyeM6hl5J Eh62b13ga9kTmWAclWaz0xzae9FgushOwILutXkloG+CLX2jG7hdCiyW9ZtLSmskzD9t K8ztbPxZd7pEnEfX0HrrjkimD2Ln99u56vdhCp1FLYC+uSITCkIbe0XVhH/FfTOCqcGx 0ziGF0loXA3QN7hYbeCSjFZ0NPYEaSX92+nT6jBfpBVqw1aVx/U7u4kf7fUCeU0yzta5 oSzO4dv5I9oA0XL1d2TRvoBXUC4y6+5ZQnInbFbJXxiTQAQGF2PFX5jkPqJzbr+zRkv3 bEkA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=DCso5ZbmVHYu/esiOc82HERwOygGoElOLZSw3fJOn90=; b=jTeB+GY/TbhrzICD3mDCBcocYV5LZ0wgMGrp19NhtmuY4RwHCRg8IENw4oYP01/WhW 7iEj5Vza5RR2e5bJXKAxgImNqLIdGCbazvEji6GwYZIEecbe+XfUM81XsUJmYpChRW/5 qRD/EtceGcTGHnZzw9pAaYNa8dRd47urJrhPr84AlCRsF1MCGqIGatZkE7YcKFfRJAl8 CGZZTUkVxsIDF0FVw704QnDU0xFhfMaYIa/fd/abwZJkHBbgAVpVe0/7isIEmK91Mb1b c+VPxWPJDPAwX+n3MyH5SG/PFai3ynIGKQThXwTrfMQcpC0vry8dw+O11z65Kfm0i5hv F03g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rJJH+94B; 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 d37si11221606plb.140.2019.01.11.13.19.52; Fri, 11 Jan 2019 13:20:07 -0800 (PST) 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=rJJH+94B; 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 S1726581AbfAKUyw (ORCPT + 99 others); Fri, 11 Jan 2019 15:54:52 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:38345 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbfAKUyw (ORCPT ); Fri, 11 Jan 2019 15:54:52 -0500 Received: by mail-io1-f66.google.com with SMTP id l14so13208516ioj.5; Fri, 11 Jan 2019 12:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DCso5ZbmVHYu/esiOc82HERwOygGoElOLZSw3fJOn90=; b=rJJH+94B+3BsUApjTPkw9iyErUzgDiZ02H7IpUnzyc/MNLEA9QJx4BzBeTeG1oqkeB eazkyGMBaUgFF5p2Y5K7UI959sQOpTBpDhyU4kib+TiIMRuLqc0FIftJiwTTlj4CgDvY 9pA2b91r7tcVItXZuKBSQYNaOylcf0nBGuOnKltPwh3T49TVSiUAMcjSQO2K0LTRgG5s jOCmV5MVmz0VBC+6ZudIoK0+A9ghm7zxbuneuOqTVpck3HFJlU83BN5jAVec9KzN1bSg OL/tGQHafHygjU6bvyjjRYbEtwP0ZoYbA5jgjPhxXVLviBoepbFgOQ3999McC2DgzhYV ydHQ== 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:mime-version :content-transfer-encoding; bh=DCso5ZbmVHYu/esiOc82HERwOygGoElOLZSw3fJOn90=; b=qqy/kfYzojhWjlQG8UqYjL9SN8s4hPdmdP63NBhfIpudRngHGKLNuomsSBC2yoxEJt KTDFds7DcERNnvvXnhPbi+1CHO4BTQJzDwj9FClWYg8QsVwcGDxyOU/r0AYguH8ZfOyL HS0N/i/L1UxV2/Ni+QSl9g5795IbEEF6N4o0YALMeKxNshZKBD2SqddLa+FM+iTlFPmL OuXyzWUmmhe48yHXIDZlwONEzp14driKV7UALcMIyvqNmZgDQZu9rne3MeHyzwHifSLP Pe1faNeMZvNBmQXP0K2FYEl1BKPzpui+ctnocUZYLFkzqUeNQh4Y5w8sUwMcGPMTCChy FPhQ== X-Gm-Message-State: AJcUukfpamXQHUincuhAAnCiTyK05AKnDlZmAwJEzJ/tErZWGIrtfFZP 68BO0m+PHTw+lCwjMF+3gZSL7NqejNc= X-Received: by 2002:a6b:c9c8:: with SMTP id z191mr10823236iof.13.1547240090421; Fri, 11 Jan 2019 12:54:50 -0800 (PST) Received: from localhost ([67.218.223.154]) by smtp.gmail.com with ESMTPSA id i135sm12115821iti.34.2019.01.11.12.54.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 12:54:49 -0800 (PST) From: Sebastien Bourdelin To: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-iio@vger.kernel.org, himanshujha199640@gmail.com, mark.rutland@arm.com, robh+dt@kernel.org, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org, Sebastien Bourdelin Subject: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support Date: Fri, 11 Jan 2019 15:53:58 -0500 Message-Id: <20190111205359.14158-1-sebastien.bourdelin@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit allow the driver to work with device-tree. Signed-off-by: Sebastien Bourdelin --- v1 -> v2: - add missing of.h header in bme680_spi.c --- drivers/iio/chemical/bme680_i2c.c | 7 +++++++ drivers/iio/chemical/bme680_spi.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c index 06d4be539d2e..94a36ebdf0b2 100644 --- a/drivers/iio/chemical/bme680_i2c.c +++ b/drivers/iio/chemical/bme680_i2c.c @@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, bme680_acpi_match); +static const struct of_device_id bme680_of_i2c_match[] = { + { .compatible = "bosch,bme680", }, + {}, +} +MODULE_DEVICE_TABLE(of, bme680_of_i2c_match); + static struct i2c_driver bme680_i2c_driver = { .driver = { .name = "bme680_i2c", .acpi_match_table = ACPI_PTR(bme680_acpi_match), + .of_match_table = of_match_ptr(bme680_of_i2c_match), }, .probe = bme680_i2c_probe, .id_table = bme680_i2c_id, diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c index c9fb05e8d0b9..caa57287a911 100644 --- a/drivers/iio/chemical/bme680_spi.c +++ b/drivers/iio/chemical/bme680_spi.c @@ -6,9 +6,11 @@ */ #include #include +#include #include #include + #include "bme680.h" static int bme680_regmap_spi_write(void *context, const void *data, @@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, bme680_acpi_match); +static const struct of_device_id bme680_of_spi_match[] = { + { .compatible = "bosch,bme680", }, + {}, +} +MODULE_DEVICE_TABLE(of, bme680_of_spi_match); + static struct spi_driver bme680_spi_driver = { .driver = { .name = "bme680_spi", .acpi_match_table = ACPI_PTR(bme680_acpi_match), + .of_match_table = of_match_ptr(bme680_of_spi_match), }, .probe = bme680_spi_probe, .id_table = bme680_spi_id, -- 2.20.1