mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Johnson <quic_jjohnson@quicinc.com>
To: Bhupesh Sharma <bhupesh.sharma@linaro.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<devicetree@vger.kernel.org>
Cc: <agross@kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<daniel.lezcano@linaro.org>, <robh@kernel.org>,
	<andersson@kernel.org>, <rafael@kernel.org>,
	<bhupesh.linux@gmail.com>
Subject: Re: [PATCH 1/4] thermal: qcom: qmi_cooling: Add skeletal qmi cooling driver
Date: Mon, 12 Sep 2022 14:23:21 -0700	[thread overview]
Message-ID: <ec1858fe-753f-c63a-4580-35851241fbcf@quicinc.com> (raw)
In-Reply-To: <20220912085049.3517140-2-bhupesh.sharma@linaro.org>

On 9/12/2022 1:50 AM, Bhupesh Sharma wrote:
> Add a skeleton driver for supporting Qualcomm QMI thermal mitigation
> (TMD) cooling devices.
> 
> The QMI TMD cooling devices are used for various mitigations for
> remote subsystem(s) including remote processor mitigation, rail
> voltage restriction etc. This driver uses kernel QMI interface
> to send the message to remote subsystem(s).
> 
> Each child node of the QMI TMD devicetree node should represent
> each remote subsystem and each child of this subsystem represents
> separate cooling devices.
> 
> Cc: daniel.lezcano@linaro.org
> Cc: rafael@kernel.org
> Cc: andersson@kernel.org
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>   .../qcom/qmi_cooling/qcom_qmi_cooling.c       | 632 ++++++++++++++++++
>   .../qcom/qmi_cooling/qcom_tmd_services.c      | 352 ++++++++++
>   .../qcom/qmi_cooling/qcom_tmd_services.h      | 120 ++++
>   3 files changed, 1104 insertions(+)
>   create mode 100644 drivers/thermal/qcom/qmi_cooling/qcom_qmi_cooling.c
>   create mode 100644 drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.c
>   create mode 100644 drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.h
> 
> diff --git a/drivers/thermal/qcom/qmi_cooling/qcom_qmi_cooling.c b/drivers/thermal/qcom/qmi_cooling/qcom_qmi_cooling.c
> new file mode 100644
> index 000000000000..4cb601533b9d
> --- /dev/null
> +++ b/drivers/thermal/qcom/qmi_cooling/qcom_qmi_cooling.c

[snip]

> +static char device_clients[][QMI_CLIENT_NAME_LENGTH] = {

can/should this be const?
can/should this use designated initializers?

> +	{"pa"},
> +	{"pa_fr1"},
> +	{"cx_vdd_limit"},
> +	{"modem"},
> +	{"modem_current"},
> +	{"modem_skin"},

[snip]

> diff --git a/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.c b/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.c
> new file mode 100644
> index 000000000000..5b950b8952f0
> --- /dev/null
> +++ b/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.c
> @@ -0,0 +1,352 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2022, Linaro Limited
> + */
> +
> +#include <linux/soc/qcom/qmi.h>
> +
> +#include "qcom_tmd_services.h"
> +
> +static struct qmi_elem_info tmd_mitigation_dev_id_type_v01_ei[] = {

note that commit ff6d365898d ("soc: qcom: qmi: use const for struct
qmi_elem_info") allows QMI message encoding/decoding rules to be const

<https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=ff6d365898d4d31bd557954c7fc53f38977b491c>

I'm waiting for that to land in the soc tree before I submit my changes 
to all of the existing drivers, but you can do this now for the new driver

> +	{
> +		.data_type      = QMI_STRING,
> +		.elem_len       = QMI_TMD_MITIGATION_DEV_ID_LENGTH_MAX_V01 + 1,
> +		.elem_size      = sizeof(char),
> +		.array_type     = NO_ARRAY,
> +		.tlv_type       = 0,
> +		.offset         = offsetof(
> +					struct tmd_mitigation_dev_id_type_v01,
> +					mitigation_dev_id),
> +	},
> +	{
> +		.data_type      = QMI_EOTI,
> +		.array_type     = NO_ARRAY,
> +		.tlv_type       = QMI_COMMON_TLV_TYPE,
> +	},
> +};

[snip]

> diff --git a/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.h b/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.h
> new file mode 100644
> index 000000000000..8af0bfd7eb48
> --- /dev/null
> +++ b/drivers/thermal/qcom/qmi_cooling/qcom_tmd_services.h

[snip]

> +extern struct qmi_elem_info tmd_get_mitigation_device_list_req_msg_v01_ei[];

don't forget to make the externs const as well


  reply	other threads:[~2022-09-12 21:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  8:50 [PATCH 0/4] thermal: Introduce Qualcomm Cooling Driver suppport Bhupesh Sharma
2022-09-12  8:50 ` [PATCH 1/4] thermal: qcom: qmi_cooling: Add skeletal qmi cooling driver Bhupesh Sharma
2022-09-12 21:23   ` Jeff Johnson [this message]
2022-09-13 15:39     ` Bjorn Andersson
2022-09-13 18:42   ` Bjorn Andersson
2022-09-12  8:50 ` [PATCH 2/4] thermal: qcom: Add Kconfig entry & compilation support for " Bhupesh Sharma
2022-09-13 18:53   ` Bjorn Andersson
2022-09-12  8:50 ` [PATCH 3/4] dt-bindings: thermal: Add qcom,qmi-tmd-device and qcom,tmd-device yaml bindings Bhupesh Sharma
2022-09-12 15:38   ` Rob Herring
2022-09-12 15:58   ` Rob Herring
2022-09-13 19:10   ` Bjorn Andersson
2022-10-28 16:58   ` Krzysztof Kozlowski
2022-09-12  8:50 ` [PATCH 4/4] MAINTAINERS: Add entry for Qualcomm Cooling Driver Bhupesh Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec1858fe-753f-c63a-4580-35851241fbcf@quicinc.com \
    --to=quic_jjohnson@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhupesh.linux@gmail.com \
    --cc=bhupesh.sharma@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®