From patchwork Tue Jun 4 07:14:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2657571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id C20F740077 for ; Tue, 4 Jun 2013 07:18:03 +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 1UjlUa-0005PT-8v; Tue, 04 Jun 2013 07:17:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjlUC-0004AW-O1; Tue, 04 Jun 2013 07:16:52 +0000 Received: from mic92-1-81-57-185-249.fbx.proxad.net ([81.57.185.249] helo=smtp.natisbad.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjlU9-000491-QQ for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2013 07:16:50 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 6C5B62C07C3; Tue, 4 Jun 2013 09:16:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370330188; bh=24G+2egIZkJLyTCvl+MuEdDJjvzVkkq74KsKPtLQWnM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=UixCPhhlJPQAzG8pvxYuI5QYi+xwrCYV5gr3lTUvPN6YU1a+D4X6QQugkPmCn6YZN LugnPuhRP6RYPw7R30KbePy1nWBbyhhbi2svLKnmBLZfblOWTjQ8jdoujzEdxzQXCS bxiOfQtBKgo+4oQMhTL3xVkKeT839tFVCnIgrBSQ= 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 55D5D2C0556; Tue, 4 Jun 2013 09:13:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1370330002; bh=24G+2egIZkJLyTCvl+MuEdDJjvzVkkq74KsKPtLQWnM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=b/85FupBMLoNh7BlR/Tm/1BXPy2jotpuKNpCKsGXUk/KpditIbJ0lm3c8pSa8HQ+W QeAeldXM+3XuDdbES9XIz6BMmwAM71NCY/gRSSy2Xx4ziEsh6KWQsq6j+hqB3tteJD 8Umh2jnhL7VrkKmLHXmzqQ5hpKRSOQEPDXqV153o= X-Hashcash: 1:20:130604:linux@roeck-us.net::hO8A+987nci/WYrx:00000000000000000000000000000000000000000000YUm X-Hashcash: 1:20:130604:khali@linux-fr.org::dJm7tw4nPFbVKjEl:000000000000000000000000000000000000000000014qF X-Hashcash: 1:20:130604:grant.likely@secretlab.ca::AGM3qLvSk3tFaIrG:000000000000000000000000000000000000KZNx X-Hashcash: 1:20:130604:rob.herring@calxeda.com::TAe7EIrzd+b/l2fR:000000000000000000000000000000000000000YxV X-Hashcash: 1:20:130604:lm-sensors@lm-sensors.org::t/QvQtPs5qn9nFBT:0000000000000000000000000000000000006LXe X-Hashcash: 1:20:130604:devicetree-discuss@lists.ozlabs.org::DiP4+C/SS6rYh0fT:000000000000000000000000002YCW X-Hashcash: 1:20:130604:rob@landley.net::YZHfm2g+TBRpQM73:002Vii X-Hashcash: 1:20:130604:linux-doc@vger.kernel.org::y/A8Vq4NXPPFozOL:000000000000000000000000000000000000B012 X-Hashcash: 1:20:130604:linux-arm-kernel@lists.infradead.org::pFEJl38P5+ARIJtv:00000000000000000000000005+/u X-Hashcash: 1:20:130604:linux@arm.linux.org.uk::10C13G/sm7XW/dLu:0000000000000000000000000000000000000001tOh X-Hashcash: 1:20:130604:andrew@lunn.ch::/uBafTGmbo2qSWVb:0004z9+ X-Hashcash: 1:20:130604:jason@lakedaemon.net::h8neO/Iji6z9J2pf:000000000000000000000000000000000000000006cws X-Hashcash: 1:20:130604:simon.guinot@sequanux.org::JT0KAQ9/295wVB7u:0000000000000000000000000000000000001Ir7 X-Hashcash: 1:20:130604:olivier.mouchet@gmail.com::we/EDzlBF4+G3sW4:0000000000000000000000000000000000000+b3 From: Arnaud Ebalard To: Guenter Roeck Subject: [PATCHv4 2/3] Add documentation for g762 driver In-Reply-To: References: Message-Id: <424fad46a59b886551c905024f8707ad83b80762.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 09:14:47 +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_031650_156874_C15BAFF0 X-CRM114-Status: GOOD ( 16.29 ) X-Spam-Score: -1.0 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.0 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 1.0 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking 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.