From patchwork Thu Apr 18 22:28:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2462831 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 42B683FD8C for ; Thu, 18 Apr 2013 22:32:52 +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 1USxNR-0005Gw-Ho; Thu, 18 Apr 2013 22:32:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1USxN4-00016c-1X; Thu, 18 Apr 2013 22:32:02 +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 1USxN0-00016I-FM for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2013 22:31:59 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 1F2BA2C0749; Fri, 19 Apr 2013 00:31:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1366324317; bh=M+gaT+BpL3TuVZ8CEtDldybmWnubnZDOb9KWG2MzASA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=255LNbGXpM0Ty071ChP4RfTvieBZ0ICuC0QFCX6SiRwP6+bprNnTUV7gBEFInpR8Y B/frndlIb40OYSL3H3I9nVVZR0QAs3I+5kQwE2N0LxmKNMHcAS8GHUOGCr88rCs/ol M3g7WD/Un5/9TNvgC1I9OUwtlPzDjsKbdh1s+yV0= 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 215652C069F; Fri, 19 Apr 2013 00:28:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1366324137; bh=M+gaT+BpL3TuVZ8CEtDldybmWnubnZDOb9KWG2MzASA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=yOgcGj0YSY9T9PH8CirRjbBGFzrV5kxiNUEp0OL0wlWr0b1ydf1T37ZXhGwhIi0KK eT0CCt9pCfbWZ6aZ2PwD4tjsVcbF3CMtyiBTUU+7EhL/2Kzcc35pWuyM6dcLK0575I /V9LELWlfYy+N5r5vtuXRNZdnREierVEhggzPC8U= X-Hashcash: 1:20:130418:khali@linux-fr.org::Ool3ACfjGbzYKtUI:0000000000000000000000000000000000000000000Bc6C X-Hashcash: 1:20:130418:linux@roeck-us.net::/DKBZoqCDXroeYH7:00000000000000000000000000000000000000000002Dnz X-Hashcash: 1:20:130418:grant.likely@secretlab.ca::9apPtfo9Te4lr5Om:0000000000000000000000000000000000001ANP X-Hashcash: 1:20:130418:rob.herring@calxeda.com::Cig2RDlEkmW/3Ovi:000000000000000000000000000000000000003iaY X-Hashcash: 1:20:130418:lm-sensors@lm-sensors.org::ao5T7NjVebCgiAdM:0000000000000000000000000000000000001DOT X-Hashcash: 1:20:130418:devicetree-discuss@lists.ozlabs.org::vMqYd+a4HxW0qGi+:000000000000000000000000000P45 X-Hashcash: 1:20:130418:rob@landley.net::I5q8OnSym+fMxYJO:002h+C X-Hashcash: 1:20:130418:linux-doc@vger.kernel.org::AQ+MYm+21d2wZVav:0000000000000000000000000000000000005csX X-Hashcash: 1:20:130418:linux-arm-kernel@lists.infradead.org::YJMEZJnlhGZEtfR4:00000000000000000000000000Zxx X-Hashcash: 1:20:130418:linux@arm.linux.org.uk::lm/JEptzjjqcgzcX:0000000000000000000000000000000000000003Ch5 X-Hashcash: 1:20:130418:andrew@lunn.ch::/CWZd/ubFhk9L+Z0:0000XNs X-Hashcash: 1:20:130418:jason@lakedaemon.net::oJAfWjLyo9IEZG4A:000000000000000000000000000000000000000003QKA X-Hashcash: 1:20:130418:simon.guinot@sequanux.org::9WG2O9Wfss1K6BT1:0000000000000000000000000000000000001/VB X-Hashcash: 1:20:130418:olivier.mouchet@gmail.com::uVBsrmG22Gh8hXAP:0000000000000000000000000000000000000j5f From: arno@natisbad.org (Arnaud Ebalard) To: Jean Delvare , Guenter Roeck , Grant Likely , Rob Herring , lm-sensors@lm-sensors.org, devicetree-discuss@lists.ozlabs.org, Rob Landley , linux-doc@vger.kernel.org Subject: [PATCH 3/3] Add documentation for g762 driver In-Reply-To: References: Message-Id: X-PGP-Key-URL: http://natisbad.org/arno@natisbad.org.asc X-Fingerprint: D3A5 B68A 839B 38A5 815A 781B B77C 0748 A7AE 341B Date: Fri, 19 Apr 2013 00:28:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130418_183158_880027_82C95FBC X-CRM114-Status: GOOD ( 17.87 ) 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 , Olivier Mouchet , 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 | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/hwmon/g762 diff --git a/Documentation/hwmon/g762 b/Documentation/hwmon/g762 new file mode 100644 index 0000000..f281b3d --- /dev/null +++ b/Documentation/hwmon/g762 @@ -0,0 +1,89 @@ +Kernel driver g762 +================== + +This documentation is based on G760a one, GMT G762 datasheet available +at http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf (used +for the development of the driver) and sysfs bindings described in +Documentation/hwmon/sysfs-interface. + +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 linear - are supported by the device. + +The following entries are available to the user in a subdirectory of +/sys/bus/i2c/drivers/g762/ to control the operation of the device. +Some of those can be used to fit operations of the controller to the +characteristics of the system (reference clock value, fan gear mode, +number of pulses per fan revolution, ...). Other more common +parameters can be used to interact with the fan and control its speed +(set a rotation speed and get current speed for instance). This can be +done manually using the following entries but is usually done via a +userland daemon like fancontrol. + + + 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_pulses: number of tachometer pulses per fan revolution. Supported + values are 2 and 4. Default value is 2. + + fan1_div: fan clock divisor. Supported value are 1, 2, 4 and 8. Default + value is 1. + + fan1_gear_mode: fan gear mode. Supported values are 0, 1 and 2. Default + value is 0. The value is a characteristic of the system + and a higher value can be set for more precisely control + fans with a high rotation speed. Note that this affects the + measurable speed range, not the read value. + + 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_fault_detection: enable fan failure detection and reporting as + described above. + + 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. + + fan1_alarm_detection: enable fan out of control detection and reporting + as described above. + + fan1_startup_voltage: get or set fan startup voltage. Supported values + are 0, 1, 2, 3 (respectively for 1.0V, 1.5V, 2.0V and 2.5V). + + + + 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. + + pwm1_polarity: set or get the PWM polarity, 0 for positive duty, 1 for + negative duty + + pwm1_enable: set current fan speed control mode i.e. 1 for manual fan + speed control (open-loop), 2 for automatic fan speed control + (closed-loop). + + pwm1_mode: set or get fan driving mode: 1 for PWM mode, 0 for linear + mode. Default is linear mode. + + pwm1_freq: set or get value of PWM reference clock frequency. Default + value is 32768 (Hz). This parameter only makes sense when + the device is set to operate in PWM mode (i.e. pwm1_mode + is 1). + + +In PWM mode ('pwm1_mode' set to 1), the fan speed is programmed either by +setting a value between 0 and 255 via 'pwm1' entry (0 stops the fan, 255 +makes it run at full speed). This can also be done by passing the +expected RPM value via 'fan1_target'. Current fan speed value can be +retrieved via 'fan1_input'. This 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.