Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3970651imu; Mon, 14 Jan 2019 12:22:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5wNuwrGHSFkhWpIP18gezYxg4pYUtKxupfNrzZM607xQePXIlHGeIZ1OnUcKhUYajMLJd4 X-Received: by 2002:a63:304:: with SMTP id 4mr246420pgd.99.1547497352041; Mon, 14 Jan 2019 12:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547497352; cv=none; d=google.com; s=arc-20160816; b=wDhXGZkFhcryBsR/exemU+k7Fvoh3aZF/I3mWizWRIaf/oGJYTYq0+PlJi4MMy5JWu 1cjwhtSh7S16WuWRmlRBd9gTfdiNj7IOv1SU+nLuzp9zqDhIG2i1z8FmyEwi5CMUGStz 1eVf8dP9uxlV3F9V06zaopgvp3zLkNzWwsVvHwS3CaJdoOS76VnoE3qBg4cYQJ35yBa0 /pBg/QJEoNrE0U/ZJd8f+GnB7cbPdkeCrrlY2rGKMCd8WWy3LU1KTUSxhfamcNtqDp/g fr8d2amhQfsnkJgSMkdKPOX2q3Ck9o8/MBRC91c8Y6Do5GTdvW2tsocTDqED+XAlVLGO uv+w== 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=r7/vljl9wcoslPN7/8KEh45eFBFCMxetW0Cqy/5oxxQ=; b=JSBqed8mqC768Hm0HCsicjpHCyP54ashtOVOHwwGDnpYdocVXKNW7eh7wRVloTirhQ JMonFC2kj2l7tHUYthdmeMkGt5PE4AB5wRNjXJpObeuMEiNMEXVWv6reWPLVchBnW+BU XyELNfYMWWEU1+2F5r+Oxkwgx8gZPM0zIdWFJHy8430CbLgHlhmNwgPoS9aOObPnWODm NffjKxpANJ5J/jSY5IXHm/VidWWEO0244s5RWDPocqqy+nK64dsjGTmcINaIwnn0dHhw MkMHmylFT+l3J1GhcEsn3U7MfUZT25/ZjuMZ3mHrG92NbkxyJMEu2KhpITe14O+Z5amr /yDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E7QHgD9d; 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 y141si1217530pfc.180.2019.01.14.12.22.15; Mon, 14 Jan 2019 12:22:32 -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=E7QHgD9d; 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 S1727003AbfANUUP (ORCPT + 99 others); Mon, 14 Jan 2019 15:20:15 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:35839 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbfANUUO (ORCPT ); Mon, 14 Jan 2019 15:20:14 -0500 Received: by mail-it1-f196.google.com with SMTP id p197so1342057itp.0; Mon, 14 Jan 2019 12:20:13 -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=r7/vljl9wcoslPN7/8KEh45eFBFCMxetW0Cqy/5oxxQ=; b=E7QHgD9duPz+gnRc2u6DwA2n0U2nX+1R2MgkCV0sJc16rkvYhAxma7KygNBz4cXA2M ValihZGYgm4prV3qZQxmvmlV3E+a2bOkDgYqQ5VuGP7LaMNndKItew8VlOD6GQL+wys0 Hm7bwN0H9YeU0c6owmG2J9BiseIBnls9Ns4dQg12FFDcuhI2mxuaY2+CGY1cjPjbPdz/ MXWRRnPKTcDTj65z4TOkuhR+gqunnjji/5ZWkb+r3I+gy1oZawiwqeF9+fOnJgel87RG KnCA7JwIJdVQXFT6UMxPGoJ0ULqoArpYV7zHmNgn97HTZe0sLrSfK8MYz4/IYgU7HANl S3lw== 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=r7/vljl9wcoslPN7/8KEh45eFBFCMxetW0Cqy/5oxxQ=; b=PvPBCigK8tBdm3Ux+CGoc0oYm/0qnmvz9TcQhrrO67ho3892s67EDEmCY1KKQda3Hq ur/vd9PAXi+q60jRvTYhw+KEdmamPJdnszBmyL32D0Kdz/CBzrnoKqblLtkEP57ZDtWU TVD77DlOwKc5t5dxk+voKB1GPHGrnAzkmlyQ+3q6u7i2n3NE8gnFVXuL84T0sv0ptyz7 c01wp7vQ1kjaNE0XhF18yJUvol+0auccTwoNwJdGyGwArqpVlTWXw6AYVZp4nWi0W8Tg LUoblvM4bSOdiqfrTjJyo11sCXeW4Rc5tLgOKD4hKc28H6GXs+3oMlp0zjucYkz6vVOm htpA== X-Gm-Message-State: AJcUukdoBM9lRQiYFGJKkwY7TdBIF7mODexxDsZ6nABRpCptu81m2iKs bMfZGLXNHY6ot4QttUYr+5khyiCkoME= X-Received: by 2002:a05:660c:914:: with SMTP id s20mr571441itj.160.1547497213108; Mon, 14 Jan 2019 12:20:13 -0800 (PST) Received: from localhost ([67.218.223.154]) by smtp.gmail.com with ESMTPSA id m37sm704233iti.6.2019.01.14.12.20.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 12:20:12 -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 v3 1/2] iio: chemical: bme680: Add device-tree support Date: Mon, 14 Jan 2019 15:19:13 -0500 Message-Id: <20190114201914.24572-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 --- v2 -> v3: - remove of_match_ptr: Suggested by Jonathan Cameron - minor style fixup - rebase on master v1 -> v2: - add missing of.h header in bme680_spi.c --- drivers/iio/chemical/bme680_i2c.c | 7 +++++++ drivers/iio/chemical/bme680_spi.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c index 06d4be539d2e..b2f805b6b36a 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 = 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..d0b7bdd3f066 100644 --- a/drivers/iio/chemical/bme680_spi.c +++ b/drivers/iio/chemical/bme680_spi.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include @@ -110,10 +111,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 = bme680_of_spi_match, }, .probe = bme680_spi_probe, .id_table = bme680_spi_id, -- 2.20.1