From patchwork Wed Jan 30 16:14:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10788911 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 EC70D184E for ; Wed, 30 Jan 2019 16:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB6212F486 for ; Wed, 30 Jan 2019 16:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF4622FC24; Wed, 30 Jan 2019 16:15:06 +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 A2EAF2F486 for ; Wed, 30 Jan 2019 16:15:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731728AbfA3QPC (ORCPT ); Wed, 30 Jan 2019 11:15:02 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:55726 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731582AbfA3QPC (ORCPT ); Wed, 30 Jan 2019 11:15:02 -0500 Received: by mail-it1-f193.google.com with SMTP id m62so95764ith.5 for ; Wed, 30 Jan 2019 08:15:01 -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=yrq93au3oJ2dDM7QTKg4qsC2yIDdT7nuUkBxd+KI7Ck=; b=N2WHyfGnz0FXfh9XYdxqt5P55gq8ixYlS5bBxzI18t56btVqdiw48LD8CamOF+xv/9 1UqOiiBSQGxByk/5Nn81AECQkzksMrwyH0m618LIbq6e7E3Vu35s+T2idZnWBZLPGUMY jIZ9+E8dxoHkxq3g3OisSXCursJLvhnJjI5OfS+9QnnbgiOa7DEtGzSqNxvxEwLYgzPx XEklNAcaot9HPnNKRqxDJuAonKtuB82ySmJFMq1xqm/tOjfihFlg/N/CSZ3zW4n6w+nM i4+Ac61u/octZWczU6UK9CFSA4XssjXP1P95mzgetrAv/RTrE7iPGrg2y37R18r9jpIa RdRQ== 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=yrq93au3oJ2dDM7QTKg4qsC2yIDdT7nuUkBxd+KI7Ck=; b=rayzLsmG8X5wGZP7BU0M6go6aw/bZmM3tDPJNeczqledSAbkQLkK47xwB7IQrz+8ns LUiRykYtNQZHU40PrRZUecPvKNK/4AcTeAvm0ZgX6Az/4PHNVqXTeSk3aB4AwGWdlcj6 UD4XfBsAghcMtGAW/+CcJcu2Zojt7eGvK9ubp436pdBZLK6e9MAx3NXKfNoRnMrztVHp tOboJ/OuP1ulxIf+n/UxnvjSd32tXuslpk0rcY2mbOC91lHnUazxKXD1pvZpoXJ6pXpK A75OF2jBF4xlOWUGcYTgoK3+ZcxA+G3jVRXDsszekoD3eGGb0BXL8JdBTxftbsfEoaCm NlAg== X-Gm-Message-State: AJcUukfjqBDA8X/KfUqMDgQSIYrtgW5sD8fPq+c5EADFlh+rkT5AMYQR Gzc/eBvlxtnNoW5rp6O2dyu8mtBRNb4= X-Google-Smtp-Source: ALg8bN7tQLMuCew9n4iSOOWyqdnYoMWjvEC1dFlpH33Rr5cpmNErLq1pd62L//HM/hM5OHH04pKLEQ== X-Received: by 2002:a05:660c:3c7:: with SMTP id c7mr13602440itl.131.1548864900873; Wed, 30 Jan 2019 08:15:00 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id 15sm838678iog.59.2019.01.30.08.14.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 08:15:00 -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 resend 1/3] hwmon: (lm85) remove freq_map size hardcodes Date: Wed, 30 Jan 2019 09:14:45 -0700 Message-Id: <20190130161447.19946-1-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190129212920.27921-1-jgebben@sweptlaser.com> References: <20190129212920.27921-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. The size still must be a power of two. 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 0a325878e8f5..48f59667a88c 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 - 1)]; } /* @@ -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_mask; + 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_mask; 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_mask + 1, + 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_mask + 1, 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_mask = ARRAY_SIZE(adm1027_freq_map) - 1; break; default: data->freq_map = lm85_freq_map; + data->freq_map_mask = ARRAY_SIZE(lm85_freq_map) - 1; } /* Set the VRM version */ From patchwork Wed Jan 30 16:14:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10788909 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 427DF139A for ; Wed, 30 Jan 2019 16:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DE312FAD2 for ; Wed, 30 Jan 2019 16:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BF532FC55; Wed, 30 Jan 2019 16:15:06 +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 83D472FAD2 for ; Wed, 30 Jan 2019 16:15:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731834AbfA3QPC (ORCPT ); Wed, 30 Jan 2019 11:15:02 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:38871 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731704AbfA3QPC (ORCPT ); Wed, 30 Jan 2019 11:15:02 -0500 Received: by mail-it1-f193.google.com with SMTP id z20so144127itc.3 for ; Wed, 30 Jan 2019 08:15:02 -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=n87F7pJdSAtJ20hpmsYWm9ZL9IJl9q5DpuciH9mrZRU=; b=ffSkBNAzzIiEUJmsYX+I5tnojD3JHR82Kc1PkiH4ldQHewkA/E7BbKs2srQeYk92FS rHJquQ/YcD6pBLRfe1Or2/1SS4G5ttZk9QOdVlwAy8DKC80OCIbz4XNyKkGwWvcRGwO/ UTCXNqAZyutfJqnurBHQp7WKh5ZdgBpkj66m6QDkOAGIKBW3/YBmYAj9Z8WiknF/25Je QZo14vAPqObZiykfDJ+qVkRzBp2cyHaGDwh2771MxGi1T7MkvzicjWz2Cde7fRrmJYsB KSJphr+kqfsmj4XUTXbYAK5K1Rs6uPd567owpo+kw1hQoqhP181UiWSzWakTnyvLOWMR C1cA== 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=n87F7pJdSAtJ20hpmsYWm9ZL9IJl9q5DpuciH9mrZRU=; b=VtIR/8vbbNrauXivy81tXNVZj1XXU735kQxhavg1n+WzCijjKehcVl4W3ctBIdyfoq ew/pYGNOQ68KGXwIMCGTGRmSfTTpvxMUjNRCaK+bt6fPo4wSslRvzCVhegmnXPRFG6Zk qeATUSlE/0nz7CsZwrtq4x5EW3nWabeALT9XHKKI3m06Q3j+cWnG4cg+b0N87dTQ8raU lpgJy05QSlcbL1KH6SiixhvOFe14Ba0osnBNz8RCTzlYPTuxeHkptOon6gKeNjwVzsjW AlhpZIOHjANHuDByc5Xv+/fdyMRSTz2OFH86ATWNpJuH7y1PfqDEUqxcWe3YElVfocUU 84cQ== X-Gm-Message-State: AJcUukeBe60JuejWxvtbypB0EHLaR7HtG1T5D7hvLod7n95/QC1Bf7LQ 6fjj4NulbtZQwFVMLKfge/ZlgQ== X-Google-Smtp-Source: ALg8bN4Df2QrWGqk+vY9br1bN78QbHHZPRfEdqF5QezwnZ1JVYbG7onJkyimZHh0HZ8fwTdRWdWoAQ== X-Received: by 2002:a24:7fce:: with SMTP id r197mr15788297itc.4.1548864901826; Wed, 30 Jan 2019 08:15:01 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id 15sm838678iog.59.2019.01.30.08.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 08:15:01 -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 resend 2/3] hwmon: (lm85) Document the LM96000 as supported Date: Wed, 30 Jan 2019 09:14:46 -0700 Message-Id: <20190130161447.19946-2-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190130161447.19946-1-jgebben@sweptlaser.com> References: <20190129212920.27921-1-jgebben@sweptlaser.com> <20190130161447.19946-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 7c49feaa79d2..9f3a945d1b80 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 Wed Jan 30 16:14:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Gebben X-Patchwork-Id: 10788913 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 B10DA746 for ; Wed, 30 Jan 2019 16:15:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F02B2F486 for ; Wed, 30 Jan 2019 16:15:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91F282FC24; Wed, 30 Jan 2019 16:15:11 +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 265282F486 for ; Wed, 30 Jan 2019 16:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731836AbfA3QPE (ORCPT ); Wed, 30 Jan 2019 11:15:04 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:36478 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731667AbfA3QPE (ORCPT ); Wed, 30 Jan 2019 11:15:04 -0500 Received: by mail-it1-f196.google.com with SMTP id c9so170307itj.1 for ; Wed, 30 Jan 2019 08:15:03 -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=IxHZdTZ6J0dpqWIVklavMlPQmX6oRc8uMd+DCSk6CDk=; b=vTZ2B3C0M+IYtIE+1ZByVSr8uvDds1bkorJ/izZWC9z03JVXu7LuwmOcAq7fYn/9A9 dECDOKcTnhGbsU4+R66PctMZE6QSBEmZEOg0tMLmI50ViTKwGfaQOHzUii0lg7reCGEP Ji1zrX01M+XLtHTl7ovxPap/JJkvfqbY8mOgO0d97h7JkFh0eWcuNVR02Gh+kLOIj2er IsQnSZ00aiLf1Om6b1YoTJjus6zBQf3WRxsTO6Lb+XZVQgOqnYynfdrsokOVdaTtGNs0 fEBnVOZfZ+G77ScaOwoMNr7p+d+XwjCMTfaz/HtVI1qaZIr4m64KrLfsHYdrvb3wQlkZ StNQ== 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=IxHZdTZ6J0dpqWIVklavMlPQmX6oRc8uMd+DCSk6CDk=; b=S7wYfxUQcUbvkg86UinvNFKOdKJqXZKvv+ix/XPErahIMOVCSGHcqv/Zho+AWk5Hzn QLV5C9qyU37hVbwenZwEuWfrvEYPtspWz/tpDL6gE+R75Sa+8+xtb1xHD0S1/265mKPZ +7UfxeKF4QlFJnqrKebCcrta+zUmmZ28II0zOwWvm/wReUn3eO21VRWOSy+ubxSJIebO uLlBucsTSY2zZ9c3/OtnA8Wbul5wM8WUbKfqdRz64h0/yGXmPBsrZw1U7YT0HuLxyoA2 2qhZ7jKV15XpwDET6pQlDBJNr0xC/WS6vG6rwf1dOdCG5iGEUHqcjP+JXMVzqTXzLVN+ +BCg== X-Gm-Message-State: AJcUukfOhJohic3JKrp//fLFLEDCfb3DxJj5XD+L5OroWHUANnuFKlws V/D5yCKjfv8fA9O/GXgcNiT2iw== X-Google-Smtp-Source: ALg8bN6hyhlWNG+Bom6AsDIWg3dMrA988+TESAa8wqmvOcTJKaKcwDSR2/4FsfXMcE+mFTIDdDWPKg== X-Received: by 2002:a24:710:: with SMTP id f16mr14079927itf.121.1548864902945; Wed, 30 Jan 2019 08:15:02 -0800 (PST) Received: from yngvi.hq.sweptlaser.com ([63.147.146.226]) by smtp.googlemail.com with ESMTPSA id 15sm838678iog.59.2019.01.30.08.15.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 08:15:02 -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 resend 3/3] hwmon: (lm85) add support for LM96000 high frequencies Date: Wed, 30 Jan 2019 09:14:47 -0700 Message-Id: <20190130161447.19946-3-jgebben@sweptlaser.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190130161447.19946-1-jgebben@sweptlaser.com> References: <20190129212920.27921-1-jgebben@sweptlaser.com> <20190130161447.19946-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 9f3a945d1b80..264874f09196 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 48f59667a88c..37bfa7d105a2 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_mask = ARRAY_SIZE(adm1027_freq_map) - 1; break; + case lm85: + data->freq_map = lm85_high_freq_map; + data->freq_map_mask = ARRAY_SIZE(lm85_high_freq_map) - 1; + break; default: data->freq_map = lm85_freq_map; data->freq_map_mask = ARRAY_SIZE(lm85_freq_map) - 1;