Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2756305imj; Mon, 18 Feb 2019 11:36:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IYdVT1WpFt8Y18py9L0GYGn2oL9rqnRViODixqkMXmtr3bNFh0zbkAA02/Xdn6X1LNHeWfe X-Received: by 2002:a63:ed0b:: with SMTP id d11mr6341624pgi.435.1550518585636; Mon, 18 Feb 2019 11:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550518585; cv=none; d=google.com; s=arc-20160816; b=JEtnYEfhkBMG5LCbO3gLp0Ya3vzi8RhzNgySi/brZaIL4MtW6RPMV/Yo6j/NxZSUcy CHo5Ft3ELNDqgsQdtnpyqH78CHHYPjhMoUg3ozW3Ky1c3O4sIA4zBn68yaX/GqxiscnV TY03rKyYAVxofNTU79sQA5MoHxGppjnxxGpkY7GK3OeSXSxrpmTfeZBIgfUkCcpdGVX0 p47j3mos6xqlJXTWQyZ017lvG05sqyUb6UeVXXZO6KSomLSjzO2NHfXj80nQbmlBA4Ib 5EwjUHvStw2ygCIf+zUdkUAB1dXMIAvUhdAevvrsd4+75ZI4bxy1UmyGcs+KE9zuAM/T AsyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=W39jONSIIz31Rzrkgl43XEJB24YV1hoz4JWOKqmfsso=; b=mhf/Q9kll+AJ1c465Qj8Sd6tYEl/JCB6QCagysuV5m4m8V89yvJFfSREmxs97kYldw 8MT45qBztoruc9spxjLlywuZ7z/4N6jUNB21/GjuhsXC5RuiCoLfYBKmV73iSNFsdmrD q/0sznH5zLNaLLjIWAsnkBccmwC65Hh9KBJ8bVWTK8AmW8vaL6qLT+WQMtLkYN797SS/ 0lebdLbr79VGcD+GLIQF12wh0StpeQ1+iYZNV40Yi//sd7JeWnmbdDTqQ8TdxxI/NwTB XuC/bwNE+czFui9mfNXw51rwfZZ6BaU9t/Ik164Sur6v7kDfBEmoaCT9knr77JquJqVO +f3Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 r184si13444696pgr.266.2019.02.18.11.36.10; Mon, 18 Feb 2019 11:36:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729253AbfBRTSx (ORCPT + 99 others); Mon, 18 Feb 2019 14:18:53 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:36075 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728416AbfBRTSx (ORCPT ); Mon, 18 Feb 2019 14:18:53 -0500 Received: by mail-ot1-f67.google.com with SMTP id v62so21286815otb.3; Mon, 18 Feb 2019 11:18:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=W39jONSIIz31Rzrkgl43XEJB24YV1hoz4JWOKqmfsso=; b=KgnOrjfUTKC4mIU2tmKUXzXoUMM/q46D4HTTsVFtE6WOb1iaVsrby23REwkHIjLb88 1LwvKeRaHQVqeFMiFl1aRMyaS3jx7ih87GEX/gvSwrBck8nJO5hMtvHCx+xDYBs1SoWA tKecGqodXRez6G5vJPx8F1L6FWHmpgVzyXXwglmoeL6yXwgJ7x3Q629WANWxL6fCoS2e 79miEUtTE/MNb7IQZ78yzKUpxBAjU7GiHdy996tpo2EoBRdVBfLbvbeiMbstJZhPOJ3b axiYEbmLjNwSlsNNh9cj5YLsTRsL5qzbUkk/iCo83uovypfybNPNDmIP5uwUcEfZOPSG +o1g== X-Gm-Message-State: AHQUAubkS5C+0zMarhKXnzPZeG44vfwoEVDgvxqNGnv1HSJpHd3F8rIm BNdF2E1nv9ZjRFEq0z3IMg== X-Received: by 2002:a05:6830:1092:: with SMTP id y18mr15592887oto.125.1550517531722; Mon, 18 Feb 2019 11:18:51 -0800 (PST) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id a62sm11226982otb.72.2019.02.18.11.18.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Feb 2019 11:18:50 -0800 (PST) Date: Mon, 18 Feb 2019 13:18:50 -0600 From: Rob Herring To: =?utf-8?B?UGF3ZcWC?= Chmiel Cc: dmitry.torokhov@gmail.com, mark.rutland@arm.com, xc-racer2@live.ca, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] dt-bindings: input: Add binding for bma150 sensor Message-ID: <20190218191850.GA31221@bogus> References: <20190202151806.9064-1-pawel.mikolaj.chmiel@gmail.com> <20190202151806.9064-2-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190202151806.9064-2-pawel.mikolaj.chmiel@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 02, 2019 at 04:18:02PM +0100, Paweł Chmiel wrote: > From: Jonathan Bakker > > Add device tree bindings for Bosch BMA150 Accelerometer Sensor > > Changes from v1: > - Add properties for all of bma150_cfg > - Correct IRQ type in example > > Signed-off-by: Jonathan Bakker > Signed-off-by: Paweł Chmiel > --- > .../bindings/input/bosch,bma150.txt | 38 +++++++++++++++++++ > include/dt-bindings/input/bma150.h | 22 +++++++++++ > include/linux/bma150.h | 13 +------ > 3 files changed, 62 insertions(+), 11 deletions(-) > create mode 100644 Documentation/devicetree/bindings/input/bosch,bma150.txt > create mode 100644 include/dt-bindings/input/bma150.h > > diff --git a/Documentation/devicetree/bindings/input/bosch,bma150.txt b/Documentation/devicetree/bindings/input/bosch,bma150.txt > new file mode 100644 > index 000000000000..f644d132f79c > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/bosch,bma150.txt > @@ -0,0 +1,38 @@ > +* Bosch BMA150 Accelerometer Sensor > + > +Also works for the SMB380 and BMA023 accelerometers > + > +Required properties: > +- compatible : Should be "bosch,bma150" > +- reg : The I2C address of the sensor > + > +Optional properties: > +- interrupt-parent : should be the phandle for the interrupt controller This is implied and can be dropped. > +- interrupts : Interrupt mapping for IRQ. If not present device will be polled > +- any-motion-int : bool for if the any motion interrupt should be enabled > +- hg-int : bool for if the high-G interrupt should be enabled > +- lg-int : bool for if the low-G interrupt should be enabled > +- any-motion-cfg : array of integers for any motion duration and threshold > +- hg-cfg : array of integers for high-G hysterisis, duration, and threshold > +- lg-cfg : array of integers for low-G hysterisis, duration, and threshold > +- range : configuration of range, one of BMA150_RANGE_* as defined in [1] > +- bandwidth : refresh rate of device, one of BMA150_BW_* as defined in [1] These all need vendor prefixes if they stay. What determines all this configuration? It seems like a user may want to change at run-time in which case sysfs would be more appropriate. I don't recall seeing other accelerometers with these, but seems these could apply to other accelerometers. In which case, they should be common. > + > +Example: > + > +bma150@38 { accelerometer@38 > + compatible = "bosch,bma150"; > + reg = <0x38>; > + interrupt-parent = <&gph0>; > + interrupts = <1 IRQ_TYPE_EDGE_RISING>; > + any-motion-int; > + hg-int; > + lg-int; > + any-motion-cfg = <0 0>; > + hg-cfg = <0 150 160>; > + lg-cfg = <0 150 20>; > + range = ; > + bandwidth = ; > +}; > + > +[1] include/dt-bindings/input/bma150.h > diff --git a/include/dt-bindings/input/bma150.h b/include/dt-bindings/input/bma150.h > new file mode 100644 > index 000000000000..fb38ca787f0f > --- /dev/null > +++ b/include/dt-bindings/input/bma150.h > @@ -0,0 +1,22 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * This header provides bindings for the BMA150 accelerometer > + */ > +#ifndef _DT_BINDINGS_INPUT_BMA150_H > +#define _DT_BINDINGS_INPUT_BMA150_H > + > +/* Range */ > +#define BMA150_RANGE_2G 0 > +#define BMA150_RANGE_4G 1 > +#define BMA150_RANGE_8G 2 > + > +/* Refresh rate */ > +#define BMA150_BW_25HZ 0 > +#define BMA150_BW_50HZ 1 > +#define BMA150_BW_100HZ 2 > +#define BMA150_BW_190HZ 3 > +#define BMA150_BW_375HZ 4 > +#define BMA150_BW_750HZ 5 > +#define BMA150_BW_1500HZ 6 > + > +#endif /* _DT_BINDINGS_INPUT_BMA150_H */ > diff --git a/include/linux/bma150.h b/include/linux/bma150.h > index 97ade7cdc870..b85266a9c35c 100644 > --- a/include/linux/bma150.h > +++ b/include/linux/bma150.h > @@ -20,19 +20,10 @@ > #ifndef _BMA150_H_ > #define _BMA150_H_ > > -#define BMA150_DRIVER "bma150" > +#include > > -#define BMA150_RANGE_2G 0 > -#define BMA150_RANGE_4G 1 > -#define BMA150_RANGE_8G 2 > +#define BMA150_DRIVER "bma150" > > -#define BMA150_BW_25HZ 0 > -#define BMA150_BW_50HZ 1 > -#define BMA150_BW_100HZ 2 > -#define BMA150_BW_190HZ 3 > -#define BMA150_BW_375HZ 4 > -#define BMA150_BW_750HZ 5 > -#define BMA150_BW_1500HZ 6 > > struct bma150_cfg { > bool any_motion_int; /* Set to enable any-motion interrupt */ > -- > 2.17.1 >