Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4284298imm; Sat, 25 Aug 2018 13:23:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYwIrejEW7UP+yKmE5vhKYhj90zXlrE9f63l0XW7DQ8GEVT7HAnhH442j3LfXQcZ0Owq0Rm X-Received: by 2002:a17:902:b40c:: with SMTP id x12-v6mr6827419plr.163.1535228593508; Sat, 25 Aug 2018 13:23:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1535228593; cv=pass; d=google.com; s=arc-20160816; b=LFurMRHOPa5qwvRU/dtHsaooK3I7pFHA4JFONmOIPtt/Oou4erDBwC6j6xipRHoVrD A7jkwn9qilzcflNSJyePDJCFydiDeALWGwkSF2CRSsnzGskoi7ayrKtVa1cxsm9XmuiL tw+rb4cWf/Ud2b7oKCv812tPjIpYgKZLwMDH4iFAg5K0wiEznNpZr2jRvsL+8oTRGOqP YtWjxAcAnmAKVdcXL8/xIplaVUhFWpXFE+MTLckJ/t8qLAyWvfD5A9Uk96tNi3wGcZqR aS8dYcjF6b5cczUiiwxEvawnfR6fa0woRUuhOltsIVqbA1g6CFMbyYhXWikHuUN7mkgn 4Tfw== ARC-Message-Signature: i=2; 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:arc-authentication-results :arc-message-signature:arc-authentication-results; bh=x1y8z1ScXMqMp4dcthOupwjFxZWKxuFePaiKs83yras=; b=VZlwBtKt8v5dk6On/Iy6fmfmSY+HFIHGpCr7egwDkEh0Q8O5Zc6GMUye3sqiuzxJeB mYyMqAxJx502HvKBa1MM8r7erW1IvZz32BnAfr/o1klfXMkpTb6wk55nYEQE+cLfdHvr y9OWlS1CVlCfa1ry63qF5K60rcaPbmslw1xBxSlHm/NG/ySpEbnU8Qha1BL4WzL77IE6 douuwa1bmIdTLsfvKOOExZYL9h7PW+f6T7cQslUnJrqCoWbNzIZduk1MM6LsOq2bU0Wn SvzgYoTnZhyG5Vp10Xjgf006Bpr7FuVbbxPQmOLnbUV3HrJ4CvqZaaIoD1mrZjlPUlIi zJPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@az8.co header.s=dkimmail header.b=j1Ok4HuF; arc=pass (i=1 spf=pass spfdomain=az8.co dkim=pass dkdomain=az8.co dmarc=pass fromdomain=az8.co>); 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=az8.co Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si11463159pfc.132.2018.08.25.13.22.36; Sat, 25 Aug 2018 13:23:13 -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=@az8.co header.s=dkimmail header.b=j1Ok4HuF; arc=pass (i=1 spf=pass spfdomain=az8.co dkim=pass dkdomain=az8.co dmarc=pass fromdomain=az8.co>); 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=az8.co Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeHYX75 (ORCPT + 99 others); Sat, 25 Aug 2018 19:59:57 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21372 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726895AbeHYX74 (ORCPT ); Sat, 25 Aug 2018 19:59:56 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1535228371; cv=none; d=zoho.com; s=zohoarc; b=hGgOzZuwGmDyoUGqyoClN4u7E55gH/C62s73DvgaTNQ4ABTTJ+Gtvd9F56LNguMd1WtQ+mI+qq41hkA4HlSAERVk0QB1oP5OVenanZj5ypJ04VdU0hdp7VUnzVlDLlFfxIlWt5CltaeOsXaKQTyLgpHWGwUv6+q1/wDTVevQb/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1535228371; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=x1y8z1ScXMqMp4dcthOupwjFxZWKxuFePaiKs83yras=; b=GYypH/fKpqejIynW0PYA8uKV5/uli2gL6QD0uLDekIRzFDssOLGfbw7cP2hoqYi4T5C3UZCYFDUX6vAI+O2UQhHLeyaVogTpa/wU4ucSb2kFgBuC4CgKxZ4UoSpWgsic6n3/sJGmmBH6I/x+2n1JbFUsOE+gq2ZzNiwdHtwUdi4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1535228371; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=2017; bh=x1y8z1ScXMqMp4dcthOupwjFxZWKxuFePaiKs83yras=; b=j1Ok4HuFrvIiV6TQtRA2R6i5pxlvSmk2G+egVoXZGsLkZi7qms66SNjwrPdUHmSa lRONXPx1uCgH4TrGoQXPXgT4uba6ZkzxvPLlyM4wnNg8fDwEPodP83eh3wB+FFLfsC3 +hcwuUy2WXksxSlG8nm7ORGZ4MVwvxA00bRPsL0c= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1535228370732342.0937789412104; Sat, 25 Aug 2018 13:19:30 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 2/4] iio: gyro: add device tree support for fxas21002c Date: Sat, 25 Aug 2018 22:19:08 +0100 Message-Id: <20180825211910.22929-2-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180825211910.22929-1-afonsobordado@az8.co> References: <20180825211910.22929-1-afonsobordado@az8.co> X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds device tree support for the fxas21002c driver, including bindings. Signed-off-by: Afonso Bordado --- .../bindings/iio/gyroscope/fsl,fxas21002c.txt | 12 ++++++++++++ drivers/iio/gyro/fxas21002c.c | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt diff --git a/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt b/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt new file mode 100644 index 000000000000..62f8c1bad85a --- /dev/null +++ b/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt @@ -0,0 +1,12 @@ +* Freescale FXAS21002C Digital Angular Rate Gyroscope + +Required properties: + + - compatible: must be "fsl,fxas21002c" + - reg : the I2C address of the sensor + +Example: +gyroscope@0 { + compatible = "fsl,fxas21002c"; + reg = <0x20>; +}; diff --git a/drivers/iio/gyro/fxas21002c.c b/drivers/iio/gyro/fxas21002c.c index 7626b2f88d72..6fef210630e0 100644 --- a/drivers/iio/gyro/fxas21002c.c +++ b/drivers/iio/gyro/fxas21002c.c @@ -8,7 +8,6 @@ * Datasheet: https://www.nxp.com/docs/en/data-sheet/FXAS21002.pdf * TODO: * ODR / Scale Support - * Devicetree * Power management * LowPass/HighPass Filters * Buffers @@ -340,6 +339,14 @@ static int fxas21002c_remove(struct i2c_client *client) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id fxas21002c_of_ids[] = { + {.compatible = "fsl,fxas21002c"}, + {} +}; +MODULE_DEVICE_TABLE(of, fxas21002c_of_ids); +#endif + static const struct i2c_device_id fxas21002c_id[] = { {"fxas21002c", ID_FXAS21002C}, {} @@ -350,6 +357,7 @@ MODULE_DEVICE_TABLE(i2c, fxas21002c_id); static struct i2c_driver fxas21002c_driver = { .driver = { .name = FXAS21002C_DRV_NAME, + .of_match_table = of_match_ptr(fxas21002c_of_ids), }, .probe = fxas21002c_probe, .remove = fxas21002c_remove, -- 2.18.0