diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-07-01 06:33:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 17:34:00 -0400 |
commit | 5bb2399a4fe4a1703c1497b4838c5e8e869d0822 (patch) | |
tree | 7a253cb5c009c25e5074a07abc002b1ed9f39eb2 | |
parent | ea8c535e30c1066a0bf8acb2d39bb3c4e643a034 (diff) |
[media] cec: fix Kconfig dependency problems
- Use IS_REACHABLE(RC_CORE) instead of IS_ENABLED: if cec is built-in and
RC_CORE is a module, then CEC can't reach the RC symbols.
- Both cec and cec-edid should be bool and use the same build 'mode' as
MEDIA_SUPPORT (just as is done for the media controller code).
- Add a note to staging that this should be changed once the cec framework
is moved out of staging.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/Makefile | 4 | ||||
-rw-r--r-- | drivers/staging/media/cec/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/media/cec/Makefile | 4 | ||||
-rw-r--r-- | drivers/staging/media/cec/TODO | 5 | ||||
-rw-r--r-- | drivers/staging/media/cec/cec-adap.c | 4 | ||||
-rw-r--r-- | drivers/staging/media/cec/cec-core.c | 10 |
7 files changed, 20 insertions, 11 deletions
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index 052dcf77174b..962f2a9a6614 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig | |||
@@ -81,7 +81,7 @@ 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 | ||
83 | config MEDIA_CEC_EDID | 83 | config MEDIA_CEC_EDID |
84 | tristate | 84 | bool |
85 | 85 | ||
86 | # | 86 | # |
87 | # Media controller | 87 | # Media controller |
diff --git a/drivers/media/Makefile b/drivers/media/Makefile index b56f013b78c3..081a7866fd44 100644 --- a/drivers/media/Makefile +++ b/drivers/media/Makefile | |||
@@ -2,7 +2,9 @@ | |||
2 | # Makefile for the kernel multimedia device drivers. | 2 | # Makefile for the kernel multimedia device drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_MEDIA_CEC_EDID) += cec-edid.o | 5 | ifeq ($(CONFIG_MEDIA_CEC_EDID),y) |
6 | obj-$(CONFIG_MEDIA_SUPPORT) += cec-edid.o | ||
7 | endif | ||
6 | 8 | ||
7 | media-objs := media-device.o media-devnode.o media-entity.o | 9 | media-objs := media-device.o media-devnode.o media-entity.o |
8 | 10 | ||
diff --git a/drivers/staging/media/cec/Kconfig b/drivers/staging/media/cec/Kconfig index cd523590ea6f..21457a1f6c9f 100644 --- a/drivers/staging/media/cec/Kconfig +++ b/drivers/staging/media/cec/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | config MEDIA_CEC | 1 | config MEDIA_CEC |
2 | tristate "CEC API (EXPERIMENTAL)" | 2 | bool "CEC API (EXPERIMENTAL)" |
3 | depends on MEDIA_SUPPORT | 3 | depends on MEDIA_SUPPORT |
4 | select MEDIA_CEC_EDID | 4 | select MEDIA_CEC_EDID |
5 | ---help--- | 5 | ---help--- |
diff --git a/drivers/staging/media/cec/Makefile b/drivers/staging/media/cec/Makefile index 426ef73b959f..bd7f3c593468 100644 --- a/drivers/staging/media/cec/Makefile +++ b/drivers/staging/media/cec/Makefile | |||
@@ -1,3 +1,5 @@ | |||
1 | cec-objs := cec-core.o cec-adap.o cec-api.o | 1 | cec-objs := cec-core.o cec-adap.o cec-api.o |
2 | 2 | ||
3 | obj-$(CONFIG_MEDIA_CEC) += cec.o | 3 | ifeq ($(CONFIG_MEDIA_CEC),y) |
4 | obj-$(CONFIG_MEDIA_SUPPORT) += cec.o | ||
5 | endif | ||
diff --git a/drivers/staging/media/cec/TODO b/drivers/staging/media/cec/TODO index a8f4b7df38c8..8221d44f5c72 100644 --- a/drivers/staging/media/cec/TODO +++ b/drivers/staging/media/cec/TODO | |||
@@ -23,5 +23,10 @@ Other TODOs: | |||
23 | And also TYPE_SWITCH and TYPE_CDC_ONLY in addition to the TYPE_UNREGISTERED? | 23 | And also TYPE_SWITCH and TYPE_CDC_ONLY in addition to the TYPE_UNREGISTERED? |
24 | This should give the framework more information about the device type | 24 | This should give the framework more information about the device type |
25 | since SPECIFIC and UNREGISTERED give no useful information. | 25 | since SPECIFIC and UNREGISTERED give no useful information. |
26 | - Once this is out of staging this should no longer be a separate | ||
27 | config option, instead it should be selected by drivers that want it. | ||
28 | - Revisit the IS_REACHABLE(RC_CORE): perhaps the RC_CORE support should | ||
29 | be enabled through a separate config option in drivers/media/Kconfig | ||
30 | or rc/Kconfig? | ||
26 | 31 | ||
27 | Hans Verkuil <hans.verkuil@cisco.com> | 32 | Hans Verkuil <hans.verkuil@cisco.com> |
diff --git a/drivers/staging/media/cec/cec-adap.c b/drivers/staging/media/cec/cec-adap.c index 307af431aea7..7df61870473c 100644 --- a/drivers/staging/media/cec/cec-adap.c +++ b/drivers/staging/media/cec/cec-adap.c | |||
@@ -1456,7 +1456,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, | |||
1456 | if (!(adap->capabilities & CEC_CAP_RC)) | 1456 | if (!(adap->capabilities & CEC_CAP_RC)) |
1457 | break; | 1457 | break; |
1458 | 1458 | ||
1459 | #if IS_ENABLED(CONFIG_RC_CORE) | 1459 | #if IS_REACHABLE(CONFIG_RC_CORE) |
1460 | switch (msg->msg[2]) { | 1460 | switch (msg->msg[2]) { |
1461 | /* | 1461 | /* |
1462 | * Play function, this message can have variable length | 1462 | * Play function, this message can have variable length |
@@ -1492,7 +1492,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, | |||
1492 | case CEC_MSG_USER_CONTROL_RELEASED: | 1492 | case CEC_MSG_USER_CONTROL_RELEASED: |
1493 | if (!(adap->capabilities & CEC_CAP_RC)) | 1493 | if (!(adap->capabilities & CEC_CAP_RC)) |
1494 | break; | 1494 | break; |
1495 | #if IS_ENABLED(CONFIG_RC_CORE) | 1495 | #if IS_REACHABLE(CONFIG_RC_CORE) |
1496 | rc_keyup(adap->rc); | 1496 | rc_keyup(adap->rc); |
1497 | #endif | 1497 | #endif |
1498 | break; | 1498 | break; |
diff --git a/drivers/staging/media/cec/cec-core.c b/drivers/staging/media/cec/cec-core.c index 61a1e69a902a..112a5fae12f5 100644 --- a/drivers/staging/media/cec/cec-core.c +++ b/drivers/staging/media/cec/cec-core.c | |||
@@ -239,7 +239,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, | |||
239 | if (!(caps & CEC_CAP_RC)) | 239 | if (!(caps & CEC_CAP_RC)) |
240 | return adap; | 240 | return adap; |
241 | 241 | ||
242 | #if IS_ENABLED(CONFIG_RC_CORE) | 242 | #if IS_REACHABLE(CONFIG_RC_CORE) |
243 | /* Prepare the RC input device */ | 243 | /* Prepare the RC input device */ |
244 | adap->rc = rc_allocate_device(); | 244 | adap->rc = rc_allocate_device(); |
245 | if (!adap->rc) { | 245 | if (!adap->rc) { |
@@ -282,7 +282,7 @@ int cec_register_adapter(struct cec_adapter *adap) | |||
282 | if (IS_ERR_OR_NULL(adap)) | 282 | if (IS_ERR_OR_NULL(adap)) |
283 | return 0; | 283 | return 0; |
284 | 284 | ||
285 | #if IS_ENABLED(CONFIG_RC_CORE) | 285 | #if IS_REACHABLE(CONFIG_RC_CORE) |
286 | if (adap->capabilities & CEC_CAP_RC) { | 286 | if (adap->capabilities & CEC_CAP_RC) { |
287 | res = rc_register_device(adap->rc); | 287 | res = rc_register_device(adap->rc); |
288 | 288 | ||
@@ -298,7 +298,7 @@ int cec_register_adapter(struct cec_adapter *adap) | |||
298 | 298 | ||
299 | res = cec_devnode_register(&adap->devnode, adap->owner); | 299 | res = cec_devnode_register(&adap->devnode, adap->owner); |
300 | if (res) { | 300 | if (res) { |
301 | #if IS_ENABLED(CONFIG_RC_CORE) | 301 | #if IS_REACHABLE(CONFIG_RC_CORE) |
302 | /* Note: rc_unregister also calls rc_free */ | 302 | /* Note: rc_unregister also calls rc_free */ |
303 | rc_unregister_device(adap->rc); | 303 | rc_unregister_device(adap->rc); |
304 | adap->rc = NULL; | 304 | adap->rc = NULL; |
@@ -333,7 +333,7 @@ void cec_unregister_adapter(struct cec_adapter *adap) | |||
333 | if (IS_ERR_OR_NULL(adap)) | 333 | if (IS_ERR_OR_NULL(adap)) |
334 | return; | 334 | return; |
335 | 335 | ||
336 | #if IS_ENABLED(CONFIG_RC_CORE) | 336 | #if IS_REACHABLE(CONFIG_RC_CORE) |
337 | /* Note: rc_unregister also calls rc_free */ | 337 | /* Note: rc_unregister also calls rc_free */ |
338 | rc_unregister_device(adap->rc); | 338 | rc_unregister_device(adap->rc); |
339 | adap->rc = NULL; | 339 | adap->rc = NULL; |
@@ -353,7 +353,7 @@ void cec_delete_adapter(struct cec_adapter *adap) | |||
353 | kthread_stop(adap->kthread); | 353 | kthread_stop(adap->kthread); |
354 | if (adap->kthread_config) | 354 | if (adap->kthread_config) |
355 | kthread_stop(adap->kthread_config); | 355 | kthread_stop(adap->kthread_config); |
356 | #if IS_ENABLED(CONFIG_RC_CORE) | 356 | #if IS_REACHABLE(CONFIG_RC_CORE) |
357 | if (adap->rc) | 357 | if (adap->rc) |
358 | rc_free_device(adap->rc); | 358 | rc_free_device(adap->rc); |
359 | #endif | 359 | #endif |