Skip to content

Commit a272cad

Browse files
masahir0yrobertfoss
authored andcommitted
drm/bridge: imx: fix mixed module-builtin object
With CONFIG_DRM_IMX8QM_LDB=m and CONFIG_DRM_IMX8QXP_LDB=y (or vice versa), imx-ldb-helper.o is linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. This is the same situation as fixed by commit 637a642 ("zstd: Fixing mixed module-builtin objects"). Split imx-ldb-helper.c into a separate module. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Liu Ying <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent eba57fb commit a272cad

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

drivers/gpu/drm/bridge/imx/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
if ARCH_MXC || COMPILE_TEST
22

3+
config DRM_IMX_LDB_HELPER
4+
tristate
5+
36
config DRM_IMX8QM_LDB
47
tristate "Freescale i.MX8QM LVDS display bridge"
58
depends on OF
69
depends on COMMON_CLK
10+
select DRM_IMX_LDB_HELPER
711
select DRM_KMS_HELPER
812
help
913
Choose this to enable the internal LVDS Display Bridge(LDB) found in
@@ -13,6 +17,7 @@ config DRM_IMX8QXP_LDB
1317
tristate "Freescale i.MX8QXP LVDS display bridge"
1418
depends on OF
1519
depends on COMMON_CLK
20+
select DRM_IMX_LDB_HELPER
1621
select DRM_KMS_HELPER
1722
help
1823
Choose this to enable the internal LVDS Display Bridge(LDB) found in

drivers/gpu/drm/bridge/imx/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
imx8qm-ldb-objs := imx-ldb-helper.o imx8qm-ldb-drv.o
1+
obj-$(CONFIG_DRM_IMX_LDB_HELPER) += imx-ldb-helper.o
2+
imx8qm-ldb-objs := imx8qm-ldb-drv.o
23
obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o
34

4-
imx8qxp-ldb-objs := imx-ldb-helper.o imx8qxp-ldb-drv.o
5+
imx8qxp-ldb-objs := imx8qxp-ldb-drv.o
56
obj-$(CONFIG_DRM_IMX8QXP_LDB) += imx8qxp-ldb.o
67

78
obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o

drivers/gpu/drm/bridge/imx/imx-ldb-helper.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
* Copyright 2019,2020,2022 NXP
55
*/
66

7+
#include <linux/export.h>
78
#include <linux/media-bus-format.h>
89
#include <linux/mfd/syscon.h>
10+
#include <linux/module.h>
911
#include <linux/of.h>
1012
#include <linux/regmap.h>
1113

@@ -19,12 +21,14 @@ bool ldb_channel_is_single_link(struct ldb_channel *ldb_ch)
1921
{
2022
return ldb_ch->link_type == LDB_CH_SINGLE_LINK;
2123
}
24+
EXPORT_SYMBOL_GPL(ldb_channel_is_single_link);
2225

2326
bool ldb_channel_is_split_link(struct ldb_channel *ldb_ch)
2427
{
2528
return ldb_ch->link_type == LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS ||
2629
ldb_ch->link_type == LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS;
2730
}
31+
EXPORT_SYMBOL_GPL(ldb_channel_is_split_link);
2832

2933
int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge,
3034
struct drm_bridge_state *bridge_state,
@@ -38,6 +42,7 @@ int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge,
3842

3943
return 0;
4044
}
45+
EXPORT_SYMBOL_GPL(ldb_bridge_atomic_check_helper);
4146

4247
void ldb_bridge_mode_set_helper(struct drm_bridge *bridge,
4348
const struct drm_display_mode *mode,
@@ -69,6 +74,7 @@ void ldb_bridge_mode_set_helper(struct drm_bridge *bridge,
6974
break;
7075
}
7176
}
77+
EXPORT_SYMBOL_GPL(ldb_bridge_mode_set_helper);
7278

7379
void ldb_bridge_enable_helper(struct drm_bridge *bridge)
7480
{
@@ -81,6 +87,7 @@ void ldb_bridge_enable_helper(struct drm_bridge *bridge)
8187
*/
8288
regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl);
8389
}
90+
EXPORT_SYMBOL_GPL(ldb_bridge_enable_helper);
8491

8592
void ldb_bridge_disable_helper(struct drm_bridge *bridge)
8693
{
@@ -95,6 +102,7 @@ void ldb_bridge_disable_helper(struct drm_bridge *bridge)
95102

96103
regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl);
97104
}
105+
EXPORT_SYMBOL_GPL(ldb_bridge_disable_helper);
98106

99107
int ldb_bridge_attach_helper(struct drm_bridge *bridge,
100108
enum drm_bridge_attach_flags flags)
@@ -117,6 +125,7 @@ int ldb_bridge_attach_helper(struct drm_bridge *bridge,
117125
ldb_ch->next_bridge, bridge,
118126
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
119127
}
128+
EXPORT_SYMBOL_GPL(ldb_bridge_attach_helper);
120129

121130
int ldb_init_helper(struct ldb *ldb)
122131
{
@@ -157,6 +166,7 @@ int ldb_init_helper(struct ldb *ldb)
157166

158167
return 0;
159168
}
169+
EXPORT_SYMBOL_GPL(ldb_init_helper);
160170

161171
int ldb_find_next_bridge_helper(struct ldb *ldb)
162172
{
@@ -184,6 +194,7 @@ int ldb_find_next_bridge_helper(struct ldb *ldb)
184194

185195
return 0;
186196
}
197+
EXPORT_SYMBOL_GPL(ldb_find_next_bridge_helper);
187198

188199
void ldb_add_bridge_helper(struct ldb *ldb,
189200
const struct drm_bridge_funcs *bridge_funcs)
@@ -204,6 +215,7 @@ void ldb_add_bridge_helper(struct ldb *ldb,
204215
drm_bridge_add(&ldb_ch->bridge);
205216
}
206217
}
218+
EXPORT_SYMBOL_GPL(ldb_add_bridge_helper);
207219

208220
void ldb_remove_bridge_helper(struct ldb *ldb)
209221
{
@@ -219,3 +231,8 @@ void ldb_remove_bridge_helper(struct ldb *ldb)
219231
drm_bridge_remove(&ldb_ch->bridge);
220232
}
221233
}
234+
EXPORT_SYMBOL_GPL(ldb_remove_bridge_helper);
235+
236+
MODULE_DESCRIPTION("i.MX8 LVDS Display Bridge(LDB)/Pixel Mapper bridge helper");
237+
MODULE_AUTHOR("Liu Ying <[email protected]>");
238+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)