Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp493728ybg; Wed, 10 Jun 2020 06:16:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQbvIOP2UyLIaxKVrfFsgnV5b+IfDDGkA81XmCXIPVUTsA6VRYmQ4+nTBWhvlm772rLTsa X-Received: by 2002:a50:bf03:: with SMTP id f3mr2515664edk.368.1591794984928; Wed, 10 Jun 2020 06:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591794984; cv=none; d=google.com; s=arc-20160816; b=NzA/q+RcY79ic1pOy6dXkLN/+3yjWV7gvJZq+pi0qeamjItjASfYIFaoSuMcowupJo z4bwzZhe52OKgF9CAjnEb8QxrtER4oP3JTDF1II357+7/e3O1CBFi6nQQjdfPHCSUMl6 0xZEX/k/iWcm0G01fOHouet7z9zJZYz/r/g9LtsNOWDs9dmrClyBNqWr1oU+pPFPkUPI 31jEzReGLRsx2HxQY02B4n/D5zdX2V96rpZD53MLJEuGQR+se67fyndmAq7ZpmP8wOll sTSjjAGAFYrsisRYVOHBO2Ma8b53cW4WrXi5YEAF75gp7/i2npUFdX0biY9e5jsJC7H1 Kftg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=RxjiQHsXFSQLMiCRKLHNqPd8XA5uDKM3V9DGImaLPuk=; b=o3AMlHy37B0lrMec7muYVeybeoGRSBayG9mZwRRUn9rGX4h1SAsjmHAOb/85N971P2 jcpoN/czFTfd8vLOUj7xiqmAmF03DPS8vT6mzJHLCbAoo2Li/G9DWzHtSLHUdA04C+Zh mw/lGDGgh//iC8/cl7Y6jTFsJN40HujMjbMoxGEbAiUPVbq9cpF9MgJsSiILyzogumso +mIDwCzFJIkal3oCe4TrFCkx998j0rcTmd7Zk+bVHel4enhpTzQahD+7jII+U1aTpPPv H8f4OXXxrbmUvV5dCexeVuOaEA+m5+Wk1o/+yYOjxwRzwJubbjauo6Sqy+aT0hI8BjJ7 G63Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pvHKyllE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si13075245edn.403.2020.06.10.06.16.01; Wed, 10 Jun 2020 06:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pvHKyllE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729247AbgFJNN0 (ORCPT + 99 others); Wed, 10 Jun 2020 09:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729120AbgFJNNZ (ORCPT ); Wed, 10 Jun 2020 09:13:25 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB53C03E96B; Wed, 10 Jun 2020 06:13:24 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id w20so976606pga.6; Wed, 10 Jun 2020 06:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RxjiQHsXFSQLMiCRKLHNqPd8XA5uDKM3V9DGImaLPuk=; b=pvHKyllEhoNXkoOuEb3jE87bmiPizOpRsNGPaAgRTaItk32Th40oA1+aJsu4W90vLZ +FlEliTd9CxEOHsfoCWx2iHrZRzNvrzomxnRmtROx+w+vaBWSgfLRWZzGiJjL1NRKEGb UMiZZae7pNXIJEumGgOrOrd8BTd3n9pZAQoelhHejrNivnH/B9xcpRbJMf/psmJOsAxg bsmZrCJXG3rnpkHgl0MDnb5JUs8GCs+8nwvL+zMiDSXXLJV7H15ymUgpxTpg1IdGBC1A foKedd3hOcDpB6FpjoVcx3JVHWFZ5JrOnQjboPs17ZOWByQZRLsGWXTanVJmMGxEzYW2 Pv4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RxjiQHsXFSQLMiCRKLHNqPd8XA5uDKM3V9DGImaLPuk=; b=L6bcagcZq/1+2cZOMqz/XYxfXNQSpv57I7C1pdmyL/ReID0/bA3UHa7E+um5HE0wrQ tdyZkZgYZpc3sPjnJfgt3rSPxhNReSgm0ADLqjEbGqa1ff6SRiVP4mRc7cd3474FXlRA XhMnMYS8GTKGxIEFupgOIAfDjhMhO1+9jsBNYWeheRlVHFhhuSZIa6B/09PFKiqTWeyS uzZiepXBm8OLsjYcWrNO49Tci0ofM6pSwP1yagkrzgU+32fPoWv1RxJ6ZFd3Fs0D/RxT vHXeOB8c7IDn2v4Ud4wi/phfVBbLw+53gtKutxb2Ttn097iWGZMyd8NySxgqbLV65YSi GGmQ== X-Gm-Message-State: AOAM531VwjatKyZjHmLNtJHMekRLgbdvtniMolPI6zU59yAk7ydjmhWE 6RxrMfudyxQvgtMchuzddxDF1I3G X-Received: by 2002:a63:1a11:: with SMTP id a17mr2636973pga.227.1591794803795; Wed, 10 Jun 2020 06:13:23 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id y26sm13015071pff.26.2020.06.10.06.13.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2020 06:13:22 -0700 (PDT) Subject: Re: [RFC] drivers/hwmon: Corsair Commander Pro driver To: Marius Zachmann Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20200610040145.GA83576@roeck-us.net> <5812362.fiZtzxMu5m@marius> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyI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bhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Wed, 10 Jun 2020 06:13:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <5812362.fiZtzxMu5m@marius> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/10/20 5:03 AM, Marius Zachmann wrote: [ ... ] >>> +Kernel driver corsair-cpro >>> +========================== >>> + >>> +Supported devices: >>> + >>> + * Corsair Commander Pro >>> + * Corsair Commander Pro (1000D) >>> + >>> +Author: Marius Zachmann >>> + >>> +Description >>> +----------- >>> + >>> +This driver implements the sysfs interface for the Corsair Commander Pro. >>> +The Corsair Commander Pro is a USB device with 6 fan connectors, >>> +4 temperature sensor connectors and 2 Corsair LED connectors. >>> +It can read the voltage levels on the SATA power connector. >>> + >>> +Usage Notes >>> +----------- >>> + >>> +Since it is a USB device, hotswapping is possible. The device is autodetected. >>> + >>> +Sysfs entries >>> +------------- >>> + >>> +in0_input Voltage on SATA 12v >>> +in1_input Voltage on SATA 5v >>> +in2_input Voltage on SATA 3.3v >>> + >>> +temp[0-3]_input Connected temperature sensors >>> + >> Index starts with 1 for everything except inX. >> >>> +fan[0-5]_input Connected fan rpm. >>> +fan[0-5]_label Shows connection status of the fan as detected by the >>> + device. >>> + "fanX nc" no connection >>> + "fanX 3pin" 3-pin fan detected >>> + "fanX 4pin" 4-pin fan detected >>> +fan[0-5]_enable the driver only reports fan speeds when 1 >>> +pwm[0-5] Sets the fan speed. Values from 0-255. >>> + When reading, it reports the last value, which >>> + was set by the driver. Change to: When reading, it reports the last value if it was set by the driver. Otherwise returns 0. [ ... ] >>> + case hwmon_pwm: >>> + switch (attr) { >>> + case hwmon_pwm_input: >>> + *val = ccp->pwm[channel]; >> >> This returns 0 if pwm wasn't set. Is this indeed not readable from the >> device ? > > I could not find any possibility, because the official Corsair software does not use it. > I am not sure, whether it would be better to return an error, if it was not set. > Bummer. Then change the documentation as suggested above, and add a comment here explaining that it is unknown how to read pwm values from the device. Thanks, Guenter