From patchwork Wed Dec 5 21:14:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 57 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f71.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 087982E540B for ; Wed, 5 Dec 2018 22:14:33 +0100 (CET) Received: by mail-wr1-f71.google.com with SMTP id e14sf16416691wru.19 for ; Wed, 05 Dec 2018 13:14:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544044472; cv=pass; d=google.com; s=arc-20160816; b=Q6RKUZIO+GRaL8z9UTDKcVUH0UPI2udlB2Om4GzGSuUvV3V7QWDTlbC0TNvHCjK5lN SGM7kjfWt2daZViieB83tEIC/IvrUCHPNN9jTbPV/cbYq3u/qgAznKWLwJw9b38og0lh kMuzAtTiVF/vFrAyaKdXKos2HdDS7mfakSb0OHU7LFI3zDfvg2GvRmUGP4SZVdhFAHZg sKS1YlDnpFdbyPlmGdFWp4zJSY5vok3iejrk4SR/oZQUEYHOqMkMP4ctSk8H/7jZdq7M vPa4oGCA52xJY3AhLguNvtcWj7jBChXpGHl0/OS/14teA2oXRLyqfl/sqSVQQThQClqJ dDHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=voaN3ll+2wzFcFzcZZWq17UVHOj7IO+So5pVAZfUs6U=; b=dFq8PNOS7F3anwyiPZEfPTQa83ozpxtZzO6RLoKef4dsJVnDLli0f1Yfg2bFqOp97b Y6P1xgtaQpQt+VrU/FOMdqP6sEu0Ow3LQHaNR02h8uDyNALjIGGQF5wlRC21jY860otg WIwcq850haZ7vxTpp/fP4G8QFR6s26SwC4WE6pczPGjBA/89oMu1z/Cxuz2zaqpX8Gql DrQ25RpXyV2o4dRO1x76Kr7yVizvw1cqC6vdfcOZvchcGpYgGTLUhtmXX536FyShKtbE wVNCkfhfRcVZXOoCoZPBoEyXY5g07vIveK/0bEKKAb6srCUGik01sfSxJbnImJqENMcM 1jYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qH8YQjG1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=voaN3ll+2wzFcFzcZZWq17UVHOj7IO+So5pVAZfUs6U=; b=AquRSBM+eWj7pqY+AArjvdnWVlGibxNIZnG/iQ9wAnZkxm4wleukvWY81Ou/o2vXUr dF99mk3CmPUk38f6MGcmhKTI4rekDv+apCEXNH6rJFwnufIFh7raZ5927uHyeISHUaVB ATenvBYNyMOvcHlq/AOLPbvodrE0gA6D3FliA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=voaN3ll+2wzFcFzcZZWq17UVHOj7IO+So5pVAZfUs6U=; b=n8CkC6M064qQaM7fHz2Sc+nV4V7u8ejyUKGZtmz0VRDg3+brb6OkgjI7O80l7AxTsB 8lxKf1QuCTh5Unjaj0w4JydPb/dfB3NnPYCIgYrgIAfId7julj9Dn30utBx3oXhrITYp jqN4PZmDWWBXoFciE4G5HTQO/94ku7S2Dszn2qSlu/YUKP6VJcEAg1+3yKY85rpV/Nj6 3Vg+uCXqfQd9QsSjdhFyUFney7JgaZB3wC412A4MmfEWLgPor7yWRvXLKIICcbWYRPor S1tcvY83czcwkM6FybwBsjS6ioL0fZFrhF6KEEoDXS43WJRdSHRkq1zg7qccVIVb2eQU 0GPA== X-Gm-Message-State: AA+aEWZnZE5RamSB40YJELilfmhnG2cM1LZGbyD1EKWdlD1O60pyHfi3 PrawZjyWucnbAfM78dOUE9G6BXED X-Google-Smtp-Source: AFSGD/V6GfKMGr3ggdCV9kqs1DxOtSiZIrc0zTuqmG1icLE66YHaz7f4FkBfhJaBO3IfR4f9nCybmw== X-Received: by 2002:a1c:85c7:: with SMTP id h190mr2816263wmd.13.1544044472469; Wed, 05 Dec 2018 13:14:32 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a1c:dc04:: with SMTP id t4ls4028475wmg.12.gmail; Wed, 05 Dec 2018 13:14:31 -0800 (PST) X-Received: by 2002:a7b:c852:: with SMTP id c18mr3771610wml.49.1544044471576; Wed, 05 Dec 2018 13:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544044471; cv=none; d=google.com; s=arc-20160816; b=Sppy9c4VyvjKGhQLBLH8kyNyJjB+kC1ikeZiMwDvmTR4BD16JSBek0OU+3chfwGvFW 5ZBZxk+EvnEjrE3yG3RQkwmlSKhZ+VDnMZQNiY9rrWhEsjJi8iByTVYqz7v9Jcn/jjn5 0xnvHmh653wF9HCRz9uqVxWSm+czOUCkQo9jsB13yIRHWAeWhflJTvmHbnQ0+ZWrdnWH 3IKikWDhS1PUbzX0J7SbeOK1KkYqFn5XhOWBq6uh8ror74d0kN9jd/kGqq8aOjYB6Sik pvIDvvaFNcZL3TyMnqDlttmcLtzDfkhKdrphxJCY9gLip11gSQjHd9BV38OlOK0hjgEj 1E5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=voaN3ll+2wzFcFzcZZWq17UVHOj7IO+So5pVAZfUs6U=; b=aG2w+Jso+BpKMpFTcTS+R6BU7i5MiPjZghmQdk1fasjP2DOk42Zsl6eR7R7g4H6oet yt/wqSp8avcpKnR3rYtu47h2xnzzfH1xfNhAEmcDrOeI3cWApNg8eG7nPwOgn3A2THvu mfo+nyw83Ybsmdo+TY0y/UJsnusBt2AwIs29+aWavF6hdITDNSgVwPy+AhxAfLNgHnFD bqAH0RgrQGDr3sxQYFXePTdeS5RtUdzlEOnwPo5etAES4lMHFcuw+yhjz2q6rJK7cxhS Ngojy7yzm0BBW9eVsEJLLIUkkbx4TculuOiaAHXLidtIXMtJxSJrg+cFYZ3xCavGekky /C7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qH8YQjG1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e5sor6596112wmf.25.2018.12.05.13.14.31 for (Google Transport Security); Wed, 05 Dec 2018 13:14:31 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a1c:60c3:: with SMTP id u186mr18642596wmb.66.1544044470951; Wed, 05 Dec 2018 13:14:30 -0800 (PST) Received: from localhost.localdomain (ip-146-204.sn3.clouditalia.com. [213.136.146.204]) by smtp.gmail.com with ESMTPSA id a17sm18740220wrs.58.2018.12.05.13.14.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 13:14:30 -0800 (PST) From: Jagan Teki To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH] hwmon: (lm75) Add STLM75 support Date: Thu, 6 Dec 2018 02:44:22 +0530 Message-Id: <20181205211422.22266-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qH8YQjG1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The STLM75 is a high-precision digital CMOS temperature sensor IC with a sigma-delta temperature-to-digital converter. The configuration register mapping is similar to existing lm75 but the sample rate is 150ms(max). Tested on real hardware and verified temperature readings are correct. Signed-off-by: Jagan Teki --- Documentation/hwmon/lm75 | 5 +++++ drivers/hwmon/Kconfig | 1 + drivers/hwmon/lm75.c | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75 index 2f1120f88c16..010583608f12 100644 --- a/Documentation/hwmon/lm75 +++ b/Documentation/hwmon/lm75 @@ -42,6 +42,11 @@ Supported chips: Addresses scanned: none Datasheet: Publicly available at the ST website http://www.st.com/internet/analog/product/121769.jsp + * ST Microelectronics STLM75 + Prefix: 'stlm75' + 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' Addresses scanned: none diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 532a0532d01b..515b2ad872c8 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1035,6 +1035,7 @@ config SENSORS_LM75 - National Semiconductor LM75, LM75A - NXP's LM75A - ST Microelectronics STDS75 + - ST Microelectronics STLM75 - TelCom (now Microchip) TCN75 - Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP175, TMP275 diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index c7f20543b2bf..62acb9f16ec5 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -50,6 +50,7 @@ enum lm75_type { /* keep sorted in alphabetical order */ max31725, mcp980x, stds75, + stlm75, tcn75, tmp100, tmp101, @@ -316,6 +317,10 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) data->resolution = 11; data->sample_time = MSEC_PER_SEC; break; + case stlm75: + data->resolution = 9; + data->sample_time = MSEC_PER_SEC / 5; + break; case ds7505: set_mask |= 3 << 5; /* 12-bit mode */ data->resolution = 12; @@ -424,6 +429,7 @@ static const struct i2c_device_id lm75_ids[] = { { "max31726", max31725, }, { "mcp980x", mcp980x, }, { "stds75", stds75, }, + { "stlm75", stlm75, }, { "tcn75", tcn75, }, { "tmp100", tmp100, }, { "tmp101", tmp101, }, @@ -494,6 +500,10 @@ static const struct of_device_id lm75_of_match[] = { .compatible = "st,stds75", .data = (void *)stds75 }, + { + .compatible = "st,stlm75", + .data = (void *)stlm75 + }, { .compatible = "microchip,tcn75", .data = (void *)tcn75