From patchwork Thu Jan 31 22:06:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10791535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A98DB91E for ; Thu, 31 Jan 2019 22:07:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A16413133F for ; Thu, 31 Jan 2019 22:07:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95077315F8; Thu, 31 Jan 2019 22:07:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83EB9314B1 for ; Thu, 31 Jan 2019 22:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729397AbfAaWG6 (ORCPT ); Thu, 31 Jan 2019 17:06:58 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:50964 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729380AbfAaWG6 (ORCPT ); Thu, 31 Jan 2019 17:06:58 -0500 Received: by mail-it1-f195.google.com with SMTP id z7so6275711iti.0 for ; Thu, 31 Jan 2019 14:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sweptlaser-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=XzbzY8HNj9z/jCN5u+k80meW/EpkfANG1HbnilXst1M=; b=O13BlvRITFJPUFKq8jtf3R6uL/Sm9/uWZo7Va7pfImWv9cao5NbE7fMJQ92YnPwHsM NucVSdYL72Bek2odDFcaQElYlAMWji87j1/Hk2ZNyLjK7BkyRFYqEDTVR5Ul3F1JZOI+ 2HWqqBZqgGt0xUf4pDxl82lKF0gG62Y6XpD3M5drAM9hGpDm9yXqHLl1TPRgIOzdoqN3 RdoQFgHSRRTd7uhlzOcKmonOlW9sg46tUxgqBlZHWTcdJjGYgOruLvQHU16epqFdhK8x VLy118EKrZik2Bj7Rg/kS6wpP2iApIrMCyShxsXe9SMtoEwDA48Cg0E6PNSGltaJT5EI OJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=XzbzY8HNj9z/jCN5u+k80meW/EpkfANG1HbnilXst1M=; b=YWGQAFyIHKgQOfAPxG5QuB/p52BX10+8Is2QLFH71ZH0agjJZrVqxXUhE4JbB+Jlhv yJz62FkUzCUtrhyxYP2EOimiVwW9+qJYrWhnyqz+H8vnm2diPd/YkOuR0DArw8Kh3c2+ 8ELWgvpwv2MDL4XyYJFx9oF8wlXi06HT+TrAPlpzJbhQ371viG6hL/yzYSyQ1FHZydkP 93LTOCLsDXuvr5nvWZQ9Kctkc2YEwHwdFLiIWfRlSPlK995EDUdQCZ91V+Y2E7eOoZJ1 /S41iS1yg387cH5SUPSlbZywR/Vn17RadOGB7goVdAW5SfQ81EGKqNgDdu4k591+zIH0 3rmQ== X-Gm-Message-State: AJcUukfLfJPL/Gn1F13ByeptS4incgi/3y4g0m/hf5AoV+1n+Y0gWinU Zb0Q7D9Vvm7ZLbCfgI2d5E9yrg== X-Google-Smtp-Source: ALg8bN7FoCGIiZGVTUBg7cI/dUb73yOki1jwZa0MXgxBI2rI5wKBAvTTnROwMpzn2zFYDbLxdTLy6Q== X-Received: by 2002:a02:4c55:: with SMTP id a82mr23173612jab.29.1548972416832; Thu, 31 Jan 2019 14:06:56 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id l186sm286439itl.22.2019.01.31.14.06.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 14:06:56 -0800 (PST) From: Jeremy Gebben To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] hwmon: (lm85) remove freq_map size hardcodes Date: Thu, 31 Jan 2019 15:06:15 -0700 Message-Id: <20190131220617.15223-2-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190131220617.15223-1-jgebben@sweptlaser.com> References: <20190131220617.15223-1-jgebben@sweptlaser.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow support for chips that support more than 8 frequencies. Signed-off-by: Jeremy Gebben --- drivers/hwmon/lm85.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index 0a325878e..4b15193d1 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c @@ -198,13 +198,13 @@ static int RANGE_TO_REG(long range) #define RANGE_FROM_REG(val) lm85_range_map[(val) & 0x0f] /* These are the PWM frequency encodings */ -static const int lm85_freq_map[8] = { /* 1 Hz */ +static const int lm85_freq_map[] = { /* 1 Hz */ 10, 15, 23, 30, 38, 47, 61, 94 }; -static const int adm1027_freq_map[8] = { /* 1 Hz */ + +static const int adm1027_freq_map[] = { /* 1 Hz */ 11, 15, 22, 29, 35, 44, 59, 88 }; -#define FREQ_MAP_LEN 8 static int FREQ_TO_REG(const int *map, unsigned int map_size, unsigned long freq) @@ -212,9 +212,9 @@ static int FREQ_TO_REG(const int *map, return find_closest(freq, map, map_size); } -static int FREQ_FROM_REG(const int *map, u8 reg) +static int FREQ_FROM_REG(const int *map, unsigned int map_size, u8 reg) { - return map[reg & 0x07]; + return map[reg % map_size]; } /* @@ -296,6 +296,8 @@ struct lm85_data { struct i2c_client *client; const struct attribute_group *groups[6]; const int *freq_map; + unsigned int freq_map_size; + enum chips type; bool has_vid5; /* true if VID5 is configured for ADT7463 or ADT7468 */ @@ -514,7 +516,7 @@ static struct lm85_data *lm85_update_device(struct device *dev) data->autofan[i].config = lm85_read_value(client, LM85_REG_AFAN_CONFIG(i)); val = lm85_read_value(client, LM85_REG_AFAN_RANGE(i)); - data->pwm_freq[i] = val & 0x07; + data->pwm_freq[i] = val % data->freq_map_size; data->zone[i].range = val >> 4; data->autofan[i].min_pwm = lm85_read_value(client, LM85_REG_AFAN_MINPWM(i)); @@ -791,7 +793,8 @@ static ssize_t show_pwm_freq(struct device *dev, if (IS_ADT7468_HFPWM(data)) freq = 22500; else - freq = FREQ_FROM_REG(data->freq_map, data->pwm_freq[nr]); + freq = FREQ_FROM_REG(data->freq_map, data->freq_map_size, + data->pwm_freq[nr]); return sprintf(buf, "%d\n", freq); } @@ -820,7 +823,7 @@ static ssize_t set_pwm_freq(struct device *dev, lm85_write_value(client, ADT7468_REG_CFG5, data->cfg5); } else { /* Low freq. mode */ data->pwm_freq[nr] = FREQ_TO_REG(data->freq_map, - FREQ_MAP_LEN, val); + data->freq_map_size, val); lm85_write_value(client, LM85_REG_AFAN_RANGE(nr), (data->zone[nr].range << 4) | data->pwm_freq[nr]); @@ -1196,7 +1199,7 @@ static ssize_t set_temp_auto_temp_min(struct device *dev, TEMP_FROM_REG(data->zone[nr].limit)); lm85_write_value(client, LM85_REG_AFAN_RANGE(nr), ((data->zone[nr].range & 0x0f) << 4) - | (data->pwm_freq[nr] & 0x07)); + | data->pwm_freq[nr]); mutex_unlock(&data->update_lock); return count; @@ -1232,7 +1235,7 @@ static ssize_t set_temp_auto_temp_max(struct device *dev, val - min); lm85_write_value(client, LM85_REG_AFAN_RANGE(nr), ((data->zone[nr].range & 0x0f) << 4) - | (data->pwm_freq[nr] & 0x07)); + | data->pwm_freq[nr]); mutex_unlock(&data->update_lock); return count; } @@ -1569,9 +1572,11 @@ static int lm85_probe(struct i2c_client *client, const struct i2c_device_id *id) case emc6d103: case emc6d103s: data->freq_map = adm1027_freq_map; + data->freq_map_size = ARRAY_SIZE(adm1027_freq_map); break; default: data->freq_map = lm85_freq_map; + data->freq_map_size = ARRAY_SIZE(lm85_freq_map); } /* Set the VRM version */ From patchwork Thu Jan 31 22:06:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10791537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 202BB184E for ; Thu, 31 Jan 2019 22:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C1A3133F for ; Thu, 31 Jan 2019 22:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DCE2314B1; Thu, 31 Jan 2019 22:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4EA631502 for ; Thu, 31 Jan 2019 22:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729398AbfAaWHJ (ORCPT ); Thu, 31 Jan 2019 17:07:09 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:52300 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729396AbfAaWG6 (ORCPT ); Thu, 31 Jan 2019 17:06:58 -0500 Received: by mail-it1-f196.google.com with SMTP id d11so6253047itf.2 for ; Thu, 31 Jan 2019 14:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sweptlaser-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Vw245cWn0g5x+EHUeJcq50G2A16G6gSxztuHmTu3Pu4=; b=RVkqA+9XmPMxQyaPHIL9zuSx+GXpOFVAmVWtufq+OO6f4AltvKsVonGdL543DfXBlH A0tkB+iJmrhEajErDu00dCZ8n0HbvQFdAlIPNP7VOZiUJMxt0EVkT20OahVZ66JsQeuz 34h52+bj4L+PYZsMRwKvhjZQp8hzTpZIx46yun4VW8sI7Wa/68bB0VKuwD24CSEKBPCt xYSzXJbWcHwnAAjgG9s47gcc6dD/ExMXejyTK1783W4h0r+7+pQXEw47/z5E3DhcFDdk RqeT6GCq1efACi6gmg46AaGlg+SPGLwf0dySXAEv6HOPO8SKrYR8UJEEIrX6GVCtwYxt Fn8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Vw245cWn0g5x+EHUeJcq50G2A16G6gSxztuHmTu3Pu4=; b=SiGgu/RXGb6fYs7M9Il56cRJnY+heR2yOb8gr2ojykM0wLLk3lTCWc0v9iGHwnxnXf p9f7BZlNYWngT55kcumf/O5JEXCAwNx5Pwb9nmpqZB4jJRLX1GYVbodBOPVc7HT4ERl7 boL2zsSIaqYyHtkFE4BrFrXvNK5mOoPQQOV++rdNeZ5cwEgsTLlkGI3ehh6z7o5/W9VO 85YIjl8MFeJcZNxOtbO3jyxDV7D6ogbCyi2Z31dDAplZNNDAY/PmjjQR1KklXKNpngHD WeeQxmyN2nvfVaapzAYGCGTbriuUMDkIYBO2Toaqhpi8cgccRgXoQtmv/YempcM9W4D9 6UgA== X-Gm-Message-State: AJcUukePEwaXzZRiXbdbIAzF6JnaMRkZFwYcuggKuBVS9kJylTBWcOMk vFsW2/s4hGcmrZECfAseV5Ckew== X-Google-Smtp-Source: ALg8bN4YDmDOmsi9TL3GKBcYNKf9BuwV4wLwtRGsuKMGvO7gOsJvWxbUx7zY37jzDFCJGBjFBGfETg== X-Received: by 2002:a05:660c:4b:: with SMTP id p11mr20478600itk.71.1548972417872; Thu, 31 Jan 2019 14:06:57 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id l186sm286439itl.22.2019.01.31.14.06.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 14:06:57 -0800 (PST) From: Jeremy Gebben To: Jean Delvare , Guenter Roeck , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] hwmon: (lm85) Document the LM96000 as supported Date: Thu, 31 Jan 2019 15:06:16 -0700 Message-Id: <20190131220617.15223-3-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190131220617.15223-1-jgebben@sweptlaser.com> References: <20190131220617.15223-1-jgebben@sweptlaser.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It has been supported as a generic lm85 for quite some time. Signed-off-by: Jeremy Gebben --- Documentation/hwmon/lm85 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index 7c49feaa7..9f3a945d1 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 @@ -3,9 +3,13 @@ Kernel driver lm85 Supported chips: * National Semiconductor LM85 (B and C versions) - Prefix: 'lm85' + Prefix: 'lm85b' or 'lm85c' Addresses scanned: I2C 0x2c, 0x2d, 0x2e Datasheet: http://www.national.com/pf/LM/LM85.html + * Texas Instruments LM96000 + Prefix: 'lm85' + Addresses scanned: I2C 0x2c, 0x2d, 0x2e + Datasheet: http://www.ti.com/lit/ds/symlink/lm96000.pdf * Analog Devices ADM1027 Prefix: 'adm1027' Addresses scanned: I2C 0x2c, 0x2d, 0x2e From patchwork Thu Jan 31 22:06:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10791533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 142AB14E1 for ; Thu, 31 Jan 2019 22:07:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 008A53133F for ; Thu, 31 Jan 2019 22:07:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8CB1315FA; Thu, 31 Jan 2019 22:07:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3463133F for ; Thu, 31 Jan 2019 22:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729412AbfAaWHI (ORCPT ); Thu, 31 Jan 2019 17:07:08 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:39919 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729408AbfAaWHA (ORCPT ); Thu, 31 Jan 2019 17:07:00 -0500 Received: by mail-it1-f195.google.com with SMTP id a6so6847190itl.4 for ; Thu, 31 Jan 2019 14:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sweptlaser-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=8HX/Q0Q0YXHh0N7JBuVTXEi1U08jlS7KA/W4WOsuBz4=; b=C76RMqBO1Txu+mRk8i6tKqG0L8zB5Zjvxmju4grLnJSQ+m9fAO70vD4mI1dXeWOizo pr84upoPGxiBneQVB+a4fy71jpQ8oWVNI2OLOBLQ5MKGGIffUzIQuCCSmmcN5mAl0vsv aPbnukagno1YZaFXV//x534U1r2/WEKT9/z2WTEs5nlwstY7DIve6pZ/s8tJj70sJgb1 Z8PUTFgS1n5wCHPkYKKQlVfASZ6XTtwMEwOlFklOzXOnT67tE56amgWFWCx7T3OghYZC cgEIr4aJ58gK6ezyTOMR5vvNyGlTe1YJt/9vNobtwCa7syBFUdwz7pNoYrc+M8cwlkQE 9WnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=8HX/Q0Q0YXHh0N7JBuVTXEi1U08jlS7KA/W4WOsuBz4=; b=irCPVDYn384jcbA1KQiXzCvMGnFBV2GLqb1YEQs0g/+0DSKsCswuZO8HJNYJPfV/rc N6QaDkLj3Wux7GV88koZJksEbQC1Gg2hcJ1SQZxtnqvb+W8XHklBquLxwXvbzLLx4X/k La0QCZ8jIxEhSVSVrCgwrcVFJfMwU3JRfb6Ng+kQziljD/fa20E2N7zcGYqkmBCzQJnO +3Jar9SgHdCp/OvxxDMxHp7Nh1il/r8jhj8pc8eK8D9N7qHWREk85oCO6KSG7jinDA9t 5+NhF+Om25f+xq/vXlqryVFnEUofXBT2sIUy/P17YOgoOqcqKG5eX1t2TZ93kUHD10qL E5HQ== X-Gm-Message-State: AJcUukfemDIWquA8p7KRXKdt4tz0T+nKdJkZYx8ji5bTuG1KdvDmTxDB 0Z6iBQa6JrGce1HN09vH0+m9Td4wd48= X-Google-Smtp-Source: ALg8bN5G0WKX5yWjV8tLuA1R+c0e38mQpMrT32D8ZJIVr4ab4sUsDeqgJe94bdqjaIepskQkx+C5YQ== X-Received: by 2002:a24:f143:: with SMTP id q3mr20462381iti.42.1548972419045; Thu, 31 Jan 2019 14:06:59 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id l186sm286439itl.22.2019.01.31.14.06.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 14:06:58 -0800 (PST) From: Jeremy Gebben To: Jean Delvare , Guenter Roeck , Jonathan Corbet , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] hwmon: (lm85) add support for LM96000 high frequencies Date: Thu, 31 Jan 2019 15:06:17 -0700 Message-Id: <20190131220617.15223-4-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190131220617.15223-1-jgebben@sweptlaser.com> References: <20190131220617.15223-1-jgebben@sweptlaser.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This chip expands the freqency field from 3 to 4 bits, to add more frequencies in the 22.5 to 30 kHz ranges. Signed-off-by: Jeremy Gebben --- Documentation/hwmon/lm85 | 3 +++ drivers/hwmon/lm85.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index 9f3a945d1..264874f09 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 @@ -140,6 +140,9 @@ of voltage and temperature channels. SMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl and temp#_auto_temp_off. +The LM96000 supports additional high frequency PWM modes (22.5 kHz, 24 kHz, +25.7 kHz, 27.7 kHz and 30 kHz), which can be configured on a per-PWM basis. + Hardware Configurations ----------------------- diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index 4b15193d1..88f08f4bc 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c @@ -202,6 +202,11 @@ static const int lm85_freq_map[] = { /* 1 Hz */ 10, 15, 23, 30, 38, 47, 61, 94 }; +static const int lm85_high_freq_map[] = { /* 1 Hz */ + 10, 15, 23, 30, 38, 47, 61, 94, + 22500, 24000, 25700, 25700, 27700, 27700, 30000, 30000 +}; + static const int adm1027_freq_map[] = { /* 1 Hz */ 11, 15, 22, 29, 35, 44, 59, 88 }; @@ -1574,6 +1579,10 @@ static int lm85_probe(struct i2c_client *client, const struct i2c_device_id *id) data->freq_map = adm1027_freq_map; data->freq_map_size = ARRAY_SIZE(adm1027_freq_map); break; + case lm85: + data->freq_map = lm85_high_freq_map; + data->freq_map_size = ARRAY_SIZE(lm85_high_freq_map); + break; default: data->freq_map = lm85_freq_map; data->freq_map_size = ARRAY_SIZE(lm85_freq_map);