From patchwork Tue Apr 23 22:06:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2481011 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 733E13FCA5 for ; Tue, 23 Apr 2013 22:09:35 +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 1UUlOr-0007ZK-Ak; Tue, 23 Apr 2013 22:09:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUlOe-0004PN-NN; Tue, 23 Apr 2013 22:09:08 +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 1UUlOb-0004P0-2s for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 22:09:06 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 652362C069F; Wed, 24 Apr 2013 00:09:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1366754942; bh=l5ZYD7cfdv5fIvK7/zsAPKDQnnyZrZ2hhNrcmhR6+TI=; h=From:To:Cc:Subject:In-Reply-To:References:References:Date; b=26YVnjHU0aMWtyiLwYgdSiSfWR1XJvuwNu3i7Y3iN7NDCObFJfeZTTQaKgXEG+seB aumrRGvBL+v502KplI1u2DlUPpPgojciTZhmpNqyKH2dFR6eApX8m2LFlTmWDsG8mY lDfTt7ut7YIrMrgW0+mBTkJoRSu7cJO+lZ4JPjqY= 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 ABE852C044D; Wed, 24 Apr 2013 00:06:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1366754768; bh=l5ZYD7cfdv5fIvK7/zsAPKDQnnyZrZ2hhNrcmhR6+TI=; h=From:To:Cc:Subject:In-Reply-To:References:References:Date; b=m8iRBcGSW9MMqK84/JkZYIKaHie2AWjR9ma3A2pKAq7kfQGT0FrJv3NrVPmLlimwS ZwNWjOAPRjz00dkGQAZGGLg78bfcj4GzY4GQjcEvi+U2KHA/Uj2oWJab3+y1rjF53m QTkh0/ljdXI6vQkG6UPOsDtVEaFQodcH2Gz8oUNQ= From: arno@natisbad.org (Arnaud Ebalard) To: Guenter Roeck Subject: [PATCHv1 2/3] hwmon: Add documentation for g762 driver In-Reply-To: References: <4f4a821bbc61e2da28fd70553fd717ada255097d.1366322287.git.arno@natisbad.org> <20130419043555.GA14124@roeck-us.net> References: Message-Id: <24acd174f829d211f5d4c1b8631ffc3f8dd97910.1366753420.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 X-Hashcash: 1:20:130423:simon.guinot@sequanux.org::/oMeyoHg07EFI1sk:0000000000000000000000000000000000000BcE X-Hashcash: 1:20:130423:linux-arm-kernel@lists.infradead.org::aBC08Xrlc3K5qteA:00000000000000000000000001Sjy X-Hashcash: 1:20:130423:rob@landley.net::YMDx8+J4oQDny71p:001sAZ X-Hashcash: 1:20:130423:lm-sensors@lm-sensors.org::Gzii6+e0kSzhztub:0000000000000000000000000000000000001dTk X-Hashcash: 1:20:130423:rob.herring@calxeda.com::V9WyzFlDOjYAE+91:000000000000000000000000000000000000001MNB X-Hashcash: 1:20:130423:grant.likely@secretlab.ca::cpeGs+mRzP0pURQW:0000000000000000000000000000000000000QWY X-Hashcash: 1:20:130423:linux@roeck-us.net::OAkbbTHk9/fFmidE:00000000000000000000000000000000000000000001VQB X-Hashcash: 1:20:130423:andrew@lunn.ch::51i6mgf0TkcYOO7r:0002UWy X-Hashcash: 1:20:130423:linux-doc@vger.kernel.org::Sb/5hnayENTeDeWJ:0000000000000000000000000000000000002gnS X-Hashcash: 1:20:130423:jason@lakedaemon.net::l8uLwHIcbkgrkvrG:000000000000000000000000000000000000000005++2 X-Hashcash: 1:20:130423:devicetree-discuss@lists.ozlabs.org::ltR9MPRHCoNzc5DK:0000000000000000000000000069cN X-Hashcash: 1:20:130423:olivier.mouchet@gmail.com::AsYg08XOOhi1NPxj:0000000000000000000000000000000000006oWv X-Hashcash: 1:20:130423:khali@linux-fr.org::8SMmP4rJZqag2Ru1:00000000000000000000000000000000000000000008Oly X-Hashcash: 1:20:130423:linux@arm.linux.org.uk::jgOeK/3l2qc5oAgD:000000000000000000000000000000000000000Ak4y Date: Wed, 24 Apr 2013 00:06:08 +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-20130423_180905_446188_3FE91F29 X-CRM114-Status: GOOD ( 15.77 ) 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 | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/hwmon/g762 diff --git a/Documentation/hwmon/g762 b/Documentation/hwmon/g762 new file mode 100644 index 0000000..5015829 --- /dev/null +++ b/Documentation/hwmon/g762 @@ -0,0 +1,67 @@ +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. +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. 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_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: 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_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. + + +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.