Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1932971imm; Mon, 3 Sep 2018 13:25:50 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbhla3yZZQhDfELA2jo+ZZqBIRKtdDoYsir47N5A7Yfwx2Deck8WtsYDy590b/laOhw/Tts X-Received: by 2002:a63:5c5e:: with SMTP id n30-v6mr28143078pgm.253.1536006350024; Mon, 03 Sep 2018 13:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536006349; cv=none; d=google.com; s=arc-20160816; b=fCoNMQz6V+oJPLIdJmwEs/YZ94ysxntzb3gm4JwfpGQlB5/D+sfz0wVfK0iXaKyIhZ 4PKI1wEjdQa+pzO43cIxP1on8V5pJCvWVus3Op+SNuIKBwX81N2N/Lv2k38E0883DiJY dSFvlf9lTRQzfzg16NEwFc9rsOSBsnhcjA7rraK0uSdV8mFqBV5lCVR775RPWil7RGg8 VDdtfjWCLZy4axAEtHyxqnOuPGIhgvDUBQJUAPSz4+DCtjOzTDVlCm7wN/VQhKoGZfHb 4fSOkEP3+gfOLtE4thzbLaXEmRUzAnUgm2iu8PnpkWh1W2XzXyQq6uCKKHvEztLQcc+b jW3Q== 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=Gqa8DjAsLbslhqvdckp+9F2A4OfDGcqfjUcMGYSdaqk=; b=oidxweMvTEYL0z2hQ4UhNGP7+LyacXEhVW7Xl99h+5Evdd1/Rzx8TeHHWSS/FSKpL2 7oVO9vfZbm5kft6zHtdL6fIwmFnCrfTCnHiG9jo24XW5Z6U5UsyfIwzsM7DTpvlSaxgS XwFL4nIzOS3lBqs6fGepVL7CzyQd4DjZKVTAII9GYvrInwUVe1vnGzVbH7UoyzEHUH3H s4B/dQvu8MpBj0cqhoQ+kd2vlvbfDQhDU/g53cNfSxk7ZXflL0vhyeOSZDBC8x/TocS6 qMzIs6/0Jui1lgi3VsAGeyxk12ywhlJCEtAfRB6uSSkYs21J4kUOKAsrfbc2H8B70ZKZ UgMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gWfWnmfQ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8-v6si19096291pgs.144.2018.09.03.13.25.34; Mon, 03 Sep 2018 13:25:49 -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=@linaro.org header.s=google header.b=gWfWnmfQ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbeIDAqS (ORCPT + 99 others); Mon, 3 Sep 2018 20:46:18 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38737 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727552AbeIDAqR (ORCPT ); Mon, 3 Sep 2018 20:46:17 -0400 Received: by mail-pl1-f193.google.com with SMTP id u11-v6so581465plq.5 for ; Mon, 03 Sep 2018 13:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Gqa8DjAsLbslhqvdckp+9F2A4OfDGcqfjUcMGYSdaqk=; b=gWfWnmfQUB0zU90hzRMOcnCJ3JouO5RgHGzR+mbjS+OhyZ7bdCGxKjKTOY8eaCH497 z0wSc8Es+PRpoSdYPcVJqR3Pw/IYBo96Qr9+8kVeeKvNsCAPN3cVgfvflQytX6B2aely 2bFA/3r/0Al9VxW+MMGVbLwPjFIU/YYcKM6/M= 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=Gqa8DjAsLbslhqvdckp+9F2A4OfDGcqfjUcMGYSdaqk=; b=sXbwV2QWZ+p7mWbA8M/Sb1N4bRU7yrpw6nsERnMS6C5pm9NWsh1ExYf7CKYnW3/lCl JRoBT6DrPCMm14/0s7sp/H9qED6Sry5FJAg1Tv4kEEAaL+pBdsmwaPoYyowCyowH0LRT loT6GVOrK0MBBx2G7gHQm+Tm4YQFVpz9uHXl4JnBiHoGluYc5RCXm5MYefNZHr+r5Nj7 OdlEmn/BNCNY3lQFMngLF7KMzSQaNHKQo2L/NPk4yjMA76fJW4KsMLEXL+8PVPgcHl1y BgTdDmkBRyB0iCenEINkN46luA8Lu1LEpq4pbmz6lxyvLqduc+/qUhD5I5cSP/YizM4/ UhDw== X-Gm-Message-State: APzg51BizlhApjhB63+pwP7xTolWl7Q9iRQDMonvwy8bFvv+uiejDqmc asa2gvDcZJdtrJlj0assP0LoNQ== X-Received: by 2002:a17:902:9a83:: with SMTP id w3-v6mr30967023plp.75.1536006268684; Mon, 03 Sep 2018 13:24:28 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id d19-v6sm30525568pfe.42.2018.09.03.13.24.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 13:24:28 -0700 (PDT) Date: Mon, 3 Sep 2018 13:28:22 -0700 From: Bjorn Andersson To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, edubezval@gmail.com, smohanad@codeaurora.org, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: Re: [PATCH v2 07/11] thermal: tsens: Add the SROT address map Message-ID: <20180903202822.GS3456@tuxbook-pro> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 28 Aug 06:38 PDT 2018, 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 > Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > 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; > -- > 2.17.1 >