From patchwork Tue Apr 23 10:11:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iker Perez X-Patchwork-Id: 10912617 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 4B40D922 for ; Tue, 23 Apr 2019 10:11:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D53A2871C for ; Tue, 23 Apr 2019 10:11:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 319FC287DE; Tue, 23 Apr 2019 10:11:25 +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,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 6FCAA2871C for ; Tue, 23 Apr 2019 10:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbfDWKLY (ORCPT ); Tue, 23 Apr 2019 06:11:24 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:37472 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWKLX (ORCPT ); Tue, 23 Apr 2019 06:11:23 -0400 Received: from [167.98.27.226] (helo=[10.35.4.32]) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1hIsOS-0000V0-3j; Tue, 23 Apr 2019 11:11:16 +0100 Subject: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B References: <2904a750-c6e9-719b-7523-0f45e0bc82cc@codethink.co.uk> To: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux@roeck-us.net, jdelvare@suse.com From: Iker Perez del Palomar X-Forwarded-Message-Id: <2904a750-c6e9-719b-7523-0f45e0bc82cc@codethink.co.uk> Message-ID: <2effcb0e-03c6-0f7e-b154-62cbc9ad415a@codethink.co.uk> Date: Tue, 23 Apr 2019 11:11:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <2904a750-c6e9-719b-7523-0f45e0bc82cc@codethink.co.uk> Content-Language: en-GB 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 The TMP75B has a different control register, supports 12-bit resolution and the default conversion rate is 37 Hz. Signed-off-by: Iker Perez del Palomar Sustatxa ---  Documentation/hwmon/lm75 |  5 +++--  drivers/hwmon/lm75.c     | 13 +++++++++++++  2 files changed, 16 insertions(+), 2 deletions(-)   */ @@ -59,6 +60,7 @@ enum lm75_type {        /* keep sorted in alphabetical order */      tmp175,      tmp275,      tmp75, +    tmp75b,      tmp75c,  }; @@ -378,6 +380,12 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)          data->resolution = 12;          data->sample_time = MSEC_PER_SEC / 2;          break; +    case tmp75b: +        clr_mask |= 1 << 15;        /* not one-shot mode */ +        data->resolution = 12; +        data->sample_time = MSEC_PER_SEC / 32; +        break; +      case tmp75c:          clr_mask |= 1 << 5;        /* not one-shot mode */          data->resolution = 12; @@ -438,6 +446,7 @@ static const struct i2c_device_id lm75_ids[] = {      { "tmp175", tmp175, },      { "tmp275", tmp275, },      { "tmp75", tmp75, }, +    { "tmp75b", tmp75b,},      { "tmp75c", tmp75c, },      { /* LIST END */ }  }; @@ -537,6 +546,10 @@ static const struct of_device_id lm75_of_match[] = {          .data = (void *)tmp75      },      { +        .compatible = "ti,tmp75b", +        .data = (void *)tmp75b +    }, +    {          .compatible = "ti,tmp75c",          .data = (void *)tmp75c      }, diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75 index 010583608f12..baf052935761 100644 --- a/Documentation/hwmon/lm75 +++ b/Documentation/hwmon/lm75 @@ -47,8 +47,8 @@ Supported chips:      Addresses scanned: none      Datasheet: Publicly available at the ST website             https://www.st.com/resource/en/datasheet/stlm75.pdf -  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75C, TMP175, TMP275 -    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75c', 'tmp275' +  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B, TMP75C, TMP175, TMP275 +    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75b', 'tmp75c', 'tmp275'      Addresses scanned: none      Datasheet: Publicly available at the Texas Instruments website                 http://www.ti.com/product/tmp100 @@ -56,6 +56,7 @@ Supported chips:                 http://www.ti.com/product/tmp105                 http://www.ti.com/product/tmp112                 http://www.ti.com/product/tmp75 +               http://www.ti.com/product/tmp75b                 http://www.ti.com/product/tmp75c                 http://www.ti.com/product/tmp175                 http://www.ti.com/product/tmp275 diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 62acb9f16ec5..1b5c32cbdc62 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -32,6 +32,7 @@  #include "lm75.h" +  /*   * This driver handles the LM75 and compatible digital temperature sensors.