From patchwork Mon Jul 8 15:47:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 168679 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp7331250ilk; Mon, 8 Jul 2019 08:47:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzL4a1g/HPQS7Wk4s8+C2bd7otuk83x3fsgciTQNa6oBE0VjZnGS1ojwpXCXUQDSnR6ti9n X-Received: by 2002:a17:90a:30aa:: with SMTP id h39mr26770258pjb.32.1562600877668; Mon, 08 Jul 2019 08:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562600877; cv=none; d=google.com; s=arc-20160816; b=N78qwX5TSffQnYR19hYe7BErRgdlUcC8FARZPlHqtH+7FN2Pp92IwDvRMmGc4FNzIB IxFTu3M+i/mNbYP35bf84/WXxnoGmSG9nvUkXdf0v0vWlSMduUEDpkTArjw3FjU3j1Tb uFIZkkly7jPnyI3IzT5bwpHdr0+4Agrh6cVsWZyw8sUQq9hHvsuG1CMlqQQ+yUM5FWFA Ng4KKGh3WTXHoCBa9pkuJkd/PkF035I3xqYX37tEOWcWhU17CX9sNsWTLapsg466L5E2 BaRGc1JEdW7KRo/RM1HyeRbtUbAu+UTAbl/15zJABAqiyssF1Anb9u/d/PmxID4P/Hzp YTlw== 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=hWVHrvg8mnc4KCnKydbF/kcrPYGf3kaxW2vh1Bg1glM=; b=XIF0DcGEPX39a+H0xWbi0bwi2UtVtJq8RPqNB4T0n5WIg8gjckdgm5VZ3I0S6v3f8y W6S4ScE/HjdMuWCSoxXKgrMMz096l2Otlrlt1PZqZaXc/GMHEMEhhL+k5jYZHPG/MSGb lTzuSEOU9GQtffPGbnVsgwelBVMpcoyGzYgmuf7PqKtQyDSXXLtGG0/Yrr3J5FDeKjpx fwW1t1rVBix3JWWoanzRez/Yik1Vo3A1zqwThs2+j3hCE/FZv2HieOP2WaACFcugXOlz OA0GoGC/C7WLdRmo2foTLatu5sG0fEN7pRqyRX6poLUufpw5d2xi7HU+I5d9OElnnglf Mbcw== 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 f74si19378230pfa.57.2019.07.08.08.47.57; Mon, 08 Jul 2019 08:47:57 -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 S2391361AbfGHPrz (ORCPT + 30 others); Mon, 8 Jul 2019 11:47:55 -0400 Received: from foss.arm.com ([217.140.110.172]:52400 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391330AbfGHPrw (ORCPT ); Mon, 8 Jul 2019 11:47:52 -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 5BF301516; Mon, 8 Jul 2019 08:47:51 -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 22E9F3F59C; Mon, 8 Jul 2019 08:47:50 -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 , Guenter Roeck , linux-hwmon@vger.kernel.org Subject: [PATCH 08/11] firmware: arm_scmi: Drop async flag in sensor_ops->reading_get Date: Mon, 8 Jul 2019 16:47:27 +0100 Message-Id: <20190708154730.16643-9-sudeep.holla@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708154730.16643-1-sudeep.holla@arm.com> References: <20190708154730.16643-1-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SENSOR_DESCRIPTION_GET provides attributes to indicate if the sensor supports asynchronous read. Ideally we should be able to read that flag and use asynchronous reads for any sensors with that attribute set. In order to add that support, let's drop the async flag passed to sensor_ops->reading_get and dynamically switch between sync and async flags based on the attributes as provided by the firmware. Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/sensors.c | 4 ++-- drivers/hwmon/scmi-hwmon.c | 2 +- include/linux/scmi_protocol.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 Acked-by: Guenter Roeck diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c index 17dbabd8a94a..1b5757c77a35 100644 --- a/drivers/firmware/arm_scmi/sensors.c +++ b/drivers/firmware/arm_scmi/sensors.c @@ -211,7 +211,7 @@ scmi_sensor_trip_point_config(const struct scmi_handle *handle, u32 sensor_id, } static int scmi_sensor_reading_get(const struct scmi_handle *handle, - u32 sensor_id, bool async, u64 *value) + u32 sensor_id, u64 *value) { int ret; struct scmi_xfer *t; @@ -225,7 +225,7 @@ static int scmi_sensor_reading_get(const struct scmi_handle *handle, sensor = t->tx.buf; sensor->id = cpu_to_le32(sensor_id); - sensor->flags = cpu_to_le32(async ? SENSOR_READ_ASYNC : 0); + sensor->flags = cpu_to_le32(0); ret = scmi_do_xfer(handle, t); if (!ret) { diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c index 0c93fc5ca762..8a7732c0bef3 100644 --- a/drivers/hwmon/scmi-hwmon.c +++ b/drivers/hwmon/scmi-hwmon.c @@ -72,7 +72,7 @@ static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type, const struct scmi_handle *h = scmi_sensors->handle; sensor = *(scmi_sensors->info[type] + channel); - ret = h->sensor_ops->reading_get(h, sensor->id, false, &value); + ret = h->sensor_ops->reading_get(h, sensor->id, &value); if (ret) return ret; diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index ea6b72018752..697e30fb9004 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -182,7 +182,7 @@ struct scmi_sensor_ops { 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); + u64 *value); }; /**