From patchwork Tue Jun 4 06:55:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2657501 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 EDDA6DF2A1 for ; Tue, 4 Jun 2013 07:12:47 +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 1UjlD8-0008PB-M4; Tue, 04 Jun 2013 06:59:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjlC6-0003Sr-Ct; Tue, 04 Jun 2013 06:58:10 +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 1UjlC3-0003S0-H7 for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2013 06:58:08 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 39BF32C081B; Tue, 4 Jun 2013 08:57:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370329066; bh=24G+2egIZkJLyTCvl+MuEdDJjvzVkkq74KsKPtLQWnM=; h=From:From:To:Cc:Subject:In-Reply-To:References:Date; b=idKprogKdKRLVi07y01oL0dYp7mRWwpAnwXbLlbvgyPCnaL/XUbPgW5DoQPoq4zjz Fb6fd3No3OT0wk0pKyyDFIfo30Fg9UxcW6lrK1BjoV9FlPsn4VUscqraC8zLSm9cKR mV4KEr47tPHuLZaOC66c48+xe8ZJZ8KBszqLVIHw= 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 CAD9C2C035B; Tue, 4 Jun 2013 08:54:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370328865; bh=24G+2egIZkJLyTCvl+MuEdDJjvzVkkq74KsKPtLQWnM=; h=From:From:To:Cc:Subject:In-Reply-To:References:Date; b=bU2bucMztJ52GLNfS+VjpAI7bryTO8s2aycjp+vFXTTNoWiE2LUv1dsQF85U9JvOn 1P4hDZXfrevy4xRn5pvd4xevgVT17H2eltTN/dcciPTX6ccr4S7XsVdWo3A0PKJ3p9 8BrJXefaLf/vP0+JS2ANo0BW9A5GsBRJkE9PR1O4= X-Hashcash: 1:20:130604:linux@roeck-us.net::HkKag0JDlHl7UayH:00000000000000000000000000000000000000000002D13 X-Hashcash: 1:20:130604:khali@linux-fr.org::KOXK2mJiZRgbODDn:00000000000000000000000000000000000000000001C7L X-Hashcash: 1:20:130604:grant.likely@secretlab.ca::JZr6WNIzySCnOHyR:0000000000000000000000000000000000007rn3 X-Hashcash: 1:20:130604:rob.herring@calxeda.com::Z97j2N7FhMpmNKDz:0000000000000000000000000000000000000004oK X-Hashcash: 1:20:130604:lm-sensors@lm-sensors.org::Pptsp1L5jkbjXR5r:0000000000000000000000000000000000001ETs X-Hashcash: 1:20:130604:devicetree-discuss@lists.ozlabs.org::FqQRh7yHlVs1yW7m:000000000000000000000000004NjA X-Hashcash: 1:20:130604:rob@landley.net::HCcYduVO7pq/4Sx6:005Bz6 X-Hashcash: 1:20:130604:linux-doc@vger.kernel.org::Gvhk9sykHhiOlhYh:0000000000000000000000000000000000000oIQ X-Hashcash: 1:20:130604:linux-arm-kernel@lists.infradead.org::fVaidFJlOc8UhxSS:00000000000000000000000009o+a X-Hashcash: 1:20:130604:linux@arm.linux.org.uk::VTir5QsmFgHoGORq:0000000000000000000000000000000000000000xqR X-Hashcash: 1:20:130604:andrew@lunn.ch::2KWe+PwsSXFO6uUg:000718A X-Hashcash: 1:20:130604:jason@lakedaemon.net::xSE324I/qLUryXaX:000000000000000000000000000000000000000001MaA X-Hashcash: 1:20:130604:simon.guinot@sequanux.org::w/JIMbw3PcFGhkz5:0000000000000000000000000000000000004fDA X-Hashcash: 1:20:130604:olivier.mouchet@gmail.com::pumY3ui7VN7/8uJD:0000000000000000000000000000000000003ajo From: Arnaud Ebalard From: arno@natisbad.org (Arnaud Ebalard) To: Guenter Roeck Subject: [PATCHv4 2/3] Add documentation for g762 driver In-Reply-To: References: Message-Id: <424fed46a59b886551c905024f8707ad83b80762.1370327864.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: Tue, 04 Jun 2013 08:55:50 +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-20130604_025807_966866_C9F63C1B X-CRM114-Status: GOOD ( 16.29 ) 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 | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/hwmon/g762 diff --git a/Documentation/hwmon/g762 b/Documentation/hwmon/g762 new file mode 100644 index 0000000..8cdb0dc --- /dev/null +++ b/Documentation/hwmon/g762 @@ -0,0 +1,62 @@ +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 or +using a specific platform_data structure in board initialization +file (see include/linux/platform_data/g762.h). + + 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 in open-loop mode. This is an + integer value between 0 and 255. 0 stops the fan, 255 makes + it run at full speed. + +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.