Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2430459imm; Thu, 9 Aug 2018 12:47:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxNKv2xnz2rBuNQYj6ryeQhqjoq+J0ZcQ3eNANTfLpX1Ofh1PlLZKUchkTb7gPisQ6bVZgX X-Received: by 2002:a63:fb57:: with SMTP id w23-v6mr3403392pgj.441.1533844074180; Thu, 09 Aug 2018 12:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533844074; cv=none; d=google.com; s=arc-20160816; b=dH4JZ+Y2gpNR+GEvzMuJsw+vxal8RhXsrRC3enJrEqymrrSc6A5y9uFEGoS2xgGkgG YR6ef9ROK8zJdU+B5UG+rceD0bQvfMzLNqR3UH+iZPnhs/fwtQCEApzeuCEDcizHA7H4 TVttuJrbcRg7tvUi5Y4ZkWKbioGvwMNHCNQmv0T4jb1nxCiZ5nNVqj+FaCdjP3Ty0r+U P/v4L/PPz2im+ucMSA0733gKM/fn/sFgXq23NDu+c/U3RsrxIE8boC0eVCx2yyToJv/y ptP2WfKhHQ6iWU/RBPT326A7cxiBgD8AK7fUdCKAk8x5tU7ftIZB25nuH6tCq/04+pE8 EBOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ywkQ5v/qGGhn2bOYDuH8qj7dIUyevSy3XrFeiu1+oZQ=; b=gg1u+Zhw3HQdnX+TjUlzCFqmLo6aBNrzl1Yg4iMYs6Jn/sYdp9dKJyhiSifW2euRJ2 rmUsVlm84DXy3dci3Ndml9Zy3CSFyevOLfS7QEIx44wUUsJYlOMjPyDAGtpsIIEEgRj1 13pQiV/VjRkMIfUEK3N6RypSWRBBj/PBKkv3mq1193KYzEAzxvTVYQakg2l0yz5BCN+m M7VmzpLpPaV9lawyPYMopX1hyeQQu/datML8qrKDY8FiovUPW6OZDuFOzET8Tlt9rAwJ oHzBZbd4ya2fqriDyQwWTz+QnJRwtC8fyOSzR5TEm3jpLZt0iPUt+21Inn41vo/L5dZC YaoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K9qmW+2n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o84-v6si7845518pfa.15.2018.08.09.12.47.39; Thu, 09 Aug 2018 12:47:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K9qmW+2n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbeHIWMX (ORCPT + 99 others); Thu, 9 Aug 2018 18:12:23 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45874 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeHIWMW (ORCPT ); Thu, 9 Aug 2018 18:12:22 -0400 Received: by mail-pf1-f196.google.com with SMTP id i26-v6so3315788pfo.12 for ; Thu, 09 Aug 2018 12:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ywkQ5v/qGGhn2bOYDuH8qj7dIUyevSy3XrFeiu1+oZQ=; b=K9qmW+2nc31N5bLfr+zBnoaVbWJiQmOlRkcPTpmlXF+LvkKCLLq632tq24jZHhAEUr +vVXFvxk6Fw2pu8neHFe0mOmZtMBui1vhcjz+x8LNV5m+/cZfF0ozfd6J8ouC0QeQMLp JbQ0KXdDRqLuxtVn6EUalS7m5kyDdAGSRHoYk= 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:user-agent; bh=ywkQ5v/qGGhn2bOYDuH8qj7dIUyevSy3XrFeiu1+oZQ=; b=RnqIctZk28wpdGdQJNI9L18yKUQksK/EEeb31BAIuSlQvclpve4JuvzIGBTl+bNo+3 aHjgSSDpPAbjFlupNwDYEPt/p+CckG57VlhP9up3OGnaDrr6T0DuQaX5qlvBmI94r/g+ M5plz9iC3vtJ93t2NjdJ3bNkBgbeft9akSNRJvBP67Vl7Q3jLGH0ZJAqxJ0lT95OhM0w jlaYLe8H4HNVrJBqwdMg8RbFpYQU2dz6i2kD4vE1AQjc0DG4lupmqnIQoYZc7LMF6iKQ FphAa9icNwpgTJl0auZEWfeLNDduIgG6/CLrT2Q0xWYg3riFUTjJScjJ/JGOQxi6KLpj GCGg== X-Gm-Message-State: AOUpUlGI1KYZqc3ZJ5GTduuHX8FpcnPn+KVkAy2lmAAhLVMFdgGiilB3 GfYDGuxcsb6TNgOUVf5EpPYf+A== X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr3382321pgj.356.1533843963396; Thu, 09 Aug 2018 12:46:03 -0700 (PDT) Received: from localhost ([2620:15c:202:1:b6af:f85:ed6c:ac6a]) by smtp.gmail.com with ESMTPSA id w192-v6sm8770803pfd.74.2018.08.09.12.46.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 12:46:02 -0700 (PDT) Date: Thu, 9 Aug 2018 12:46:02 -0700 From: Matthias Kaehlcke To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, smohanad@codeaurora.org, andy.gross@linaro.org, dianders@chromium.org, Zhang Rui , linux-pm@vger.kernel.org Subject: Re: [PATCH v1 06/10] thermal: tsens: Add the SROT address map Message-ID: <20180809194602.GN160295@google.com> References: <3759de54da8dac772f43c098fcec322de179c1a4.1533815718.git.amit.kucheria@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3759de54da8dac772f43c098fcec322de179c1a4.1533815718.git.amit.kucheria@linaro.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 09, 2018 at 06:02:38PM +0530, Amit Kucheria wrote: > On platforms whose device trees specify two address spaces for TSENS, the > second one points to the SROT registers. Initialise the SROT map on those > platforms. > > Signed-off-by: Amit Kucheria > --- > drivers/thermal/qcom/tsens-common.c | 14 ++++++++++++-- > drivers/thermal/qcom/tsens.h | 1 + > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c > index 0585084630b3..0b8a793f15f4 100644 > --- a/drivers/thermal/qcom/tsens-common.c > +++ b/drivers/thermal/qcom/tsens-common.c > @@ -117,16 +117,26 @@ static const struct regmap_config tsens_config = { > > int __init init_common(struct tsens_device *tmdev) > { > - void __iomem *tm_base; > + void __iomem *tm_base, *srot_base; > struct resource *res; > struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); > > if (!op) > return -EINVAL; > > - /* The driver only uses the TM register address space for now */ > if (op->num_resources > 1) { > + /* DT with separate SROT and TM address space */ > tmdev->tm_offset = 0; > + res = platform_get_resource(op, IORESOURCE_MEM, 1); > + srot_base = devm_ioremap_resource(&op->dev, res); > + if (IS_ERR(srot_base)) > + return PTR_ERR(srot_base); > + > + tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, > + srot_base, &tsens_config); > + if (IS_ERR(tmdev->srot_map)) > + return PTR_ERR(tmdev->srot_map); > + > } else { > /* old DTs where SROT and TM were in a contiguous 2K block */ > tmdev->tm_offset = 0x1000; > diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h > index 58e98c4d3a8b..b9c4bcf255fa 100644 > --- a/drivers/thermal/qcom/tsens.h > +++ b/drivers/thermal/qcom/tsens.h > @@ -70,6 +70,7 @@ struct tsens_device { > struct device *dev; > u32 num_sensors; > struct regmap *tm_map; > + struct regmap *srot_map; > u32 tm_offset; > struct tsens_context ctx; > const struct tsens_ops *ops; Reviewed-by: Matthias Kaehlcke