From patchwork Thu Feb 7 10:49:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 157689 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp487864jaa; Thu, 7 Feb 2019 02:50:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IavAS3NgtDMn/Y/S6lddIZdj5tQUREPFG8k68W+yDl+KhC3h/Yodesy+lDLT/wMXbB2BSOx X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr2078480plr.218.1549536604179; Thu, 07 Feb 2019 02:50:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549536604; cv=none; d=google.com; s=arc-20160816; b=C6sKdCTem0b1PC0szxSRi01WXb/c5h5Nma1av9NSYCW+RoYqpW5TfZqqxmOpZqQO3P N+CyVneINbVpO4WRHlrBshzvV1pzUtKhDfyF8Kj/nebJ9Cw+t30s2EFTl923mGTBfWdg SKmG5Q8rEHJ5FQ4LM++a0IsxX16Yk3wdlo82RQnTYZ2pOOOl8JHljY/iaS5gePtG2wh8 LwEEc7WiLGdoRv5JW8z6gJIM3YFa/lhxaAbLL90Wq/Q2QduYAx5JsM/dpkW3dMVDJ7JV vLhY045sfxtokjEWoZFK0smB3EyVJR+HZnQNsEt4pA6OQmLIo543UyzY2RTFS+mAKC5P mOow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=H2crl7RmZMvIJT00kHO5k98tCahG1bLmtk7Nv322/6A=; b=Vb836nHD3BR+QvrJ2RQGIwuFyz261uTJCr0i8KxsKu2moDUKpHcWxMLvpan/+O07W+ k9zUWkm3rDEXU3qMpQjaIbBZF6Kss9cgEdTR8Alkq1LN8yoRadxg1IrYARCJJ3wpPSqT gOCldOHUv2v0giHwqpNqJLOXVnRoK/akBWYEG4l230prbwZ7ftfRwi0/xZFSBcA56Jbk pNTbvbE8nNRt1loYQHWhGuUEG/5lCRHHEDLfgUrLTJW62L11dlSscp8MJo03aL2fz2m9 p9MDp5t1g5vq3t1yBSSz0koYd3IfPti3KFtHGUzkhExi4OBRDh1Jl7qSbz0QPHBrWwMi 9hxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=woMmpAbv; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 w62si8859545pfk.73.2019.02.07.02.50.03; Thu, 07 Feb 2019 02:50:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=woMmpAbv; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726985AbfBGKuD (ORCPT + 11 others); Thu, 7 Feb 2019 05:50:03 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44458 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfBGKuD (ORCPT ); Thu, 7 Feb 2019 05:50:03 -0500 Received: by mail-wr1-f65.google.com with SMTP id v16so9126455wrn.11 for ; Thu, 07 Feb 2019 02:50:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=H2crl7RmZMvIJT00kHO5k98tCahG1bLmtk7Nv322/6A=; b=woMmpAbvOB6OAKBWoHY/WgFkqOflUkOdg3Vm0er4QEBoZU7IqZm1lCqnEx7Y96OPaK iH+F7H4/gwJCqvko0pwphaML5ZFTF8p472cuMSj9KUx55y/S3obdknFha/JWtdBc5MYH HciZLy7gx0VqnRRZUQbdAeK5rtjlhoPfZPDg7STgYZZiEnEJBMH5l2dppVr/m/sAlN4u A+zenUaj6QahFzLwhUGMib6Pgv6tJjUHWALyQPp/ziCXbqZvFFGpdAVOpomACsPmrKbW sp1EgUSSdzffKRcAM5lXIwniD0ExKTkcbL8gPnYXQ+6SGzwV2K+/Y7uL9K6daKNmd+9K R4xg== 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:in-reply-to :references:in-reply-to:references; bh=H2crl7RmZMvIJT00kHO5k98tCahG1bLmtk7Nv322/6A=; b=NbbFk+5w2Jhz7Yz5Xd0k317XZLQaCNs63smD0bWfM3Is7sAfFIr1G/yexGxO9ORA+y hvB7i6kf0/dqM1e79JexQKJnoBYZC0pSwNwarBOj+qKNnr8F2q2ldLeRTnfIFbuMZfRr fdAT+w1LBKGE1j08xqF6r5Ab/VHos4+oO50PqOc7aA0VDJAaBltvPCdBvuiAr7W/VafA +QrZf6q9XVrtl+TO2Uqkyl0Uh8zks/ZtfTPTHlgwtvsc8lfobg3KasK+GPL25NSgDFQK G1DakYhSw2LPYkpgRx6l5o9BPK+q1GVRclZHb8I/zzP2059oI91IXzT4VNzKGXPfA47K DLGg== X-Gm-Message-State: AHQUAuYsEFJXgqxxF4xLpqk90JvGStokp/GxRmpRhMu/WWmY9I9ZbqgB kqkRjOL4ZxS5UbGctZpDM3BzoQ== X-Received: by 2002:a5d:6803:: with SMTP id w3mr12013788wru.272.1549536600901; Thu, 07 Feb 2019 02:50:00 -0800 (PST) Received: from localhost ([49.248.196.115]) by smtp.gmail.com with ESMTPSA id a62sm24387481wmf.47.2019.02.07.02.49.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 02:50:00 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, Daniel Lezcano , David Brown , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v1 01/24] drivers: thermal: tsens: Document the data structures Date: Thu, 7 Feb 2019 16:19:19 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Describe how the TSENS device and the various sensors connected to it are described in the driver Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens.h | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 7b7feee5dc46..89318523c848 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -14,6 +14,16 @@ struct tsens_device; +/** + * struct tsens_sensor - data for each sensor connected to the tsens device + * @tmdev: tsens device instance that this sensor is connected to + * @tzd: pointer to the thermal zone that this sensor is in + * @offset: offset of temperature adjustment curve + * @id: Sensor ID + * @hw_id: HW ID can be used in case of platform-specific IDs + * @slope: slope of temperature adjustment curve + * @status: 8960-specific variable to track 8960 and 8660 status register offset + */ struct tsens_sensor { struct tsens_device *tmdev; struct thermal_zone_device *tzd; @@ -55,8 +65,8 @@ enum reg_list { }; /** - * struct tsens_data - tsens instance specific data - * @num_sensors: Max number of sensors supported by platform + * struct tsens_data - tsens platform data + * @num_sensors: Number of sensors supported by platform * @ops: operations the tsens instance supports * @hw_ids: Subset of sensors ids supported by platform, if not the first n * @reg_offsets: Register offsets for commonly used registers @@ -68,12 +78,27 @@ struct tsens_data { unsigned int *hw_ids; }; -/* Registers to be saved/restored across a context loss */ +/** + * struct tsens_context - Registers to be saved/restored across a context loss + */ struct tsens_context { int threshold; int control; }; +/** + * struct tsens_device - private data for each instance of the tsens IP + * @dev: pointer to struct device + * @num_sensors: number of sensors enabled on this device + * @tm_map: pointer to TM register address space + * @srot_map: pointer to SROT register address space + * @tm_offset: deal with old device trees that don't address TM and SROT + * address space separately + * @reg_offsets: array of offsets to important regs for this version of IP + * @ctx: registers to be saved and restored during suspend/resume + * @ops: pointer to list of callbacks supported by this device + * @sensor: list of sensors attached to this device + */ struct tsens_device { struct device *dev; u32 num_sensors;