Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2575666imu; Mon, 19 Nov 2018 02:48:22 -0800 (PST) X-Google-Smtp-Source: AJdET5edFvwL8gJtD0QVmIO1iF29FnvpelGL2lTfR2db3lz9uLAiZUsv1i5LErMu08x92hgYQhAw X-Received: by 2002:a62:1d87:: with SMTP id d129-v6mr21918657pfd.47.1542624502886; Mon, 19 Nov 2018 02:48:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542624502; cv=none; d=google.com; s=arc-20160816; b=r/2vaEvkPtkL0AJuhCQVDJlwofsZMzPN/HwLNaYHDohfZX8HVt5CUDHzapwXa75W3D BcLJVenA/l6SJu7Z2BXav+m+obTQXbWt4Dfb04LosZdFGwXYuEVGgHpfQtqPlXinHnQx 1akwO7PN33Q80n+KiaqF33wsh1//N0siXUU4RVnAPfijYhnzmLlzHH4+crkBHVwDq2oJ pimn1nm0y4Oy4wG5EnLBrwsI2GomnLMnz8n3jdGg1QyHLQEY96gkt2uKBJZxQHs8zaPn 2omtcyfFipcp6sEFRRvJ09aYuMS5I/SvV2SEOA6tv+Wb492b8fvfKp0Z2RchuxfhFOTB me4g== 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:date:subject:cc:to:from; bh=EpmZYGWcAKN+nL3LBj52qugayDZvJCwWh8cTpMUVBt4=; b=x5vK0K8lPQlFbFHWkymh1m+hQPH7r6hmbsueo+MAbrtdnl2Qvg4QIziRaO2nJzEaj7 y+bNJn58ndBVeCy2zZEyL2Z4AW2euXJZI0qC0dM3vbMnpfweAHylg3W+RJFLZyJxI0Wm cSkljn+haMfjc9IXWKozO4/oaLJhdSMArPlkeoge5hrU+3dsfpxEoe8K82jzMyXiBjWN i3lZ9Rq4IljJa/+sjrSjmvoK2mKzYd0lgASybdc/RAh0Jg4uCarPR9FUvc07b43xA75o azTqIjLkvgGjWaaI8ZQ53ApQVhYFbnbuq+pFuLpOxVZLFWuEui+luIc+ZyWocWnDgHAV DYKw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t127si12759365pfd.21.2018.11.19.02.48.07; Mon, 19 Nov 2018 02:48:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727992AbeKSVJ1 (ORCPT + 99 others); Mon, 19 Nov 2018 16:09:27 -0500 Received: from mxout014.mail.hostpoint.ch ([217.26.49.174]:37341 "EHLO mxout014.mail.hostpoint.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727728AbeKSVJ1 (ORCPT ); Mon, 19 Nov 2018 16:09:27 -0500 Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout014.mail.hostpoint.ch with esmtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gOgkb-000BpI-An; Mon, 19 Nov 2018 11:25:53 +0100 Received: from [46.140.72.82] (helo=philippe-pc.toradex.int) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gOgkb-0007f0-5I; Mon, 19 Nov 2018 11:25:53 +0100 X-Authenticated-Sender-Id: dev@pschenker.ch From: Philippe Schenker To: jic23@kernel.org, marcel.ziswiler@toradex.com, stefan@agner.ch Cc: Max Krummenacher , Philippe Schenker , devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Hartmut Knaack , Alexandre Torgue , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Dmitry Torokhov , Lee Jones , Maxime Coquelin , Mark Rutland , Peter Meerwald-Stadler , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Lars-Peter Clausen Subject: [PATCH v2 3/4] iio: adc: add STMPE ADC devicetree bindings Date: Mon, 19 Nov 2018 11:25:27 +0100 Message-Id: <20181119102528.2830-3-dev@pschenker.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119102528.2830-1-dev@pschenker.ch> References: <20181119102528.2830-1-dev@pschenker.ch> 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 From: Stefan Agner This adds the devicetree bindings for the STMPE ADC. Signed-off-by: Stefan Agner Signed-off-by: Max Krummenacher Signed-off-by: Philippe Schenker --- Changes in v2: - Moved the bindings for ADC to the overlying mfd. - Reformatted for better readability .../devicetree/bindings/iio/adc/stmpe-adc.txt | 21 ++++++++++++++ .../bindings/input/touchscreen/stmpe.txt | 11 -------- .../devicetree/bindings/mfd/stmpe.txt | 28 ++++++++++++++----- 3 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt diff --git a/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt b/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt new file mode 100644 index 000000000000..480e66422625 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt @@ -0,0 +1,21 @@ +STMPE ADC driver +---------------- + +Required properties: + - compatible: "st,stmpe-adc" + +Optional properties: +Note that the ADC is shared with the STMPE touchscreen. ADC related settings +have to be done in the mfd. +- st,norequest-mask: bitmask specifying which ADC channels should _not_ be + requestable due to different usage (e.g. touch) + +Node name must be stmpe_adc and should be child node of stmpe node to +which it belongs. + +Example: + + stmpe_adc { + compatible = "st,stmpe-adc"; + st,norequest-mask = <0x0F>; /* dont use ADC CH3-0 */ + }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt index 127baa31a77a..71e1359749f2 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt @@ -5,13 +5,6 @@ Required properties: - compatible: "st,stmpe-ts" Optional properties: -- st,sample-time: ADC converstion time in number of clock. (0 -> 36 clocks, 1 -> - 44 clocks, 2 -> 56 clocks, 3 -> 64 clocks, 4 -> 80 clocks, 5 -> 96 clocks, 6 - -> 144 clocks), recommended is 4. -- st,mod-12b: ADC Bit mode (0 -> 10bit ADC, 1 -> 12bit ADC) -- st,ref-sel: ADC reference source (0 -> internal reference, 1 -> external - reference) -- st,adc-freq: ADC Clock speed (0 -> 1.625 MHz, 1 -> 3.25 MHz, 2 || 3 -> 6.5 MHz) - st,ave-ctrl: Sample average control (0 -> 1 sample, 1 -> 2 samples, 2 -> 4 samples, 3 -> 8 samples) - st,touch-det-delay: Touch detect interrupt delay (0 -> 10 us, 1 -> 50 us, 2 -> @@ -31,10 +24,6 @@ Example: stmpe_touchscreen { compatible = "st,stmpe-ts"; - st,sample-time = <4>; - st,mod-12b = <1>; - st,ref-sel = <0>; - st,adc-freq = <1>; st,ave-ctrl = <1>; st,touch-det-delay = <2>; st,settling = <2>; diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentation/devicetree/bindings/mfd/stmpe.txt index c797c05cd3c2..bd991514d6c1 100644 --- a/Documentation/devicetree/bindings/mfd/stmpe.txt +++ b/Documentation/devicetree/bindings/mfd/stmpe.txt @@ -4,15 +4,29 @@ STMPE is an MFD device which may expose the following inbuilt devices: gpio, keypad, touchscreen, adc, pwm, rotator. Required properties: - - compatible : "st,stmpe[610|801|811|1600|1601|2401|2403]" - - reg : I2C/SPI address of the device + - compatible : "st,stmpe[610|801|811|1600|1601|2401|2403]" + - reg : I2C/SPI address of the device Optional properties: - - interrupts : The interrupt outputs from the controller - - interrupt-controller : Marks the device node as an interrupt controller - - wakeup-source : Marks the input device as wakable - - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024 - - irq-gpio : If present, which GPIO to use for event IRQ + - interrupts : The interrupt outputs from the controller + - interrupt-controller : Marks the device node as an interrupt controller + - wakeup-source : Marks the input device as wakable + - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024 + - irq-gpio : If present, which GPIO to use for event IRQ + +Optional properties for devices with touch and ADC (STMPE811|STMPE610): + - st,sample-time : ADC conversion time in number of clock. + 0 -> 36 clocks 4 -> 80 clocks (recommended) + 1 -> 44 clocks 5 -> 96 clocks + 2 -> 56 clocks 6 -> 144 clocks + 3 -> 64 clocks + - st,mod-12b : ADC Bit mode + 0 -> 10bit ADC 1 -> 12bit ADC + - st,ref-sel : ADC reference source + 0 -> internal 1 -> external + - st,adc-freq : ADC Clock speed + 0 -> 1.625 MHz 2 || 3 -> 6.5 MHz + 1 -> 3.25 MHz Example: -- 2.19.1