From patchwork Tue Nov 22 17:03:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 83451 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp2260324obn; Tue, 22 Nov 2016 09:09:40 -0800 (PST) X-Received: by 10.99.232.21 with SMTP id s21mr46259383pgh.19.1479834580183; Tue, 22 Nov 2016 09:09:40 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si692334plb.309.2016.11.22.09.09.39; Tue, 22 Nov 2016 09:09:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755365AbcKVRJg (ORCPT + 9 others); Tue, 22 Nov 2016 12:09:36 -0500 Received: from mail-wj0-f169.google.com ([209.85.210.169]:34938 "EHLO mail-wj0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754592AbcKVRJf (ORCPT ); Tue, 22 Nov 2016 12:09:35 -0500 X-Greylist: delayed 355 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Nov 2016 12:09:35 EST Received: by mail-wj0-f169.google.com with SMTP id v7so45292799wjy.2 for ; Tue, 22 Nov 2016 09:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3jIp1iubM+Zh9E+MNsKChNhWqkhcpCjJUknCn1syR2Q=; b=IqI3aN+ghOnHU8BY08wEaYdT8+sRl4aNFWU6FGVFCLjtWMzBNGd3064uVocIWGfE/e quTGciWTxVqdsW+MjxUYfLRw/xmJ+zZ+9ESeHue8SE/VIaOaDE9tFhVbugVLo8llxURj rLcQ9tb4gl7tHhvnni4Vtlhkq+8cKJ/G+dIHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3jIp1iubM+Zh9E+MNsKChNhWqkhcpCjJUknCn1syR2Q=; b=R/ADgNeKMHlW/NLzmKnM921FsOChhBWVgNcOH8QZsAxyf0yImfg9RrVvCQAJJ1kJl2 Xar+YIU8qX0VvpUSSJAIXagsnT53+SVKpVep+otfd7e20X6XXDVM6YTsW2MenxaKpEqX IV3pkOiHCNKP52QrYYoh00sKr4KPEbADZwlFFa9x7hJBuUzJsEa0Y7cYJyXV4VqgZmLF H466MoFVZREA1X4FRrUcCzAJMLVLb/nj7A5+l5NJ1B9SSKpNXwBriW6lfrZUk1q6kNV8 v/vSHveRxSjw98UyvnA38KDqb8nxRysdpEvrg0Z8nci1vKDbwNhcdBNyYfImxqWHblMq SyJg== X-Gm-Message-State: AKaTC03jwuleyetZDuVXJPE7MqXXyLHxLrpWbJNec6PvJH0sd/bm0TBDdjvHd5Gqv2juCUS7 X-Received: by 10.194.52.8 with SMTP id p8mr14966586wjo.38.1479834197260; Tue, 22 Nov 2016 09:03:17 -0800 (PST) Received: from mms-0440.wifi.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id q65sm3946932wmd.6.2016.11.22.09.03.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 09:03:16 -0800 (PST) From: Stanimir Varbanov To: Andy Gross Cc: Bjorn Andersson , Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH 3/3] firmware: qcom: scm: Add empty functions to help compile testing Date: Tue, 22 Nov 2016 19:03:09 +0200 Message-Id: <1479834189-31649-1-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This will help to compile testing drivers which depends on scm functions with COMPILE_TEST Kconfig option. Signed-off-by: Stanimir Varbanov --- include/linux/qcom_scm.h | 53 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 16 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Stephen Boyd diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h index 2ece81a6b078..71b79ffa1a3b 100644 --- a/include/linux/qcom_scm.h +++ b/include/linux/qcom_scm.h @@ -13,9 +13,9 @@ #ifndef __QCOM_SCM_H #define __QCOM_SCM_H -extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus); -extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus); - +#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) +#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0 +#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1 #define QCOM_SCM_HDCP_MAX_REQ_CNT 5 struct qcom_scm_hdcp_req { @@ -23,29 +23,50 @@ struct qcom_scm_hdcp_req { u32 val; }; +#if IS_ENABLED(CONFIG_QCOM_SCM) +extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus); +extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus); extern bool qcom_scm_is_available(void); - extern bool qcom_scm_hdcp_available(void); extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, - u32 *resp); - + u32 *resp); extern bool qcom_scm_pas_supported(u32 peripheral); extern int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, - size_t size); + size_t size); extern int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, - phys_addr_t size); + phys_addr_t size); extern int qcom_scm_pas_auth_and_reset(u32 peripheral); extern int qcom_scm_pas_shutdown(u32 peripheral); - -#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0 -#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1 - extern void qcom_scm_cpu_power_down(u32 flags); - -#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) - extern u32 qcom_scm_get_version(void); - extern int qcom_scm_video_set_state(u32 state, u32 spare); +#else +static inline +int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus) +{ + return -ENODEV; +} +static inline +int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus) +{ + return -ENODEV; +} +static inline bool qcom_scm_is_available(void) { return false; } +static inline bool qcom_scm_hdcp_available(void) { return false; } +static inline int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, + u32 *resp) { return -ENODEV; } +static inline bool qcom_scm_pas_supported(u32 peripheral) { return false; } +static inline int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, + size_t size) { return -ENODEV; } +static inline int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, + phys_addr_t size) { return -ENODEV; } +static inline int +qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; } +static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; } +static inline void qcom_scm_cpu_power_down(u32 flags) {} +static inline u32 qcom_scm_get_version(void) { return 0; } +static inline int +qcom_scm_video_set_state(u32 state, u32 spare) { return -ENODEV; } +#endif #endif