Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1123598pxb; Wed, 6 Apr 2022 09:14:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQDwsV0kRLny6vrwVsZLKteqeiNwKbHwUfsWbcXDJMsmOnrba+N4XNMG58ZadYef4AN+Zg X-Received: by 2002:a17:90b:3652:b0:1ca:b7d1:16b3 with SMTP id nh18-20020a17090b365200b001cab7d116b3mr10942092pjb.34.1649261699155; Wed, 06 Apr 2022 09:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649261699; cv=none; d=google.com; s=arc-20160816; b=eTNFtT49nuJ0LlE6no0rMM+0QpFCFAYvM3GHKPpbixQRfuGGeGsv4GNTrF+bckuGp3 kJr9PqCsgbSJ4E88Z2kaz0Bdz+0GENIUsGroiiug2bpciRjbHP0e4MYPZDniO0PQTnYu A97hvl+Tu62Zf6wWqfOVCISoBIeD51OvFpSDU2bkbZASw0Vn8t6HnF0kyoVn78Mox8QR U0ETgGwrosqpLlpr3j08xwgPW62+6k0zcIBNZ/edy5TipRNY5IQYtPoUH7o3M1iiFHfw j4FmZ1kq0OH7SYus4mBHUyutD3VVkJrI26j3BuV2+mfBPccdWDh6Ce9lE8I5yWe4+vi8 VRfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:sender:dkim-signature; bh=XUCMZHvA32NVgMIdhMLnumEm8DgVyKPRqg3BU0uDa1o=; b=kn8dEYZWzRsep5Vkqb663n88osnpi8Z8y8CdeJMiIxz3RGttwbTfhYdwYNm0Qn+S1u khjZieuh6Ne8jX6cik5DWfHw7cqNXluAJGSvhjCZ9OrIuwi0sm+9XlEhxj54ewpKddpm 8OHTgVPnBClxGWGQAF2GET0vJ9DKl/AZ4H+F1HDFchx1/cLh8hWQ1WG9rTOFTycFNxYz bSSB7C7pDh4qaoe0t6n5MvgEvtf8NueFUQwqv9jZzXwMY4KwQUE8CjbKxmzlMGHz3Igd nAqzpSOpZ+p2hzfCQUlucxeyFJ2VZe6deVwZ7HNnRhteWSDNbqMtmvls22aW/dJqANkj vMkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=In93XZmg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b11-20020a170902d88b00b00153b2d165a5si15037000plz.429.2022.04.06.09.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=In93XZmg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D49423B123C; Wed, 6 Apr 2022 08:11:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235665AbiDFPMK (ORCPT + 99 others); Wed, 6 Apr 2022 11:12:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235625AbiDFPLy (ORCPT ); Wed, 6 Apr 2022 11:11:54 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EFEA41A5DE; Wed, 6 Apr 2022 05:12:24 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id v75so2184515oie.1; Wed, 06 Apr 2022 05:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:content-language:to :cc:references:from:subject:in-reply-to:content-transfer-encoding; bh=XUCMZHvA32NVgMIdhMLnumEm8DgVyKPRqg3BU0uDa1o=; b=In93XZmgy9EURrXq2wy8Vc+CFbxUA1kCJ3+3BwBxUKxuamIuBf1eReQ9ppa9Ht51Ll uo7V9Oss+wis0AcJZfwVc6nwuljju4/6aZEByCwMiW6R0pJM/PMBoisBzFi5r3J8Iwvo 2BzVdfOaWQKmIPwzU7L66q3NZCoRniRjP8xELbkcPrS+SVUJZTRCvj15k94BDfNLy1St HcSdC0d/DrpyFOiGpnRAW+dM5D/7cISi1+sFECMISJqyzF5prshNvgL7K544hMqsOiO8 nxQ4OFcY4X0BkqSkU9LF8NgwNwm9nEsr740t7zUp486tEulD0czuseWtn51H7uWFlzqm YyVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=XUCMZHvA32NVgMIdhMLnumEm8DgVyKPRqg3BU0uDa1o=; b=fipd77DfpUQ2OpO0L+CVOMyCueX/rT+gjenDK6n9Qs25zQfsN3OdQ3gUOdeQYI3Jm8 5Lwi8TN4YT0RtqLKjXJUGXGJs/NtzG1sVXUl83qxnC0TsID6udxoefedlZMcfB1Sew8+ kTMhU11Nq+9xR4r72GVbV4EImPOqQxYA5sNK8CttxzhP93oy8SBe2Lb3W1Pi5D+splpM VkAyXmQZ576xA+YQcgcEghxkk0AuxHE2O0lmsdZdZHIdRqOSRaqhGRyPgPVXsHDD5M13 vqurd6BBJ/tkV81tSsk9JNn7GB2IrMpgtDmHXX8S61iE3gaVcE7arwTuzJM7okUjr8k8 6hIA== X-Gm-Message-State: AOAM530gc3wDqNvEEG6VHt7XOnonJY6JAPW+Y+rwXP0jZterF0o0rRCD exDmh9eXV1Qu3VEQHbBwfpDhaAGzzMQ= X-Received: by 2002:a05:6808:1d5:b0:2ec:977a:515d with SMTP id x21-20020a05680801d500b002ec977a515dmr3256188oic.79.1649247141483; Wed, 06 Apr 2022 05:12:21 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id li20-20020a056871421400b000deaa91898fsm6186669oab.40.2022.04.06.05.12.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 05:12:20 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Wed, 6 Apr 2022 05:12:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Camel Guo , Jean Delvare , Jonathan Corbet Cc: kernel@axis.com, Camel Guo , linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220406092901.408861-1-camel.guo@axis.com> From: Guenter Roeck Subject: Re: [PATCH] hwmon: (tmp401) Support extended temperature range In-Reply-To: <20220406092901.408861-1-camel.guo@axis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/6/22 02:29, Camel Guo wrote: > From: Camel Guo > > This patch only applies to tmp431 and devicetree configuration. > > Signed-off-by: Camel Guo > --- > Documentation/hwmon/tmp401.rst | 13 +++++++++++++ > drivers/hwmon/tmp401.c | 5 +++++ > 2 files changed, 18 insertions(+) > > diff --git a/Documentation/hwmon/tmp401.rst b/Documentation/hwmon/tmp401.rst > index 3aacf3d3bdf3..d12e9c9ba40f 100644 > --- a/Documentation/hwmon/tmp401.rst > +++ b/Documentation/hwmon/tmp401.rst > @@ -78,3 +78,16 @@ some additional features. > > TMP432 is compatible with TMP401 and TMP431. It supports two external > temperature sensors. > + > +Device tree > +----------- > +TMP431 has support for the device tree parameter "extended-range" which enables > +the extended range in the chip. > + There is no practical reason to limit support for this to TMP431, nor does the actual code make such a distinction. > +Example: > + > +main-temp@4c { > + compatible = "ti,tmp431"; > + reg = <0x4c>; > + extended-range; > +}; This is not an acceptable way to describe devicetree properties. You would have to write a bindings document (Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml) and describe the property there. Guenter > diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c > index b86d9df7105d..6efd2475ffda 100644 > --- a/drivers/hwmon/tmp401.c > +++ b/drivers/hwmon/tmp401.c > @@ -557,6 +557,11 @@ static int tmp401_init_client(struct tmp401_data *data) > config_orig = config; > config &= ~TMP401_CONFIG_SHUTDOWN; > > + if (of_property_read_bool(data->client->dev.of_node, "extended-range")) { > + /* Enable extended range */ > + config |= TMP401_CONFIG_RANGE; > + } > + > data->extended_range = !!(config & TMP401_CONFIG_RANGE); > > if (config != config_orig)