From patchwork Mon Jul 8 15:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 168669 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp7327055ilk; Mon, 8 Jul 2019 08:44:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwV9t652/PTKLduJp0o/l7FS3+miWCyBJjx8nmA9nnP04a6+fTgeNN3i7La/JfZwyu0RBF7 X-Received: by 2002:a17:902:16f:: with SMTP id 102mr24906811plb.94.1562600657056; Mon, 08 Jul 2019 08:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562600657; cv=none; d=google.com; s=arc-20160816; b=YaqcFMg+b32ixxYs/0lRCngtrDsAcCDFRhzIgTyPTysr15PjcVvCh1X+4C4xuYuqnB cYwGJ6uYOnXaYaJnqhiR9t4hTBSXVE6WTaBk1QIxfIA0gwlWqszmpBMSth9rA4udUVnf j9Fn+oVyH8stnqTvq2hv5olio2pppF6t1Axu+79Ej8BhtrHsXGjWtpLy35Ne3Xb0yV1M Z9Zq87BXkxCYuWhJPb67JRlAqhv5ZXDDk3UN+T3uPjU4b8lioOYqfEJscsxSCNht34sC Aqc7tbNCj+mwlDak3iFOZAoQOXmwPT08ZUFZjC8kMYvSHLEAhYBbYxDMp9tfaWf/qCri OS5A== 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:message-id:date :subject:cc:to:from; bh=awt3BzpI0//iCh1ptntq/7xRjXLpiELKCJNyrNuLlzE=; b=J4v5+MuzW4FwazrqT/RH7nrVnfvxby+rbOmmCqH4K4nanf8/swyeJeyfJkakkED6Qu IsgX6AD56lO7fm0o/8417GFKJwBSaYpeyPNLoYh4SfV0MWkXdPGF7tUJeOpCpUH6BqFU bWGQVZDBKSSxLFqQkh+jJ2mRY7Lgtdt2PVVRGg6ZpvDYzyXwi/Rf1waLDPk079i8AOyJ pQKqPmsYeKNKu0RfAN8+Dyo/+aOXYZBLDKrmLU2ffcKD6ovhA+90VLU5bdJFgI80DX4e rLfc7Q3QUwsCkH58mnyV5eq/SOpdG5QVSJbIyt8ouNHLw8G+lahXJt1Ke24p33mmsfBx B2pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si17362557plt.167.2019.07.08.08.44.16; Mon, 08 Jul 2019 08:44:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403870AbfGHPoP (ORCPT + 30 others); Mon, 8 Jul 2019 11:44:15 -0400 Received: from foss.arm.com ([217.140.110.172]:52020 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390268AbfGHPoK (ORCPT ); Mon, 8 Jul 2019 11:44:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5FCFB1509; Mon, 8 Jul 2019 08:44:09 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5CE6A3F59C; Mon, 8 Jul 2019 08:44:08 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , linux-kernel@vger.kernel.org, Peng Fan , Jim Quinlan , Bo Zhang , Volodymyr Babchuk Subject: [PATCH 2/6] firmware: arm_scmi: Align few names in sensors protocol with SCMI specification Date: Mon, 8 Jul 2019 16:43:54 +0100 Message-Id: <20190708154358.16227-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708154358.16227-1-sudeep.holla@arm.com> References: <20190708154358.16227-1-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks like more code developed during the draft versions of the specification slipped through and they don't match the final released version. This seem to have happened only with sensor protocol. Renaming few command and function names here to match exactly with the released version of SCMI specification for ease of maintenance. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/sensors.c | 28 +++++++++++++++------------- include/linux/scmi_protocol.h | 12 ++++++------ 2 files changed, 21 insertions(+), 19 deletions(-) -- 2.17.1 diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c index 0e94ab56f679..17dbabd8a94a 100644 --- a/drivers/firmware/arm_scmi/sensors.c +++ b/drivers/firmware/arm_scmi/sensors.c @@ -9,8 +9,8 @@ enum scmi_sensor_protocol_cmd { SENSOR_DESCRIPTION_GET = 0x3, - SENSOR_CONFIG_SET = 0x4, - SENSOR_TRIP_POINT_SET = 0x5, + SENSOR_TRIP_POINT_NOTIFY = 0x4, + SENSOR_TRIP_POINT_CONFIG = 0x5, SENSOR_READING_GET = 0x6, }; @@ -42,9 +42,10 @@ struct scmi_msg_resp_sensor_description { } desc[0]; }; -struct scmi_msg_set_sensor_config { +struct scmi_msg_sensor_trip_point_notify { __le32 id; __le32 event_control; +#define SENSOR_TP_NOTIFY_ALL BIT(0) }; struct scmi_msg_set_sensor_trip_point { @@ -160,15 +161,15 @@ static int scmi_sensor_description_get(const struct scmi_handle *handle, return ret; } -static int -scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id) +static int scmi_sensor_trip_point_notify(const struct scmi_handle *handle, + u32 sensor_id, bool enable) { int ret; - u32 evt_cntl = BIT(0); + u32 evt_cntl = enable ? SENSOR_TP_NOTIFY_ALL : 0; struct scmi_xfer *t; - struct scmi_msg_set_sensor_config *cfg; + struct scmi_msg_sensor_trip_point_notify *cfg; - ret = scmi_xfer_get_init(handle, SENSOR_CONFIG_SET, + ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_NOTIFY, SCMI_PROTOCOL_SENSOR, sizeof(*cfg), 0, &t); if (ret) return ret; @@ -183,15 +184,16 @@ scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id) return ret; } -static int scmi_sensor_trip_point_set(const struct scmi_handle *handle, - u32 sensor_id, u8 trip_id, u64 trip_value) +static int +scmi_sensor_trip_point_config(const struct scmi_handle *handle, u32 sensor_id, + u8 trip_id, u64 trip_value) { int ret; u32 evt_cntl = SENSOR_TP_BOTH; struct scmi_xfer *t; struct scmi_msg_set_sensor_trip_point *trip; - ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_SET, + ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_CONFIG, SCMI_PROTOCOL_SENSOR, sizeof(*trip), 0, &t); if (ret) return ret; @@ -255,8 +257,8 @@ static int scmi_sensor_count_get(const struct scmi_handle *handle) static struct scmi_sensor_ops sensor_ops = { .count_get = scmi_sensor_count_get, .info_get = scmi_sensor_info_get, - .configuration_set = scmi_sensor_configuration_set, - .trip_point_set = scmi_sensor_trip_point_set, + .trip_point_notify = scmi_sensor_trip_point_notify, + .trip_point_config = scmi_sensor_trip_point_config, .reading_get = scmi_sensor_reading_get, }; diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 9ff2e9357e9a..ea6b72018752 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -167,9 +167,9 @@ enum scmi_sensor_class { * * @count_get: get the count of sensors provided by SCMI * @info_get: get the information of the specified sensor - * @configuration_set: control notifications on cross-over events for + * @trip_point_notify: control notifications on cross-over events for * the trip-points - * @trip_point_set: selects and configures a trip-point of interest + * @trip_point_config: selects and configures a trip-point of interest * @reading_get: gets the current value of the sensor */ struct scmi_sensor_ops { @@ -177,10 +177,10 @@ struct scmi_sensor_ops { const struct scmi_sensor_info *(*info_get) (const struct scmi_handle *handle, u32 sensor_id); - int (*configuration_set)(const struct scmi_handle *handle, - u32 sensor_id); - int (*trip_point_set)(const struct scmi_handle *handle, u32 sensor_id, - u8 trip_id, u64 trip_value); + int (*trip_point_notify)(const struct scmi_handle *handle, + u32 sensor_id, bool enable); + int (*trip_point_config)(const struct scmi_handle *handle, + u32 sensor_id, u8 trip_id, u64 trip_value); int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id, bool async, u64 *value); };