aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-04-17 06:44:35 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-19 05:50:52 -0400
commit56a263aaa0a5f58d70517fae2bdd63fc1e17efec (patch)
tree12804cdac321eb61783ac32901cf13fbeabf0a3e
parentee0fe833d96793853335844b6d99fb76bd12cbeb (diff)
[media] cec: Kconfig cleanup
The Kconfig options for the CEC subsystem were a bit messy. In addition there were two cec sources (cec-edid.c and cec-notifier.c) that were outside of the media/cec directory, which was weird. Move those sources to media/cec as well. The cec-edid and cec-notifier functionality is now part of the cec module and these are no longer separate modules. Also remove the MEDIA_CEC_EDID config option and include it with the main CEC config option (which defined CEC_EDID anyway). Added static inlines to cec-edid.h for dummy functions when CEC_CORE isn't defined. CEC drivers should now depend on CEC_CORE. CEC drivers that need the cec-notifier functionality must explicitly select CEC_NOTIFIER. The s5p-cec and stih-cec drivers depended on VIDEO_DEV instead of CEC_CORE, fix that as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--MAINTAINERS2
-rw-r--r--drivers/media/Kconfig26
-rw-r--r--drivers/media/Makefile14
-rw-r--r--drivers/media/cec/Kconfig13
-rw-r--r--drivers/media/cec/Makefile8
-rw-r--r--drivers/media/cec/cec-edid.c (renamed from drivers/media/cec-edid.c)4
-rw-r--r--drivers/media/cec/cec-notifier.c (renamed from drivers/media/cec-notifier.c)0
-rw-r--r--drivers/media/i2c/Kconfig9
-rw-r--r--drivers/media/platform/Kconfig56
-rw-r--r--drivers/media/platform/vivid/Kconfig3
-rw-r--r--drivers/media/usb/pulse8-cec/Kconfig2
-rw-r--r--drivers/media/usb/rainshadow-cec/Kconfig2
-rw-r--r--include/media/cec-edid.h29
-rw-r--r--include/media/cec.h2
14 files changed, 91 insertions, 79 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 6919a495bdad..cf0101544a08 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3075,8 +3075,6 @@ S: Supported
3075F: Documentation/media/kapi/cec-core.rst 3075F: Documentation/media/kapi/cec-core.rst
3076F: Documentation/media/uapi/cec 3076F: Documentation/media/uapi/cec
3077F: drivers/media/cec/ 3077F: drivers/media/cec/
3078F: drivers/media/cec-edid.c
3079F: drivers/media/cec-notifier.c
3080F: drivers/media/rc/keymaps/rc-cec.c 3078F: drivers/media/rc/keymaps/rc-cec.c
3081F: include/media/cec.h 3079F: include/media/cec.h
3082F: include/media/cec-edid.h 3080F: include/media/cec-edid.h
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 9e9ded44e8a8..b72edd27f880 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -81,27 +81,15 @@ config MEDIA_RC_SUPPORT
81 Say Y when you have a TV or an IR device. 81 Say Y when you have a TV or an IR device.
82 82
83config MEDIA_CEC_SUPPORT 83config MEDIA_CEC_SUPPORT
84 bool "HDMI CEC support" 84 bool "HDMI CEC support"
85 select MEDIA_CEC_EDID 85 ---help---
86 ---help--- 86 Enable support for HDMI CEC (Consumer Electronics Control),
87 Enable support for HDMI CEC (Consumer Electronics Control), 87 which is an optional HDMI feature.
88 which is an optional HDMI feature.
89
90 Say Y when you have an HDMI receiver, transmitter or a USB CEC
91 adapter that supports HDMI CEC.
92
93config MEDIA_CEC_DEBUG
94 bool "HDMI CEC debugfs interface"
95 depends on MEDIA_CEC_SUPPORT && DEBUG_FS
96 ---help---
97 Turns on the DebugFS interface for CEC devices.
98 88
99config MEDIA_CEC_EDID 89 Say Y when you have an HDMI receiver, transmitter or a USB CEC
100 bool 90 adapter that supports HDMI CEC.
101 91
102config MEDIA_CEC_NOTIFIER 92source "drivers/media/cec/Kconfig"
103 bool
104 select MEDIA_CEC_EDID
105 93
106# 94#
107# Media controller 95# Media controller
diff --git a/drivers/media/Makefile b/drivers/media/Makefile
index 8b36a571d443..523fea3648ad 100644
--- a/drivers/media/Makefile
+++ b/drivers/media/Makefile
@@ -2,20 +2,10 @@
2# Makefile for the kernel multimedia device drivers. 2# Makefile for the kernel multimedia device drivers.
3# 3#
4 4
5ifeq ($(CONFIG_MEDIA_CEC_EDID),y)
6 obj-$(CONFIG_MEDIA_SUPPORT) += cec-edid.o
7endif
8
9ifeq ($(CONFIG_MEDIA_CEC_NOTIFIER),y)
10 obj-$(CONFIG_MEDIA_SUPPORT) += cec-notifier.o
11endif
12
13ifeq ($(CONFIG_MEDIA_CEC_SUPPORT),y)
14 obj-$(CONFIG_MEDIA_SUPPORT) += cec/
15endif
16
17media-objs := media-device.o media-devnode.o media-entity.o 5media-objs := media-device.o media-devnode.o media-entity.o
18 6
7obj-$(CONFIG_CEC_CORE) += cec/
8
19# 9#
20# I2C drivers should come before other drivers, otherwise they'll fail 10# I2C drivers should come before other drivers, otherwise they'll fail
21# when compiled as builtin drivers 11# when compiled as builtin drivers
diff --git a/drivers/media/cec/Kconfig b/drivers/media/cec/Kconfig
new file mode 100644
index 000000000000..24b53187ee52
--- /dev/null
+++ b/drivers/media/cec/Kconfig
@@ -0,0 +1,13 @@
1config CEC_CORE
2 tristate
3 depends on MEDIA_CEC_SUPPORT
4 default y
5
6config MEDIA_CEC_NOTIFIER
7 bool
8
9config MEDIA_CEC_DEBUG
10 bool "HDMI CEC debugfs interface"
11 depends on MEDIA_CEC_SUPPORT && DEBUG_FS
12 ---help---
13 Turns on the DebugFS interface for CEC devices.
diff --git a/drivers/media/cec/Makefile b/drivers/media/cec/Makefile
index d6686337275f..402a6c62a3e8 100644
--- a/drivers/media/cec/Makefile
+++ b/drivers/media/cec/Makefile
@@ -1,5 +1,7 @@
1cec-objs := cec-core.o cec-adap.o cec-api.o 1cec-objs := cec-core.o cec-adap.o cec-api.o cec-edid.o
2 2
3ifeq ($(CONFIG_MEDIA_CEC_SUPPORT),y) 3ifeq ($(CONFIG_MEDIA_CEC_NOTIFIER),y)
4 obj-$(CONFIG_MEDIA_SUPPORT) += cec.o 4 cec-objs += cec-notifier.o
5endif 5endif
6
7obj-$(CONFIG_CEC_CORE) += cec.o
diff --git a/drivers/media/cec-edid.c b/drivers/media/cec/cec-edid.c
index 5719b991e340..c63dc81d2a29 100644
--- a/drivers/media/cec-edid.c
+++ b/drivers/media/cec/cec-edid.c
@@ -165,7 +165,3 @@ int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port)
165 return 0; 165 return 0;
166} 166}
167EXPORT_SYMBOL_GPL(cec_phys_addr_validate); 167EXPORT_SYMBOL_GPL(cec_phys_addr_validate);
168
169MODULE_AUTHOR("Hans Verkuil <hans.verkuil@cisco.com>");
170MODULE_DESCRIPTION("CEC EDID helper functions");
171MODULE_LICENSE("GPL");
diff --git a/drivers/media/cec-notifier.c b/drivers/media/cec/cec-notifier.c
index 5f5209a73665..5f5209a73665 100644
--- a/drivers/media/cec-notifier.c
+++ b/drivers/media/cec/cec-notifier.c
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index b358d1a40688..40bb4bdc51da 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -209,7 +209,6 @@ config VIDEO_ADV7604
209 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API 209 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
210 depends on GPIOLIB || COMPILE_TEST 210 depends on GPIOLIB || COMPILE_TEST
211 select HDMI 211 select HDMI
212 select MEDIA_CEC_EDID
213 ---help--- 212 ---help---
214 Support for the Analog Devices ADV7604 video decoder. 213 Support for the Analog Devices ADV7604 video decoder.
215 214
@@ -221,7 +220,7 @@ config VIDEO_ADV7604
221 220
222config VIDEO_ADV7604_CEC 221config VIDEO_ADV7604_CEC
223 bool "Enable Analog Devices ADV7604 CEC support" 222 bool "Enable Analog Devices ADV7604 CEC support"
224 depends on VIDEO_ADV7604 && MEDIA_CEC_SUPPORT 223 depends on VIDEO_ADV7604 && CEC_CORE
225 ---help--- 224 ---help---
226 When selected the adv7604 will support the optional 225 When selected the adv7604 will support the optional
227 HDMI CEC feature. 226 HDMI CEC feature.
@@ -230,7 +229,6 @@ config VIDEO_ADV7842
230 tristate "Analog Devices ADV7842 decoder" 229 tristate "Analog Devices ADV7842 decoder"
231 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API 230 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
232 select HDMI 231 select HDMI
233 select MEDIA_CEC_EDID
234 ---help--- 232 ---help---
235 Support for the Analog Devices ADV7842 video decoder. 233 Support for the Analog Devices ADV7842 video decoder.
236 234
@@ -242,7 +240,7 @@ config VIDEO_ADV7842
242 240
243config VIDEO_ADV7842_CEC 241config VIDEO_ADV7842_CEC
244 bool "Enable Analog Devices ADV7842 CEC support" 242 bool "Enable Analog Devices ADV7842 CEC support"
245 depends on VIDEO_ADV7842 && MEDIA_CEC_SUPPORT 243 depends on VIDEO_ADV7842 && CEC_CORE
246 ---help--- 244 ---help---
247 When selected the adv7842 will support the optional 245 When selected the adv7842 will support the optional
248 HDMI CEC feature. 246 HDMI CEC feature.
@@ -470,7 +468,6 @@ config VIDEO_ADV7511
470 tristate "Analog Devices ADV7511 encoder" 468 tristate "Analog Devices ADV7511 encoder"
471 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API 469 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
472 select HDMI 470 select HDMI
473 select MEDIA_CEC_EDID
474 ---help--- 471 ---help---
475 Support for the Analog Devices ADV7511 video encoder. 472 Support for the Analog Devices ADV7511 video encoder.
476 473
@@ -481,7 +478,7 @@ config VIDEO_ADV7511
481 478
482config VIDEO_ADV7511_CEC 479config VIDEO_ADV7511_CEC
483 bool "Enable Analog Devices ADV7511 CEC support" 480 bool "Enable Analog Devices ADV7511 CEC support"
484 depends on VIDEO_ADV7511 && MEDIA_CEC_SUPPORT 481 depends on VIDEO_ADV7511 && CEC_CORE
485 ---help--- 482 ---help---
486 When selected the adv7511 will support the optional 483 When selected the adv7511 will support the optional
487 HDMI CEC feature. 484 HDMI CEC feature.
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 73c3bc5deadf..ac026ee1ca07 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -461,34 +461,6 @@ config VIDEO_TI_SC
461config VIDEO_TI_CSC 461config VIDEO_TI_CSC
462 tristate 462 tristate
463 463
464menuconfig V4L_CEC_DRIVERS
465 bool "Platform HDMI CEC drivers"
466 depends on MEDIA_CEC_SUPPORT
467
468if V4L_CEC_DRIVERS
469
470config VIDEO_SAMSUNG_S5P_CEC
471 tristate "Samsung S5P CEC driver"
472 depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || ARCH_EXYNOS || COMPILE_TEST)
473 select MEDIA_CEC_NOTIFIER
474 ---help---
475 This is a driver for Samsung S5P HDMI CEC interface. It uses the
476 generic CEC framework interface.
477 CEC bus is present in the HDMI connector and enables communication
478 between compatible devices.
479
480config VIDEO_STI_HDMI_CEC
481 tristate "STMicroelectronics STiH4xx HDMI CEC driver"
482 depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_STI || COMPILE_TEST)
483 select MEDIA_CEC_NOTIFIER
484 ---help---
485 This is a driver for STIH4xx HDMI CEC interface. It uses the
486 generic CEC framework interface.
487 CEC bus is present in the HDMI connector and enables communication
488 between compatible devices.
489
490endif #V4L_CEC_DRIVERS
491
492menuconfig V4L_TEST_DRIVERS 464menuconfig V4L_TEST_DRIVERS
493 bool "Media test drivers" 465 bool "Media test drivers"
494 depends on MEDIA_CAMERA_SUPPORT 466 depends on MEDIA_CAMERA_SUPPORT
@@ -520,3 +492,31 @@ menuconfig DVB_PLATFORM_DRIVERS
520if DVB_PLATFORM_DRIVERS 492if DVB_PLATFORM_DRIVERS
521source "drivers/media/platform/sti/c8sectpfe/Kconfig" 493source "drivers/media/platform/sti/c8sectpfe/Kconfig"
522endif #DVB_PLATFORM_DRIVERS 494endif #DVB_PLATFORM_DRIVERS
495
496menuconfig CEC_PLATFORM_DRIVERS
497 bool "CEC platform devices"
498 depends on MEDIA_CEC_SUPPORT
499
500if CEC_PLATFORM_DRIVERS
501
502config VIDEO_SAMSUNG_S5P_CEC
503 tristate "Samsung S5P CEC driver"
504 depends on CEC_CORE && (PLAT_S5P || ARCH_EXYNOS || COMPILE_TEST)
505 select MEDIA_CEC_NOTIFIER
506 ---help---
507 This is a driver for Samsung S5P HDMI CEC interface. It uses the
508 generic CEC framework interface.
509 CEC bus is present in the HDMI connector and enables communication
510 between compatible devices.
511
512config VIDEO_STI_HDMI_CEC
513 tristate "STMicroelectronics STiH4xx HDMI CEC driver"
514 depends on CEC_CORE && (ARCH_STI || COMPILE_TEST)
515 select MEDIA_CEC_NOTIFIER
516 ---help---
517 This is a driver for STIH4xx HDMI CEC interface. It uses the
518 generic CEC framework interface.
519 CEC bus is present in the HDMI connector and enables communication
520 between compatible devices.
521
522endif #CEC_PLATFORM_DRIVERS
diff --git a/drivers/media/platform/vivid/Kconfig b/drivers/media/platform/vivid/Kconfig
index 94ab1364a792..b36ac19dc6e4 100644
--- a/drivers/media/platform/vivid/Kconfig
+++ b/drivers/media/platform/vivid/Kconfig
@@ -7,7 +7,6 @@ config VIDEO_VIVID
7 select FB_CFB_FILLRECT 7 select FB_CFB_FILLRECT
8 select FB_CFB_COPYAREA 8 select FB_CFB_COPYAREA
9 select FB_CFB_IMAGEBLIT 9 select FB_CFB_IMAGEBLIT
10 select MEDIA_CEC_EDID
11 select VIDEOBUF2_VMALLOC 10 select VIDEOBUF2_VMALLOC
12 select VIDEOBUF2_DMA_CONTIG 11 select VIDEOBUF2_DMA_CONTIG
13 select VIDEO_V4L2_TPG 12 select VIDEO_V4L2_TPG
@@ -27,7 +26,7 @@ config VIDEO_VIVID
27 26
28config VIDEO_VIVID_CEC 27config VIDEO_VIVID_CEC
29 bool "Enable CEC emulation support" 28 bool "Enable CEC emulation support"
30 depends on VIDEO_VIVID && MEDIA_CEC_SUPPORT 29 depends on VIDEO_VIVID && CEC_CORE
31 ---help--- 30 ---help---
32 When selected the vivid module will emulate the optional 31 When selected the vivid module will emulate the optional
33 HDMI CEC feature. 32 HDMI CEC feature.
diff --git a/drivers/media/usb/pulse8-cec/Kconfig b/drivers/media/usb/pulse8-cec/Kconfig
index 6ffc407de62f..8937f3986a01 100644
--- a/drivers/media/usb/pulse8-cec/Kconfig
+++ b/drivers/media/usb/pulse8-cec/Kconfig
@@ -1,6 +1,6 @@
1config USB_PULSE8_CEC 1config USB_PULSE8_CEC
2 tristate "Pulse Eight HDMI CEC" 2 tristate "Pulse Eight HDMI CEC"
3 depends on USB_ACM && MEDIA_CEC_SUPPORT 3 depends on USB_ACM && CEC_CORE
4 select SERIO 4 select SERIO
5 select SERIO_SERPORT 5 select SERIO_SERPORT
6 ---help--- 6 ---help---
diff --git a/drivers/media/usb/rainshadow-cec/Kconfig b/drivers/media/usb/rainshadow-cec/Kconfig
index 447291b3cca3..3eb86607efb8 100644
--- a/drivers/media/usb/rainshadow-cec/Kconfig
+++ b/drivers/media/usb/rainshadow-cec/Kconfig
@@ -1,6 +1,6 @@
1config USB_RAINSHADOW_CEC 1config USB_RAINSHADOW_CEC
2 tristate "RainShadow Tech HDMI CEC" 2 tristate "RainShadow Tech HDMI CEC"
3 depends on USB_ACM && MEDIA_CEC_SUPPORT 3 depends on USB_ACM && CEC_CORE
4 select SERIO 4 select SERIO
5 select SERIO_SERPORT 5 select SERIO_SERPORT
6 ---help--- 6 ---help---
diff --git a/include/media/cec-edid.h b/include/media/cec-edid.h
index bdf731ecba1a..242781fd377f 100644
--- a/include/media/cec-edid.h
+++ b/include/media/cec-edid.h
@@ -26,6 +26,8 @@
26#define cec_phys_addr_exp(pa) \ 26#define cec_phys_addr_exp(pa) \
27 ((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf 27 ((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
28 28
29#if IS_ENABLED(CONFIG_CEC_CORE)
30
29/** 31/**
30 * cec_get_edid_phys_addr() - find and return the physical address 32 * cec_get_edid_phys_addr() - find and return the physical address
31 * 33 *
@@ -101,4 +103,31 @@ u16 cec_phys_addr_for_input(u16 phys_addr, u8 input);
101 */ 103 */
102int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port); 104int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port);
103 105
106#else
107
108static inline u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
109 unsigned int *offset)
110{
111 if (offset)
112 *offset = 0;
113 return CEC_PHYS_ADDR_INVALID;
114}
115
116static inline void cec_set_edid_phys_addr(u8 *edid, unsigned int size,
117 u16 phys_addr)
118{
119}
120
121static inline u16 cec_phys_addr_for_input(u16 phys_addr, u8 input)
122{
123 return CEC_PHYS_ADDR_INVALID;
124}
125
126static inline int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port)
127{
128 return 0;
129}
130
131#endif
132
104#endif /* _MEDIA_CEC_EDID_H */ 133#endif /* _MEDIA_CEC_EDID_H */
diff --git a/include/media/cec.h b/include/media/cec.h
index b313e3ecab70..bae8d0153de7 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -204,7 +204,7 @@ static inline bool cec_is_sink(const struct cec_adapter *adap)
204 return adap->phys_addr == 0; 204 return adap->phys_addr == 0;
205} 205}
206 206
207#if IS_ENABLED(CONFIG_MEDIA_CEC_SUPPORT) 207#if IS_ENABLED(CONFIG_CEC_CORE)
208struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, 208struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
209 void *priv, const char *name, u32 caps, u8 available_las); 209 void *priv, const char *name, u32 caps, u8 available_las);
210int cec_register_adapter(struct cec_adapter *adap, struct device *parent); 210int cec_register_adapter(struct cec_adapter *adap, struct device *parent);