]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
firmware: tegra: Add stubs when BPMP not enabled
authorMikko Perttunen <mperttunen@nvidia.com>
Mon, 24 Jul 2017 16:29:17 +0000 (19:29 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 19 Oct 2017 14:27:56 +0000 (16:27 +0200)
Add static inline stubs to bpmp.h when CONFIG_BPMP is not enabled.
This allows building BPMP-related drivers with COMPILE_TEST.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
include/soc/tegra/bpmp.h

index b382ed01af09e1dbcd639fc83a782fc52ff893bd..1cf210504814a1975f83f29b685abe044a6f5a91 100644 (file)
@@ -96,9 +96,6 @@ struct tegra_bpmp {
        struct genpd_onecell_data genpd;
 };
 
-struct tegra_bpmp *tegra_bpmp_get(struct device *dev);
-void tegra_bpmp_put(struct tegra_bpmp *bpmp);
-
 struct tegra_bpmp_message {
        unsigned int mrq;
 
@@ -114,6 +111,9 @@ struct tegra_bpmp_message {
        } rx;
 };
 
+#if IS_ENABLED(CONFIG_TEGRA_BPMP)
+struct tegra_bpmp *tegra_bpmp_get(struct device *dev);
+void tegra_bpmp_put(struct tegra_bpmp *bpmp);
 int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp,
                               struct tegra_bpmp_message *msg);
 int tegra_bpmp_transfer(struct tegra_bpmp *bpmp,
@@ -125,6 +125,42 @@ int tegra_bpmp_request_mrq(struct tegra_bpmp *bpmp, unsigned int mrq,
                           tegra_bpmp_mrq_handler_t handler, void *data);
 void tegra_bpmp_free_mrq(struct tegra_bpmp *bpmp, unsigned int mrq,
                         void *data);
+#else
+static inline struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
+{
+       return ERR_PTR(-ENOTSUPP);
+}
+static inline void tegra_bpmp_put(struct tegra_bpmp *bpmp)
+{
+}
+static inline int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp,
+                                            struct tegra_bpmp_message *msg)
+{
+       return -ENOTSUPP;
+}
+static inline int tegra_bpmp_transfer(struct tegra_bpmp *bpmp,
+                                     struct tegra_bpmp_message *msg)
+{
+       return -ENOTSUPP;
+}
+static inline void tegra_bpmp_mrq_return(struct tegra_bpmp_channel *channel,
+                                        int code, const void *data,
+                                        size_t size)
+{
+}
+
+static inline int tegra_bpmp_request_mrq(struct tegra_bpmp *bpmp,
+                                        unsigned int mrq,
+                                        tegra_bpmp_mrq_handler_t handler,
+                                        void *data)
+{
+       return -ENOTSUPP;
+}
+static inline void tegra_bpmp_free_mrq(struct tegra_bpmp *bpmp,
+                                      unsigned int mrq, void *data)
+{
+}
+#endif
 
 #if IS_ENABLED(CONFIG_CLK_TEGRA_BPMP)
 int tegra_bpmp_init_clocks(struct tegra_bpmp *bpmp);