From patchwork Sun Jun 2 20:14:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2649911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 32C81DFB78 for ; Sun, 2 Jun 2013 20:17:30 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjEiI-0004Wi-5m; Sun, 02 Jun 2013 20:17:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjEhz-0000FP-0B; Sun, 02 Jun 2013 20:16:55 +0000 Received: from [2a01:e35:139b:9f90:221:70ff:fe55:8f78] (helo=smtp.natisbad.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjEhv-0000Es-Qh for linux-arm-kernel@lists.infradead.org; Sun, 02 Jun 2013 20:16:52 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 789D42C081B; Sun, 2 Jun 2013 22:16:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370204189; bh=Q1u0cf2kYyH25HSbJEa9PFBbF1DwCLzjUX6RdT/r3Fc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=NpqQAihZCxEHNwJNrr1uZMPC8rTSRTQZzIuJRMKKXOu+diTZDkeHFnoQ+0IotJK6X yar5GLEB8RVJDmY1GUlxClZKQxwGpVYJEiNQ6bU4IfWaswqHosiTO9eKwB7OdPik8K SVs8Cc2uDS+NUIQLYcmtc6Cuut+nMqM8TIpbw2uk= X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on petit X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from small (localhost [127.0.0.1]) by smtp.natisbad.org (Postfix) with ESMTP id 4BC582C057D; Sun, 2 Jun 2013 22:13:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370203986; bh=Q1u0cf2kYyH25HSbJEa9PFBbF1DwCLzjUX6RdT/r3Fc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ddJTPWFmiinwcd+GxYDuBBEBJB1psLXQlmnwVCtfwwXzkNN56zDvtEZyWywrK249F dEoGbRfTMtLz3PY96saIuOEAFis6XN4V1SqJvUXkB3WXx6tJ/M6JirL/hpoF4XaFYM +L91kxsd9cMmy6Zoctl6bSgqNFzpUHHo6v26qcuI= X-Hashcash: 1:20:130602:linux@roeck-us.net::ekdP4jmpxgzQwxai:000000000000000000000000000000000000000000014bw X-Hashcash: 1:20:130602:khali@linux-fr.org::gTSl5Wach3HAqTCg:00000000000000000000000000000000000000000004lov X-Hashcash: 1:20:130602:grant.likely@secretlab.ca::FWWN8MkHXON+gCwQ:0000000000000000000000000000000000001jha X-Hashcash: 1:20:130602:rob.herring@calxeda.com::jivz2BDfWdONPkX4:000000000000000000000000000000000000001xKD X-Hashcash: 1:20:130602:lm-sensors@lm-sensors.org::S4fTaKZ7VTGSdeDZ:0000000000000000000000000000000000007PBz X-Hashcash: 1:20:130602:devicetree-discuss@lists.ozlabs.org::zF/TqAbvd+Ilhn2y:000000000000000000000000007c1a X-Hashcash: 1:20:130602:rob@landley.net::1Jo85tY7hsNhDdP0:005cm8 X-Hashcash: 1:20:130602:linux-doc@vger.kernel.org::ddfdmKBKtVgkaSrm:0000000000000000000000000000000000002i6N X-Hashcash: 1:20:130602:linux-arm-kernel@lists.infradead.org::foPcdOF54YKx8w0b:00000000000000000000000007hrR X-Hashcash: 1:20:130602:linux@arm.linux.org.uk::eKSpjOk3GquqpwJ2:0000000000000000000000000000000000000001VSH X-Hashcash: 1:20:130602:andrew@lunn.ch::4v1g6V8Eq+3Ve5AL:000BPtw X-Hashcash: 1:20:130602:jason@lakedaemon.net::PXFESL/ctLZMth7O:000000000000000000000000000000000000000005T3u X-Hashcash: 1:20:130602:simon.guinot@sequanux.org::cWrmQ0caWnPmYF5z:0000000000000000000000000000000000001JSe X-Hashcash: 1:20:130602:olivier.mouchet@gmail.com::xRv+vEOhU+uG+3/F:0000000000000000000000000000000000004C75 From: Arnaud Ebalard To: Guenter Roeck Subject: [PATCHv3 2/3] Add documentation for g762 driver In-Reply-To: References: Message-Id: <2d61f652bc10de31aa26577ae3a9a58b393b540a.1370202835.git.arno@natisbad.org> X-PGP-Key-URL: http://natisbad.org/arno@natisbad.org.asc X-Fingerprint: D3A5 B68A 839B 38A5 815A 781B B77C 0748 A7AE 341B Date: Sun, 02 Jun 2013 22:14:31 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130602_161652_359584_2E5C2EC5 X-CRM114-Status: GOOD ( 17.07 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: Andrew Lunn , Russell King - ARM Linux , Jason Cooper , linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Olivier Mouchet , Rob Herring , lm-sensors@lm-sensors.org, Grant Likely , Rob Landley , Jean Delvare , Linux ARM Kernel Mailing List , Simon Guinot X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Arnaud Ebalard --- Documentation/hwmon/g762 | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/hwmon/g762 diff --git a/Documentation/hwmon/g762 b/Documentation/hwmon/g762 new file mode 100644 index 0000000..b749fe1 --- /dev/null +++ b/Documentation/hwmon/g762 @@ -0,0 +1,64 @@ +Kernel driver g762 +================== + +The GMT G762 Fan Speed PWM Controller is connected directly to a fan +and performs closed-loop or open-loop control of the fan speed. Two +modes - PWM or DC - are supported by the device. + +For additional information, a detailed datasheet is available at +http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf. sysfs +bindings are described in Documentation/hwmon/sysfs-interface. + +The following entries are available to the user in a subdirectory of +/sys/bus/i2c/drivers/g762/ to control the operation of the device. +This can be done manually using the following entries but is usually +done via a userland daemon like fancontrol. + +Note that those entries do not provide ways to setup the specific +hardware characteristics of the system (reference clock, pulses per +fan revolution, ...); Those can be modified via devicetree bindings +documented in Documentation/devicetree/bindings/hwmon/g762.txt. + + + fan1_target: set desired fan speed. This only makes sense in closed-loop + fan speed control (i.e. when pwm1_enable is set to 2). + + fan1_input: provide current fan rotation value in RPM as reported by + the fan to the device. + + fan1_div: fan clock divisor. Supported value are 1, 2, 4 and 8. + + fan1_fault: reports fan failure, i.e. no transition on fan gear pin for + about 0.7s (if the fan is not voluntarily set off). + + fan1_alarm: in closed-loop control mode, if fan RPM value is 25% out + of the programmed value for over 6 seconds 'fan1_alarm' is + set to 1. + + pwm1_enable: set current fan speed control mode i.e. 1 for manual fan + speed control (open-loop) via pwm1 described below, 2 for + automatic fan speed control (closed-loop) via fan1_target + above (pwm1 is also usable). + + pwm1_mode: set or get fan driving mode: 1 for PWM mode, 0 for DC mode. + + pwm1: get or set PWM fan control value. This is an integer value + between 0 and 255. 0 stops the fan, 255 makes it run at + full speed. Note that the fan speed control mode (open vs + closed-loop) must be set prior via pwm1_enable prior to + passing a value via pwm1. + + +Both in PWM mode ('pwm1_mode' set to 1) and DC mode ('pwm1_mode' set to 0), +when current fan speed control mode is open-loop ('pwm1_enable' set to 1), +the fan speed is programmed by setting a value between 0 and 255 via 'pwm1' +entry (0 stops the fan, 255 makes it run at full speed). In closed-loop mode +('pwm1_enable' set to 2), the expected rotation speed in RPM can be passed to +the chip via 'fan1_target'. In closed-loop mode, the target speed is compared +with current speed (available via 'fan1_input') by the device and a feedback +is performed to match that target value. The fan speed value is computed +based on the parameters associated with the physical characteristics of the +system: a reference clock source frequency, a number of pulses per fan +revolution, etc. + +Note that the driver will update its values at most once per second.