Skip to content

Commit

Permalink
Merge tag 'media/v4.12-2' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "Some bug fixes:

   - Don't fail build if atomisp has warnings

   - Some CEC Kconfig changes to allow it to be used by DRM without
     media dependencies

   - A race fix at RC initialization code

   - A driver fix at rainshadow-cec

  IMHO, the one that affects most people in this series is a build fix:
  if you try to build the Kernel with W=1 or using gcc7 and
  all[yes|mod]config, build will fail due to -Werror at atomisp
  makefiles"

* tag 'media/v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] rc-core: race condition during ir_raw_event_register()
  [media] cec: drop MEDIA_CEC_DEBUG
  [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER
  [media] cec: select CEC_CORE instead of depend on it
  [media] rainshadow-cec: ensure exit_loop is intialized
  [media] atomisp: don't treat warnings as errors
  • Loading branch information
Linus Torvalds committed Jun 6, 2017
2 parents ba7b238 + 963761a commit 84c6c30
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 48 deletions.
6 changes: 6 additions & 0 deletions drivers/media/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# Multimedia device configuration
#

config CEC_CORE
tristate

config CEC_NOTIFIER
bool

menuconfig MEDIA_SUPPORT
tristate "Multimedia support"
depends on HAS_IOMEM
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

media-objs := media-device.o media-devnode.o media-entity.o

obj-$(CONFIG_CEC_CORE) += cec/

#
# I2C drivers should come before other drivers, otherwise they'll fail
# when compiled as builtin drivers
Expand All @@ -26,6 +24,8 @@ obj-$(CONFIG_DVB_CORE) += dvb-core/
# There are both core and drivers at RC subtree - merge before drivers
obj-y += rc/

obj-$(CONFIG_CEC_CORE) += cec/

#
# Finally, merge the drivers that require the core
#
Expand Down
14 changes: 0 additions & 14 deletions drivers/media/cec/Kconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
config CEC_CORE
tristate
depends on MEDIA_CEC_SUPPORT
default y

config MEDIA_CEC_NOTIFIER
bool

config MEDIA_CEC_RC
bool "HDMI CEC RC integration"
depends on CEC_CORE && RC_CORE
---help---
Pass on CEC remote control messages to the RC framework.

config MEDIA_CEC_DEBUG
bool "HDMI CEC debugfs interface"
depends on CEC_CORE && DEBUG_FS
---help---
Turns on the DebugFS interface for CEC devices.
2 changes: 1 addition & 1 deletion drivers/media/cec/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cec-objs := cec-core.o cec-adap.o cec-api.o cec-edid.o

ifeq ($(CONFIG_MEDIA_CEC_NOTIFIER),y)
ifeq ($(CONFIG_CEC_NOTIFIER),y)
cec-objs += cec-notifier.o
endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/cec/cec-adap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ void cec_monitor_all_cnt_dec(struct cec_adapter *adap)
WARN_ON(call_op(adap, adap_monitor_all_enable, 0));
}

#ifdef CONFIG_MEDIA_CEC_DEBUG
#ifdef CONFIG_DEBUG_FS
/*
* Log the current state of the CEC adapter.
* Very useful for debugging.
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/cec/cec-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void cec_devnode_unregister(struct cec_devnode *devnode)
put_device(&devnode->dev);
}

#ifdef CONFIG_MEDIA_CEC_NOTIFIER
#ifdef CONFIG_CEC_NOTIFIER
static void cec_cec_notify(struct cec_adapter *adap, u16 pa)
{
cec_s_phys_addr(adap, pa, false);
Expand Down Expand Up @@ -323,7 +323,7 @@ int cec_register_adapter(struct cec_adapter *adap,
}

dev_set_drvdata(&adap->devnode.dev, adap);
#ifdef CONFIG_MEDIA_CEC_DEBUG
#ifdef CONFIG_DEBUG_FS
if (!top_cec_dir)
return 0;

Expand Down Expand Up @@ -355,7 +355,7 @@ void cec_unregister_adapter(struct cec_adapter *adap)
adap->rc = NULL;
#endif
debugfs_remove_recursive(adap->cec_dir);
#ifdef CONFIG_MEDIA_CEC_NOTIFIER
#ifdef CONFIG_CEC_NOTIFIER
if (adap->notifier)
cec_notifier_unregister(adap->notifier);
#endif
Expand Down Expand Up @@ -395,7 +395,7 @@ static int __init cec_devnode_init(void)
return ret;
}

#ifdef CONFIG_MEDIA_CEC_DEBUG
#ifdef CONFIG_DEBUG_FS
top_cec_dir = debugfs_create_dir("cec", NULL);
if (IS_ERR_OR_NULL(top_cec_dir)) {
pr_warn("cec: Failed to create debugfs cec dir\n");
Expand Down
9 changes: 6 additions & 3 deletions drivers/media/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ config VIDEO_ADV7604

config VIDEO_ADV7604_CEC
bool "Enable Analog Devices ADV7604 CEC support"
depends on VIDEO_ADV7604 && CEC_CORE
depends on VIDEO_ADV7604
select CEC_CORE
---help---
When selected the adv7604 will support the optional
HDMI CEC feature.
Expand All @@ -240,7 +241,8 @@ config VIDEO_ADV7842

config VIDEO_ADV7842_CEC
bool "Enable Analog Devices ADV7842 CEC support"
depends on VIDEO_ADV7842 && CEC_CORE
depends on VIDEO_ADV7842
select CEC_CORE
---help---
When selected the adv7842 will support the optional
HDMI CEC feature.
Expand Down Expand Up @@ -478,7 +480,8 @@ config VIDEO_ADV7511

config VIDEO_ADV7511_CEC
bool "Enable Analog Devices ADV7511 CEC support"
depends on VIDEO_ADV7511 && CEC_CORE
depends on VIDEO_ADV7511
select CEC_CORE
---help---
When selected the adv7511 will support the optional
HDMI CEC feature.
Expand Down
10 changes: 6 additions & 4 deletions drivers/media/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ if CEC_PLATFORM_DRIVERS

config VIDEO_SAMSUNG_S5P_CEC
tristate "Samsung S5P CEC driver"
depends on CEC_CORE && (PLAT_S5P || ARCH_EXYNOS || COMPILE_TEST)
select MEDIA_CEC_NOTIFIER
depends on PLAT_S5P || ARCH_EXYNOS || COMPILE_TEST
select CEC_CORE
select CEC_NOTIFIER
---help---
This is a driver for Samsung S5P HDMI CEC interface. It uses the
generic CEC framework interface.
Expand All @@ -511,8 +512,9 @@ config VIDEO_SAMSUNG_S5P_CEC

config VIDEO_STI_HDMI_CEC
tristate "STMicroelectronics STiH4xx HDMI CEC driver"
depends on CEC_CORE && (ARCH_STI || COMPILE_TEST)
select MEDIA_CEC_NOTIFIER
depends on ARCH_STI || COMPILE_TEST
select CEC_CORE
select CEC_NOTIFIER
---help---
This is a driver for STIH4xx HDMI CEC interface. It uses the
generic CEC framework interface.
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/platform/vivid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ config VIDEO_VIVID

config VIDEO_VIVID_CEC
bool "Enable CEC emulation support"
depends on VIDEO_VIVID && CEC_CORE
depends on VIDEO_VIVID
select CEC_CORE
---help---
When selected the vivid module will emulate the optional
HDMI CEC feature.
Expand Down
13 changes: 8 additions & 5 deletions drivers/media/rc/rc-ir-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ EXPORT_SYMBOL_GPL(ir_raw_event_set_idle);
*/
void ir_raw_event_handle(struct rc_dev *dev)
{
if (!dev->raw)
if (!dev->raw || !dev->raw->thread)
return;

wake_up_process(dev->raw->thread);
Expand Down Expand Up @@ -490,6 +490,7 @@ int ir_raw_event_register(struct rc_dev *dev)
{
int rc;
struct ir_raw_handler *handler;
struct task_struct *thread;

if (!dev)
return -EINVAL;
Expand All @@ -507,13 +508,15 @@ int ir_raw_event_register(struct rc_dev *dev)
* because the event is coming from userspace
*/
if (dev->driver_type != RC_DRIVER_IR_RAW_TX) {
dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw,
"rc%u", dev->minor);
thread = kthread_run(ir_raw_event_thread, dev->raw, "rc%u",
dev->minor);

if (IS_ERR(dev->raw->thread)) {
rc = PTR_ERR(dev->raw->thread);
if (IS_ERR(thread)) {
rc = PTR_ERR(thread);
goto out;
}

dev->raw->thread = thread;
}

mutex_lock(&ir_raw_handler_lock);
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/usb/pulse8-cec/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config USB_PULSE8_CEC
tristate "Pulse Eight HDMI CEC"
depends on USB_ACM && CEC_CORE
depends on USB_ACM
select CEC_CORE
select SERIO
select SERIO_SERPORT
---help---
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/usb/rainshadow-cec/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config USB_RAINSHADOW_CEC
tristate "RainShadow Tech HDMI CEC"
depends on USB_ACM && CEC_CORE
depends on USB_ACM
select CEC_CORE
select SERIO
select SERIO_SERPORT
---help---
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/usb/rainshadow-cec/rainshadow-cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void rain_irq_work_handler(struct work_struct *work)

while (true) {
unsigned long flags;
bool exit_loop;
bool exit_loop = false;
char data;

spin_lock_irqsave(&rain->buf_lock, flags);
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/media/atomisp/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ obj-$(CONFIG_VIDEO_AP1302) += ap1302.o

obj-$(CONFIG_VIDEO_LM3554) += lm3554.o

ccflags-y += -Werror

2 changes: 0 additions & 2 deletions drivers/staging/media/atomisp/i2c/imx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ imx1x5-objs := imx.o drv201.o ad5816g.o dw9714.o dw9719.o dw9718.o vcm.o otp.o o

ov8858_driver-objs := ../ov8858.o dw9718.o vcm.o
obj-$(CONFIG_VIDEO_OV8858) += ov8858_driver.o

ccflags-y += -Werror
2 changes: 0 additions & 2 deletions drivers/staging/media/atomisp/i2c/ov5693/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
obj-$(CONFIG_VIDEO_OV5693) += ov5693.o

ccflags-y += -Werror
2 changes: 1 addition & 1 deletion drivers/staging/media/atomisp/pci/atomisp2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,5 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__
DEFINES += -DATOMISP_POSTFIX=\"css2400b0_v21\" -DISP2400B0
DEFINES += -DSYSTEM_hive_isp_css_2400_system -DISP2400

ccflags-y += $(INCLUDES) $(DEFINES) -fno-common -Werror
ccflags-y += $(INCLUDES) $(DEFINES) -fno-common

2 changes: 1 addition & 1 deletion include/media/cec-notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct edid;
struct cec_adapter;
struct cec_notifier;

#ifdef CONFIG_MEDIA_CEC_NOTIFIER
#if IS_REACHABLE(CONFIG_CEC_CORE) && IS_ENABLED(CONFIG_CEC_NOTIFIER)

/**
* cec_notifier_get - find or create a new cec_notifier for the given device.
Expand Down
4 changes: 2 additions & 2 deletions include/media/cec.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct cec_adapter {
bool passthrough;
struct cec_log_addrs log_addrs;

#ifdef CONFIG_MEDIA_CEC_NOTIFIER
#ifdef CONFIG_CEC_NOTIFIER
struct cec_notifier *notifier;
#endif

Expand Down Expand Up @@ -300,7 +300,7 @@ u16 cec_phys_addr_for_input(u16 phys_addr, u8 input);
*/
int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port);

#ifdef CONFIG_MEDIA_CEC_NOTIFIER
#ifdef CONFIG_CEC_NOTIFIER
void cec_register_cec_notifier(struct cec_adapter *adap,
struct cec_notifier *notifier);
#endif
Expand Down

0 comments on commit 84c6c30

Please sign in to comment.