Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2906217pxu; Sun, 29 Nov 2020 08:33:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJySyd1+aaB9ED3UUOGbtWCxPuMzu/XmDJlUzsXX0px/1e4jH6xb54oe80lm5yMYGoEogW3B X-Received: by 2002:a17:906:ca9:: with SMTP id k9mr15764252ejh.64.1606667638909; Sun, 29 Nov 2020 08:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606667638; cv=none; d=google.com; s=arc-20160816; b=W0SXO+Dx/3GDptoS2RWLd1i811IHzFB4DhDo7iBeeVQUrHaR3PikTI9Po0nxjHqOiY Y87RHlufV6EEfYKJBBr1OIdH502HHw6ZnXLWmGkUL1AZLW9rI5OakC5voNsXwCfQQu47 EYI6xM9KEeiBgecwA14aGU432GBhsSXjCf9QzNaZhwWSjZNvPeD5EUeGVUM4RrPYaezi L0yJNxBV7/v7H/Ab+FTfn70p/yWvBQZ6TYb3F0HJEgy/w8/T+JUvisSH+W7X8jzMu+Mb 6OpUOVzN1yAcdAEppxf7LFi7+Ad7MdhH6nt87h5pEZH2+RjiNEJ8gwLtgiWRT+1QL0QP DeBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TltC2PWtsn2vLklBGm2EarhUufc2HeBfxICO+b5w0hE=; b=cSVqpdCG7X/XTczYjosRjNwtDHIY1mO9iu1ZWbzpRDG8kFoyrexlyYNKij0BYlPJIH xzSSGJBBA9JPhj7yCEn3AUWqzdg4Vbo10X0peFkr6h/a+gGn0PTb9rWpAEercCA6uj+/ 1f+XnE2bcyrr9lg6nnFBtKKB3qekffQgZDn1ZB/1lIxZS4WCXtf/GZ1Wdf+mqJOOR7k8 zAvPWoTHunajdjKbztPDeiKToMC1RT2CBF+kVv/pj7JDpC4iGW9+HTxwm6zHXbX+v8ny gMu/EXN6D1JkA202kuNDHUDbP7nptYw42zCkx3pW9EJWyjbAT+HystZkYzHVC7p+Ij3X hWMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=syxCMDtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si9182071ejn.255.2020.11.29.08.33.36; Sun, 29 Nov 2020 08:33:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=syxCMDtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728050AbgK2Q3b (ORCPT + 99 others); Sun, 29 Nov 2020 11:29:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbgK2Q3a (ORCPT ); Sun, 29 Nov 2020 11:29:30 -0500 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFC3C0613CF; Sun, 29 Nov 2020 08:28:50 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id v14so7724579wml.1; Sun, 29 Nov 2020 08:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TltC2PWtsn2vLklBGm2EarhUufc2HeBfxICO+b5w0hE=; b=syxCMDtpjFxQe9C8gESgHY+NEuimyGDPhqsEJ9BtEpQL6venr72AQDbb8egNFH22O1 1aMSX7iZNBR67pMrgaKcePMhJ421U9pbRLIHJ6snTZTdhiKiXgDVFm/FZbivb+6Vg2+9 aGfgs+zU5VLmX7vINq1Pb9nwrN8lA4tSo6Xt2NBE4HVbp+okpN7s0Xn/BvEOEk5FR+nq E6VVyOorMZ4oTFyRobY+tqsNLvwakjYTmDIXnqrbxrqRn2W3D2CF/uROA12hWiQlpZzv ORj+XDD5ptSRbYR3L5uAJB1f+/aIgfTvi8Kry4C1tDV0Zs3hUsu/NN+71SxQEO23Ff2Z 0uGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TltC2PWtsn2vLklBGm2EarhUufc2HeBfxICO+b5w0hE=; b=Qi22JqX40ngFC0zouB5HwNouApi8RsBQqNQiaImz1MfOzDIGz8s1KwH6Bb7uZwSsQz EmWJroTYJLdzVtdVpIMsUrkDsFrTUyqzlGiFe4mVHEsq2P6MwYb3CC7BtbjXEITtC+bV xZYpbMRIa27Ohru3Dtqj9i0JFpX1YflTcioqBBsJHHfpMC8VgcCO6If+9tXieTQeavs5 JWGVgQ6xH3MNib4rZ2J7xJsFa9hNcV/1U33zg/LMUCOOcnxPb/WgqgBklIgp5UpLaB5x qWdkUQmTikq84dc6anUGRGunfd/ecxwNMym8ToQpiHmlZeliMbUbG9Thae+L87GJRJjJ MGsA== X-Gm-Message-State: AOAM531qLy8RB9o8xcKtulkF9F+A86H6vhD51VJ0RRCL33Tj3jREOjBz 5rLxME+4UVHlnUjJqNaCx/M= X-Received: by 2002:a05:600c:286:: with SMTP id 6mr18874664wmk.125.1606667328742; Sun, 29 Nov 2020 08:28:48 -0800 (PST) Received: from ansuel-xps20.localdomain (host-82-53-191-46.retail.telecomitalia.it. [82.53.191.46]) by smtp.gmail.com with ESMTPSA id f17sm20197686wmh.10.2020.11.29.08.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 08:28:47 -0800 (PST) Date: Sun, 29 Nov 2020 17:28:46 +0100 From: Ansuel Smith To: Amit Kucheria Cc: Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Daniel Lezcano , Rob Herring , linux-arm-msm , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML Subject: Re: [RFC PATCH v6 2/8] drivers: thermal: tsens: Add VER_0 tsens version Message-ID: References: <20200814134123.14566-1-ansuelsmth@gmail.com> <20200814134123.14566-3-ansuelsmth@gmail.com> <20201125122228.GB23592@ansuel-xps20.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 29, 2020 at 06:28:01PM +0530, Amit Kucheria wrote: > On Thu, Nov 26, 2020 at 2:16 AM Ansuel Smith wrote: > > > > > }; > > > > @@ -441,6 +442,10 @@ enum regfield_ids { > > > > CRIT_THRESH_14, > > > > CRIT_THRESH_15, > > > > > > > > + /* VER_0 MIN MAX THRESH */ > > > > + MIN_THRESH_0, > > > > + MAX_THRESH_0, > > > > + > > > > > > Consider reusing LOW_THRESH_0 and UP_THRESH_0 for these? > > > > > > > As we already have defined LOW_THRESH and UP how can we reuse that > > regfield to define MIN and MAX? > > > > We are using MIN and MAX THRESH on the apq8064 to mean LOW and UP > THRESOLD, isn't it? IIUC, It was just named differently earlier. > > When the driver is loaded on the apq8064, only that one field will be > use since v0 has a single threshold for all sensors. When the driver > is loaded on new IPs, all fields will be used. Let's sum up things and take a decision about this. On V_0 the original driver have a special implementation that has a 4 trips point, one critical high (that should be MAX_THRESH), one critical low (that should be MIN_THRESH), one configurabile hi and one configurable low. This is the regfiled [LOW_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 0, 7), [UP_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 8, 15), [MIN_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 16, 23), [MAX_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 24, 31), and we have the regfiled to check if the threshold is violated. Looking at the set trips code, since V_0 doesn't have critical interrupt, we only set the uplow interrupt. Now the current code only check the LOW and UP regfield and V_0. The original code also check MIN and MAX (that are set to 125 C and 0 C, that should be the critical trip point). Should we: 1. drop the MIN and MAX THRESH and keep them unconfigured (and make the interrupt set only to the UP/LOW trips) or 2. add the missing code to set_trips Honestrly I'm more with the first approach. I also sent v7 that should address all the other request. As always thanks for the attention.