[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ec1858fe-753f-c63a-4580-35851241fbcf@quicinc.com>
Date: Mon, 12 Sep 2022 14:23:21 -0700
From: Jeff Johnson <quic_jjohnson@...cinc.com>
To: Bhupesh Sharma <bhupesh.sharma@...aro.org>,
<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<devicetree@...r.kernel.org>
CC: <agross@...nel.org>, <linux-arm-msm@...r.kernel.org>,
<daniel.lezcano@...aro.org>, <robh@...nel.org>,
<andersson@...nel.org>, <rafael@...nel.org>,
<bhupesh.linux@...il.com>
Subject: Re: [PATCH 1/4] thermal: qcom: qmi_cooling: Add skeletal qmi cooling
driver
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@...aro.org
> Cc: rafael@...nel.org
> Cc: andersson@...nel.org
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@...aro.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
Powered by blists - more mailing lists