Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=quantatw.com (client-ip=220.128.79.91; helo=mx02.quantatw.com; envelope-from=prvs=9529fcd8d=duke.du@quantatw.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=quantatw.com Received: from mx02.quantatw.com (mx02.quantatw.com [220.128.79.91]) by lists.ozlabs.org (Postfix) with ESMTP id 447DJk4fBXzDqKy for ; Mon, 25 Feb 2019 18:35:58 +1100 (AEDT) Received: from unknown (HELO mailbx08.quanta.corp) ([10.243.91.103]) by mx02.quantatw.com with ESMTP; 25 Feb 2019 15:35:55 +0800 Received: from dusj-System-Product-Name.dhcpserver.local (10.243.91.252) by mailbx08.quanta.corp (10.243.91.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Mon, 25 Feb 2019 15:35:54 +0800 From: Duke To: Joel Stanley CC: , Duke Subject: [PATCH dev-4.19 v1] Add-driver-lm75-MAX31725/6-to-linux-kernel-4.19-for-Quanta-GSJ-board Date: Mon, 25 Feb 2019 15:35:47 +0800 Message-ID: <1551080147-6940-1-git-send-email-Duke.Du@quantatw.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.243.91.252] X-ClientProxiedBy: mailbx07.quanta.corp (10.243.91.102) To mailbx08.quanta.corp (10.243.91.103) X-TM-AS-Product-Ver: SMEX-12.0.0.1727-8.200.1013-24452.000 X-TM-AS-Result: No--6.216000-0.000000-31 X-TM-AS-MatchedID: 704421-708060-700648-703523-704410-700016-188019-186035-7 05802-139704-780058-706561-709584-105700-704318-700023-704171-704307-706290 -702626-702169-121169-708712-703712-148004-148036-20020-42000-42003-63 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 07:36:08 -0000 Add driver of sensor lm75 MAX31725/6 to linux kernel-4.19. Signed-off-by: Duke --- Documentation/hwmon/lm75 | 6 +++--- drivers/hwmon/lm75.c | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75 index ac95edf..2f1120f 100644 --- a/Documentation/hwmon/lm75 +++ b/Documentation/hwmon/lm75 @@ -17,8 +17,8 @@ Supported chips: Addresses scanned: none Datasheet: Publicly available at the Maxim website http://www.maximintegrated.com/ - * Maxim MAX6625, MAX6626 - Prefixes: 'max6625', 'max6626' + * Maxim MAX6625, MAX6626, MAX31725, MAX31726 + Prefixes: 'max6625', 'max6626', 'max31725', 'max31726' Addresses scanned: none Datasheet: Publicly available at the Maxim website http://www.maxim-ic.com/ @@ -86,7 +86,7 @@ The LM75 is essentially an industry standard; there may be other LM75 clones not listed here, with or without various enhancements, that are supported. The clones are not detected by the driver, unless they reproduce the exact register tricks of the original LM75, and must -therefore be instantiated explicitly. Higher resolution up to 12-bit +therefore be instantiated explicitly. Higher resolution up to 16-bit is supported by this driver, other specific enhancements are not. The LM77 is not supported, contrary to what we pretended for a long time. diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 49f4b33..e6e5a10 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -47,6 +47,7 @@ enum lm75_type { /* keep sorted in alphabetical order */ lm75b, max6625, max6626, + max31725, mcp980x, stds75, tcn75, @@ -64,7 +65,6 @@ enum lm75_type { /* keep sorted in alphabetical order */ static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; - /* The LM75 registers */ #define LM75_REG_TEMP 0x00 #define LM75_REG_CONF 0x01 @@ -76,7 +76,7 @@ struct lm75_data { struct i2c_client *client; struct regmap *regmap; u8 orig_conf; - u8 resolution; /* In bits, between 9 and 12 */ + u8 resolution; /* In bits, between 9 and 16 */ u8 resolution_limits; unsigned int sample_time; /* In ms */ }; @@ -339,6 +339,10 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) data->resolution_limits = 9; data->sample_time = MSEC_PER_SEC / 4; break; + case max31725: + data->resolution = 16; + data->sample_time = MSEC_PER_SEC / 8; + break; case tcn75: data->resolution = 9; data->sample_time = MSEC_PER_SEC / 8; @@ -415,6 +419,8 @@ static const struct i2c_device_id lm75_ids[] = { { "lm75b", lm75b, }, { "max6625", max6625, }, { "max6626", max6626, }, + { "max31725", max31725, }, + { "max31726", max31725, }, { "mcp980x", mcp980x, }, { "stds75", stds75, }, { "tcn75", tcn75, }, @@ -472,6 +478,14 @@ static const struct of_device_id lm75_of_match[] = { .data = (void *)max6626 }, { + .compatible = "maxim,max31725", + .data = (void *)max31725 + }, + { + .compatible = "maxim,max31726", + .data = (void *)max31725 + }, + { .compatible = "maxim,mcp980x", .data = (void *)mcp980x }, -- 2.7.4