From patchwork Mon May 27 22:03:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 2621551 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 1B210DF215 for ; Mon, 27 May 2013 22:05:09 +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 1Uh5XP-0006eu-Ai; Mon, 27 May 2013 22:05:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uh5XM-00005c-QA; Mon, 27 May 2013 22:05:04 +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 1Uh5XK-000054-2E for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2013 22:05:02 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id B56D42C0786; Tue, 28 May 2013 00:04:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1369692280; bh=Q1u0cf2kYyH25HSbJEa9PFBbF1DwCLzjUX6RdT/r3Fc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=tU3S0oDpoQCEH3a5Mf4sH4Y24dLRFwn+Z1Erkk4Z3yvQm+mqBAd0V8PTHfSPESHBM a/m6iaYDSksUnjK+1vlw/nNrCPitNn+fyFSaiPn2ZmmP58Vzvn3lOQNxBy3Tbq3jpD bmsgN0pCSq8lLA3Hq5JWmQJRB8+p6qo0rGrWcXA0= 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 7B7392C0308; Tue, 28 May 2013 00:02:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1369692124; bh=Q1u0cf2kYyH25HSbJEa9PFBbF1DwCLzjUX6RdT/r3Fc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=XlJIzkaQatVFN/9d+lNq/vuuypWHBP9FXci6GgZjxYxtzK9Rr6dhzao7GxoJ0Ln+g zYQbewKo0sEgRJeuaNU+4/DVHlB5bHMy0qLBCPzuPpmLpD82ItM9ASsQQrV+KfbZaj L/AwUEGRTkQYk6RU45QaPqyuMwQLOvVvchEPW4vE= X-Hashcash: 1:20:130527:linux@roeck-us.net::dwD77YI8UOUVTgAN:000000000000000000000000000000000000000000048E7 X-Hashcash: 1:20:130527:khali@linux-fr.org::voE+bHdnJPI5SrCv:00000000000000000000000000000000000000000001bmx X-Hashcash: 1:20:130527:grant.likely@secretlab.ca::Nn5S+Z1NOExF3cF8:0000000000000000000000000000000000003iSK X-Hashcash: 1:20:130527:rob.herring@calxeda.com::E3Xm7FiXrkDuSGHO:000000000000000000000000000000000000000ffP X-Hashcash: 1:20:130527:lm-sensors@lm-sensors.org::ROvjK4YEgYyMt/Rw:00000000000000000000000000000000000087nQ X-Hashcash: 1:20:130527:devicetree-discuss@lists.ozlabs.org::2qYS3yDG1xf/ubPI:000000000000000000000000001xuE X-Hashcash: 1:20:130527:rob@landley.net::bDBH1Ssf4sr0nJY2:000FAl X-Hashcash: 1:20:130527:linux-doc@vger.kernel.org::L3cgEQKpAQ6UGBvT:000000000000000000000000000000000000190y X-Hashcash: 1:20:130527:linux-arm-kernel@lists.infradead.org::bUSdQBgXagfKm5MM:00000000000000000000000002yVB X-Hashcash: 1:20:130527:linux@arm.linux.org.uk::UuCd69MVa2vvs6kX:0000000000000000000000000000000000000000HxX X-Hashcash: 1:20:130527:andrew@lunn.ch::x3l2pkvx3UALauOx:0000+94 X-Hashcash: 1:20:130527:jason@lakedaemon.net::CASoUnYHhdr1mwOy:000000000000000000000000000000000000000000eYb X-Hashcash: 1:20:130527:simon.guinot@sequanux.org::dirw5m6bqOqa7RWc:000000000000000000000000000000000000CXvv X-Hashcash: 1:20:130527:olivier.mouchet@gmail.com::0XEeeizL8x0T4JO7:00000000000000000000000000000000000044xn From: arno@natisbad.org (Arnaud Ebalard) To: Guenter Roeck Subject: [PATCHv2 2/3] Add documentation for g762 driver In-Reply-To: References: Message-Id: <9e9904e9e0aed280afe547445bb471ba0229aa9e.1369687670.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, 28 May 2013 00:03:28 +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-20130527_180502_403913_FF6E993E X-CRM114-Status: GOOD ( 16.83 ) 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 | 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.