Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4418223pxf; Tue, 16 Mar 2021 13:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKyZiLUIuAg8fmU5YrVfH08ODyJJy+uKLNMJ5QwxsvsVsToTMzTLN+sXJoXp1eNneTuvFB X-Received: by 2002:a05:6402:1d92:: with SMTP id dk18mr37582168edb.161.1615924832253; Tue, 16 Mar 2021 13:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615924832; cv=none; d=google.com; s=arc-20160816; b=PfrPOIFQsYfjRjKuYpSCXbXBPUwLtSH5Gew16Qb5wwhPtvJaWAXGSnw/iSooYj+RpU O9uc8m+1bGD0Q9V1gtmlGblXSPgcUtgCfgq27bboy9P1DR07+ORGrzknugQSlNazpa8i ndC9S3zYww+o6lzMKX2Mdqe6cqtfrr3CjFM5zM+N8+8DIoatFVAmE5bF6yafK/yJMK7c VWmEDU5kzrvr7nQG5j8o1iGWZtivD410O4A+IO9lVkjDgMgkxUhrvEjMLHO8n5ZS6ZEP xwMg7UQ0l3W2VuPKBzUQSvzV6Dt6f3gXU+rcJwsNC+pJaRihpzr7OTCgRmvEwlvcUUtV vXQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=h0dnM7Dm2GGNOt7OvTrJ+9A53o1VnapkNGPwd1WmMU8=; b=HVFaQocjVZh6LMXwzXSqQ3YvmLbNdB2xGJ5qJTk7xeFGMl83BTyRW16Wm4xN9QFMcF TzEtT3D0+lzGJ1Km50EYA3PdhH7xEDghZ0+Qzu3WiGopFqXe6nwyF67J7VWeBEMKvBFa 3XUA69GqblE6hR4s4BJmaFW8sHIprjRplOIeaKi8YHzI9OKAasRfFt9fLMmZpgasNUX/ f1tZHT41lxIVWie2pXRlnSzXu8uJSwoRj3pnua/bOC6MB0LfonIp+KVYeHmkb0rwMZA+ sEf+weVyF+kbSErgqOlL/MbWO9aa2KFEWi2dP/ZLtoCPVMfFfodPo/1PzqIa4YXqDcFX zAsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y59si16697477ede.77.2021.03.16.13.00.09; Tue, 16 Mar 2021 13:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbhCPMw6 (ORCPT + 99 others); Tue, 16 Mar 2021 08:52:58 -0400 Received: from foss.arm.com ([217.140.110.172]:37964 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbhCPMuS (ORCPT ); Tue, 16 Mar 2021 08:50:18 -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 0C78A152F; Tue, 16 Mar 2021 05:50:17 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0DCBA3F792; Tue, 16 Mar 2021 05:50:14 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, lukasz.luba@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, thara.gopinath@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, cristian.marussi@arm.com Subject: [PATCH v7 26/38] firmware: arm_scmi: remove legacy scmi_sensor_ops protocol interface Date: Tue, 16 Mar 2021 12:48:51 +0000 Message-Id: <20210316124903.35011-27-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210316124903.35011-1-cristian.marussi@arm.com> References: <20210316124903.35011-1-cristian.marussi@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all the SCMI driver users have been migrated to the new interface remove the legacy interface and all the transient code. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/sensors.c | 82 ----------------------------- include/linux/scmi_protocol.h | 19 ------- 2 files changed, 101 deletions(-) diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c index ae9f727730c8..2f5b06135468 100644 --- a/drivers/firmware/arm_scmi/sensors.c +++ b/drivers/firmware/arm_scmi/sensors.c @@ -624,17 +624,6 @@ scmi_sensor_trip_point_config(const struct scmi_protocol_handle *ph, return ret; } -static int -__scmi_sensor_trip_point_config(const struct scmi_handle *handle, - u32 sensor_id, u8 trip_id, u64 trip_value) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_trip_point_config(ph, sensor_id, trip_id, - trip_value); -} - static int scmi_sensor_config_get(const struct scmi_protocol_handle *ph, u32 sensor_id, u32 *sensor_config) { @@ -660,15 +649,6 @@ static int scmi_sensor_config_get(const struct scmi_protocol_handle *ph, return ret; } -static int __scmi_sensor_config_get(const struct scmi_handle *handle, - u32 sensor_id, u32 *sensor_config) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_config_get(ph, sensor_id, sensor_config); -} - static int scmi_sensor_config_set(const struct scmi_protocol_handle *ph, u32 sensor_id, u32 sensor_config) { @@ -697,15 +677,6 @@ static int scmi_sensor_config_set(const struct scmi_protocol_handle *ph, return ret; } -static int __scmi_sensor_config_set(const struct scmi_handle *handle, - u32 sensor_id, u32 sensor_config) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_config_set(ph, sensor_id, sensor_config); -} - /** * scmi_sensor_reading_get - Read scalar sensor value * @ph: Protocol handle @@ -760,15 +731,6 @@ static int scmi_sensor_reading_get(const struct scmi_protocol_handle *ph, return ret; } -static int __scmi_sensor_reading_get(const struct scmi_handle *handle, - u32 sensor_id, u64 *value) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_reading_get(ph, sensor_id, value); -} - static inline void scmi_parse_sensor_readings(struct scmi_sensor_reading *out, const struct scmi_sensor_reading_resp *in) @@ -847,18 +809,6 @@ scmi_sensor_reading_get_timestamped(const struct scmi_protocol_handle *ph, return ret; } -static int -__scmi_sensor_reading_get_timestamped(const struct scmi_handle *handle, - u32 sensor_id, u8 count, - struct scmi_sensor_reading *readings) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_reading_get_timestamped(ph, sensor_id, count, - readings); -} - static const struct scmi_sensor_info * scmi_sensor_info_get(const struct scmi_protocol_handle *ph, u32 sensor_id) { @@ -867,15 +817,6 @@ scmi_sensor_info_get(const struct scmi_protocol_handle *ph, u32 sensor_id) return si->sensors + sensor_id; } -static const struct scmi_sensor_info * -__scmi_sensor_info_get(const struct scmi_handle *handle, u32 sensor_id) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_info_get(ph, sensor_id); -} - static int scmi_sensor_count_get(const struct scmi_protocol_handle *ph) { struct sensors_info *si = ph->get_priv(ph); @@ -883,24 +824,6 @@ static int scmi_sensor_count_get(const struct scmi_protocol_handle *ph) return si->num_sensors; } -static int __scmi_sensor_count_get(const struct scmi_handle *handle) -{ - const struct scmi_protocol_handle *ph = - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_SENSOR); - - return scmi_sensor_count_get(ph); -} - -static const struct scmi_sensor_ops sensor_ops = { - .count_get = __scmi_sensor_count_get, - .info_get = __scmi_sensor_info_get, - .trip_point_config = __scmi_sensor_trip_point_config, - .reading_get = __scmi_sensor_reading_get, - .reading_get_timestamped = __scmi_sensor_reading_get_timestamped, - .config_get = __scmi_sensor_config_get, - .config_set = __scmi_sensor_config_set, -}; - static const struct scmi_sensor_proto_ops sensor_proto_ops = { .count_get = scmi_sensor_count_get, .info_get = scmi_sensor_info_get, @@ -1040,7 +963,6 @@ static int scmi_sensors_protocol_init(const struct scmi_protocol_handle *ph) u32 version; int ret; struct sensors_info *sinfo; - struct scmi_handle *handle; ph->xops->version_get(ph, &version); @@ -1064,10 +986,6 @@ static int scmi_sensors_protocol_init(const struct scmi_protocol_handle *ph) if (ret) return ret; - /* Transient code for legacy ops interface */ - handle = scmi_map_scmi_handle(ph); - handle->sensor_ops = &sensor_ops; - return ph->set_priv(ph, sinfo); } diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index ead06db7be18..3ec0ac30fe60 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -463,23 +463,6 @@ struct scmi_sensor_proto_ops { u32 sensor_id, u32 sensor_config); }; -struct scmi_sensor_ops { - int (*count_get)(const struct scmi_handle *handle); - const struct scmi_sensor_info *(*info_get) - (const struct scmi_handle *handle, u32 sensor_id); - 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, - u64 *value); - int (*reading_get_timestamped)(const struct scmi_handle *handle, - u32 sensor_id, u8 count, - struct scmi_sensor_reading *readings); - int (*config_get)(const struct scmi_handle *handle, - u32 sensor_id, u32 *sensor_config); - int (*config_set)(const struct scmi_handle *handle, - u32 sensor_id, u32 sensor_config); -}; - /** * struct scmi_reset_proto_ops - represents the various operations provided * by SCMI Reset Protocol @@ -622,7 +605,6 @@ struct scmi_notify_ops { * * @dev: pointer to the SCMI device * @version: pointer to the structure containing SCMI version information - * @sensor_ops: pointer to set of sensor protocol operations * @voltage_ops: pointer to set of voltage protocol operations * @devm_protocol_get: devres managed method to acquire a protocol and get specific * operations and a dedicated protocol handler @@ -636,7 +618,6 @@ struct scmi_notify_ops { struct scmi_handle { struct device *dev; struct scmi_revision_info *version; - const struct scmi_sensor_ops *sensor_ops; const struct scmi_voltage_ops *voltage_ops; const void __must_check * -- 2.17.1