From patchwork Tue Aug 5 01:31:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 4674291 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D5C06C033A for ; Tue, 5 Aug 2014 01:33:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AAE920160 for ; Tue, 5 Aug 2014 01:33:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39FCB2014A for ; Tue, 5 Aug 2014 01:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbaHEBda (ORCPT ); Mon, 4 Aug 2014 21:33:30 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:42802 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbaHEBdZ (ORCPT ); Mon, 4 Aug 2014 21:33:25 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 49D6513F998; Tue, 5 Aug 2014 01:33:25 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 3979C13F996; Tue, 5 Aug 2014 01:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 845C113F998; Tue, 5 Aug 2014 01:33:24 +0000 (UTC) From: Stephen Boyd To: David Brown , Kumar Gala Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lina Iyer Subject: [PATCH 6/8] msm: scm: Add a feat version query API Date: Mon, 4 Aug 2014 18:31:48 -0700 Message-Id: <1407202310-3359-7-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 1.9.0.1.gd5ccf8c In-Reply-To: <1407202310-3359-1-git-send-email-sboyd@codeaurora.org> References: <1407202310-3359-1-git-send-email-sboyd@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some users of SCM need to detect features and also detect if those features have certain versions available. Add this API. Signed-off-by: Stephen Boyd --- arch/arm/mach-qcom/scm.c | 13 +++++++++++++ arch/arm/mach-qcom/scm.h | 1 + 2 files changed, 14 insertions(+) diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c index e80571f57ca4..7c62c03324f4 100644 --- a/arch/arm/mach-qcom/scm.c +++ b/arch/arm/mach-qcom/scm.c @@ -410,3 +410,16 @@ int scm_is_call_available(u32 svc_id, u32 cmd_id) return ret_val; } EXPORT_SYMBOL(scm_is_call_available); + +#define GET_FEAT_VERSION_CMD 3 +int scm_get_feat_version(u32 feat) +{ + if (scm_is_call_available(SCM_SVC_INFO, GET_FEAT_VERSION_CMD)) { + u32 version; + if (!scm_call(SCM_SVC_INFO, GET_FEAT_VERSION_CMD, &feat, + sizeof(feat), &version, sizeof(version))) + return version; + } + return 0; +} +EXPORT_SYMBOL(scm_get_feat_version); diff --git a/arch/arm/mach-qcom/scm.h b/arch/arm/mach-qcom/scm.h index f94c7279616a..6348b08524e7 100644 --- a/arch/arm/mach-qcom/scm.h +++ b/arch/arm/mach-qcom/scm.h @@ -26,5 +26,6 @@ extern s32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2); extern u32 scm_get_version(void); extern int scm_is_call_available(u32 svc_id, u32 cmd_id); +extern int scm_get_feat_version(u32 feat); #endif