From patchwork Thu Feb 28 12:20:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 159345 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp571465jad; Thu, 28 Feb 2019 04:21:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IY14JT/RwHXBWRYhp0b3GRqIUL32zFdCbAndAwi4Jy8IGLm4mp2r+ROkhPcVYJpWsSiqQEL X-Received: by 2002:a17:902:7e46:: with SMTP id a6mr7723929pln.150.1551356498482; Thu, 28 Feb 2019 04:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551356498; cv=none; d=google.com; s=arc-20160816; b=a1MRY11gcyo4gIZcDfIeJaVmdPz6v1UrICdqq0tksk7eGvQ1dxRu5xVjwyNZerlTD0 Oyj9NLepP/m59RbCK4cUB+3/u3VdHaGTvMZZKGjqfHPD5eZ3bztSFOaBcg2h1ml+2jlf c2Ja56LFQOr9N/RHNnv+cWDefbIV0unKA1aOc/xgOnjBheVT1iY+RfNU4YXLQd9neVRI Ufs1/MCuxkYbIYwVqG/yk+G//uAqNKyQiwjaBXA5v6dXcaRFAJUM04rOz90Q8+fRbVou KSh+wXPMH4u9KUvdxKyHeAvZEAVzDBxRp/XuxC95fbALnCgN2L1s6D6Ue3I8rFrTFk8H BUvg== 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=PIKcFf/F7s3pP4SkR5q85tBScZtLxAOdhBXi5IQOT32FydZji5RjrKifc/CMISWVz1 slQ2d1NImWOyMUxHZS8uPKDu5LUWkkTJG8aeax9fVtlfG0K9UZB/pTj+r5Z+wZbv6F8h e0NAPmF71nQ3hMpR/gCi/mgy1XN7rYF5Pz1fE0DRoTob306dQkRWTeussTVJqLUBuXsh h39n3BrFIPQDkb8ts45OKchrRA7WGfsSW5ICKkBUExfogZpWzY7PkFxN48H+qlXn+BUW IWFhBEW8+pORe6BSrYEeB7l3pFvsTrwdbhDE5FLHqFev6AG8c2WBEbaneAIEl3RTdYSF Zgaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yEzZQbbS; 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 r192si331879pgr.331.2019.02.28.04.21.38; Thu, 28 Feb 2019 04:21:38 -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=yEzZQbbS; 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 S1726066AbfB1MVh (ORCPT + 11 others); Thu, 28 Feb 2019 07:21:37 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55847 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727914AbfB1MVg (ORCPT ); Thu, 28 Feb 2019 07:21:36 -0500 Received: by mail-wm1-f68.google.com with SMTP id q187so9064164wme.5 for ; Thu, 28 Feb 2019 04:21:35 -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=yEzZQbbSd8IxFs5neCEzP9oJ2DIiWndR7AngoPaboId/SzXcwwICvEfxF8YzepJ+Gi TMBThEPu9y+jNpbWjFM/S8rfYOF19y/Rm0YRH+AUEswvF61FgsB2/PfM9VgNnAppY/fn FY/rNopl3FmBqAtaGMs/ITKklYX423vE+TG8yvf3gwxDQ+q755cBd4fsSqJbJZrIKguZ 8aZ0TDKEnnAarJBV3mJoLtadfM86Agpifss83Raqh+Lkks0b29qWxj712V90u1plRvqi U77dInHUHSVDi9bobG1IjSFcKE/AGF2GG8L/9e8aeu0UY1sRMULwtA21O9fHmrgfQvX3 QF1Q== 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=GM9EKKqnoMy5OOdietgmhZlhtNXG9hrStSE2vtbJgKL2yVx+KiGFO0mqJ8k5i021CV hKFAe1WASCOrus2Zu+Z3pztP8bkFNMiZ/P65u4cyItZKWQou3qpiQumN0Pn947wmbewj 0lcdKVQbr2gjBnKp/9IgDgHp/uQhDM5vBmYp2APjYs1ELe0LPZqy7Svs3rPZXOtwdZYu 4hXoe7NOfQYXNFzh35mzPSr1YCUU8Nolb52KEx6IWFUqGex1G9b9+7rsCy2fYh52X/jf om4YclGZN5D9amc8dYLKW+gJgOhdGMrcZdTMjlJQZpgvAhvoazCn1E1s7VWs2eT4obCC gjzA== X-Gm-Message-State: AHQUAua7xZeRydL+Ue//S2GAmov+ldC7jhOHmf53bawdBI+EUMxnO/I9 Jrba1gu8hz42elZsabMi/QSpKw== X-Received: by 2002:a1c:f011:: with SMTP id a17mr2668098wmb.89.1551356494718; Thu, 28 Feb 2019 04:21:34 -0800 (PST) Received: from localhost ([49.248.54.130]) by smtp.gmail.com with ESMTPSA id y20sm5556146wmi.34.2019.02.28.04.21.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 04:21:33 -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 v2 01/24] drivers: thermal: tsens: Document the data structures Date: Thu, 28 Feb 2019 17:50:51 +0530 Message-Id: <859106c7c660cffc752165a79c63ee4d636b3c44.1551355503.git.amit.kucheria@linaro.org> 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;