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: 10832869 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C5161390 for ; Thu, 28 Feb 2019 12:21:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F2CA2EC38 for ; Thu, 28 Feb 2019 12:21:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CFD22EC3B; Thu, 28 Feb 2019 12:21:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2962EC38 for ; Thu, 28 Feb 2019 12:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731547AbfB1MVi (ORCPT ); Thu, 28 Feb 2019 07:21:38 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52260 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731510AbfB1MVh (ORCPT ); Thu, 28 Feb 2019 07:21:37 -0500 Received: by mail-wm1-f67.google.com with SMTP id m1so9068342wml.2 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=r3tz9WTHw6xxVW+ydffa4r6OGM3j8H4GX8MAh4p/6ZFlpou6xEc0x8rOGF85pNCWiF Erp5m83mBTWnU8l4yDSlhPbknydP0SOrYBoI9NsyyhY4li++sIIhWkXNjdCbtWMsKj9Z hFxrpZt3caZBxVUqgsoMgO1PQux4CruX9Il7I0crRq+kh6d0bNTNmFgxk0RXfQPUDnms b0YbvHmn/ckSsBYzKuW5EQxgANIt7q6IdvNSyvXktRlkPkbnphgbO8UrW86o/DFgTjGB 7JoNaFCvpCZCwfnzpJpcpizrvcyB5DJhTHN5xoErauWHaL7jvc7GvLQxGrvucr2Zltmb oRnA== X-Gm-Message-State: AHQUAuZZJAShnzQUwtbzaXdN7C78KG5cTajbaLZAgB4hvwIxLqrxLrWk Ck0z+GaFQR9fxLgn5fQjd0tZew== X-Google-Smtp-Source: APXvYqw5EtuntVmwNkHAw3+zrjw+C6c5Qw3QEcic2hxXxAfxGVfFRLU3ELO63I7SeI5v+axw9ljFOA== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;