]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/msm/dp: move I/O functions to global header
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 18 May 2025 11:21:37 +0000 (14:21 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fri, 4 Jul 2025 13:35:18 +0000 (16:35 +0300)
Move msm_dp_read()/msm_write_foo() functions to the dp_catalog.h,
allowing other modules to access the data directly.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Stephen Boyd <swboyd@chromium.org> # sc7180-trogdor
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/654318/
Link: https://lore.kernel.org/r/20250518-fd-dp-audio-fixup-v6-4-2f0ec3ec000d@oss.qualcomm.com
drivers/gpu/drm/msm/dp/dp_catalog.c
drivers/gpu/drm/msm/dp/dp_catalog.h

index 74ab86035f3b98b498756673229218558b6713c3..a22efb1e83d04cc5c9bc768a275df9cfb4752a2f 100644 (file)
@@ -81,71 +81,6 @@ void msm_dp_catalog_snapshot(struct msm_dp_catalog *msm_dp_catalog, struct msm_d
                                    msm_dp_catalog->p0_len, msm_dp_catalog->p0_base, "dp_p0");
 }
 
-static inline u32 msm_dp_read_aux(struct msm_dp_catalog *msm_dp_catalog, u32 offset)
-{
-       return readl_relaxed(msm_dp_catalog->aux_base + offset);
-}
-
-static inline void msm_dp_write_aux(struct msm_dp_catalog *msm_dp_catalog,
-                              u32 offset, u32 data)
-{
-       /*
-        * To make sure aux reg writes happens before any other operation,
-        * this function uses writel() instread of writel_relaxed()
-        */
-       writel(data, msm_dp_catalog->aux_base + offset);
-}
-
-static inline u32 msm_dp_read_ahb(const struct msm_dp_catalog *msm_dp_catalog, u32 offset)
-{
-       return readl_relaxed(msm_dp_catalog->ahb_base + offset);
-}
-
-static inline void msm_dp_write_ahb(struct msm_dp_catalog *msm_dp_catalog,
-                              u32 offset, u32 data)
-{
-       /*
-        * To make sure phy reg writes happens before any other operation,
-        * this function uses writel() instread of writel_relaxed()
-        */
-       writel(data, msm_dp_catalog->ahb_base + offset);
-}
-
-static inline void msm_dp_write_p0(struct msm_dp_catalog *msm_dp_catalog,
-                              u32 offset, u32 data)
-{
-       /*
-        * To make sure interface reg writes happens before any other operation,
-        * this function uses writel() instread of writel_relaxed()
-        */
-       writel(data, msm_dp_catalog->p0_base + offset);
-}
-
-static inline u32 msm_dp_read_p0(struct msm_dp_catalog *msm_dp_catalog,
-                              u32 offset)
-{
-       /*
-        * To make sure interface reg writes happens before any other operation,
-        * this function uses writel() instread of writel_relaxed()
-        */
-       return readl_relaxed(msm_dp_catalog->p0_base + offset);
-}
-
-static inline u32 msm_dp_read_link(struct msm_dp_catalog *msm_dp_catalog, u32 offset)
-{
-       return readl_relaxed(msm_dp_catalog->link_base + offset);
-}
-
-static inline void msm_dp_write_link(struct msm_dp_catalog *msm_dp_catalog,
-                              u32 offset, u32 data)
-{
-       /*
-        * To make sure link reg writes happens before any other operation,
-        * this function uses writel() instread of writel_relaxed()
-        */
-       writel(data, msm_dp_catalog->link_base + offset);
-}
-
 /* aux related catalog functions */
 u32 msm_dp_catalog_aux_read_data(struct msm_dp_catalog *msm_dp_catalog)
 {
index 5a757671d7310b43e7ca0155ffdc276c83d1e8bc..10fd0086132092be88bb698e53124f87a906de70 100644 (file)
@@ -48,6 +48,68 @@ struct msm_dp_catalog {
        size_t p0_len;
 };
 
+/* IO */
+static inline u32 msm_dp_read_aux(struct msm_dp_catalog *msm_dp_catalog, u32 offset)
+{
+       return readl_relaxed(msm_dp_catalog->aux_base + offset);
+}
+
+static inline void msm_dp_write_aux(struct msm_dp_catalog *msm_dp_catalog,
+                              u32 offset, u32 data)
+{
+       /*
+        * To make sure aux reg writes happens before any other operation,
+        * this function uses writel() instread of writel_relaxed()
+        */
+       writel(data, msm_dp_catalog->aux_base + offset);
+}
+
+static inline u32 msm_dp_read_ahb(const struct msm_dp_catalog *msm_dp_catalog, u32 offset)
+{
+       return readl_relaxed(msm_dp_catalog->ahb_base + offset);
+}
+
+static inline void msm_dp_write_ahb(struct msm_dp_catalog *msm_dp_catalog,
+                              u32 offset, u32 data)
+{
+       /*
+        * To make sure phy reg writes happens before any other operation,
+        * this function uses writel() instread of writel_relaxed()
+        */
+       writel(data, msm_dp_catalog->ahb_base + offset);
+}
+
+static inline void msm_dp_write_p0(struct msm_dp_catalog *msm_dp_catalog,
+                              u32 offset, u32 data)
+{
+       /*
+        * To make sure interface reg writes happens before any other operation,
+        * this function uses writel() instread of writel_relaxed()
+        */
+       writel(data, msm_dp_catalog->p0_base + offset);
+}
+
+static inline u32 msm_dp_read_p0(struct msm_dp_catalog *msm_dp_catalog,
+                              u32 offset)
+{
+       return readl_relaxed(msm_dp_catalog->p0_base + offset);
+}
+
+static inline u32 msm_dp_read_link(struct msm_dp_catalog *msm_dp_catalog, u32 offset)
+{
+       return readl_relaxed(msm_dp_catalog->link_base + offset);
+}
+
+static inline void msm_dp_write_link(struct msm_dp_catalog *msm_dp_catalog,
+                              u32 offset, u32 data)
+{
+       /*
+        * To make sure link reg writes happens before any other operation,
+        * this function uses writel() instread of writel_relaxed()
+        */
+       writel(data, msm_dp_catalog->link_base + offset);
+}
+
 /* Debug module */
 void msm_dp_catalog_snapshot(struct msm_dp_catalog *msm_dp_catalog, struct msm_disp_state *disp_state);