summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/seco-cec/seco-cec.c
AgeCommit message (Collapse)AuthorFilesLines
2020-04-15media: move CEC platform drivers to a separate directoryMauro Carvalho Chehab1-803/+0
As CEC support doesn't depend on MEDIA_SUPPORT, let's place the platform drivers outside the media menu. As a side effect, instead of depends on PCI, seco driver can select it (and DMI). Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-11-27Merge tag 'drm-next-2019-11-27' of git://anongit.freedesktop.org/drm/drmLinus Torvalds1-2/+2
Pull drm updates from Dave Airlie: "Lots of stuff in here, though it hasn't been too insane this merge apart from dealing with the security fun. uapi: - export different colorspace properties on DP vs HDMI - new fourcc for ARM 16x16 block format - syncobj: allow querying last submitted timeline value - DRM_FORMAT_BIG_ENDIAN defined as unsigned core: - allow using gem vma manager in ttm - connector/encoder/bridge doc fixes - allow more than 3 encoders for a connector - displayport mst suspend/resume reprobing support - vram lazy unmapping, uniform vram mm and gem vram - edid cleanups + AVI informframe bar info - displayport helpers - dpcd parser added dp_cec: - Allow a connector to be associated with a cec device ttm: - pipelining with no_gpu_wait fix - always keep BOs on the LRU sched: - allow free_job routine to sleep i915: - Block userptr from mappable GTT - i915 perf uapi versioning - OA stream dynamic reconfiguration - make context persistence optional - introduce DRM_I915_UNSTABLE Kconfig - add fake lmem testing under unstable - BT.2020 support for DP MSA - struct mutex elimination - Tigerlake display/PLL/power management improvements - Jasper Lake PCH support - refactor PMU for multiple GPUs - Icelake firmware update - Split out vga + switcheroo code amdgpu: - implement dma-buf import/export without helpers - vega20 RAS enablement - DC i2c over aux fixes - renoir GPU reset - DC HDCP support - BACO support for CI/VI asics - MSI-X support - Arcturus EEPROM support - Arcturus VCN encode support - VCN dynamic powergating on RV/RV2 amdkfd: - add navi12/14/renoir support to kfd radeon: - SI dpm fix ported from amdgpu - fix bad DMA on ppc platforms gma500: - memory leak fixes qxl: - convert to new gem mmap exynos: - build warning fix komeda: - add aclk sysfs attribute v3d: - userspace cleanup uapi change i810: - fix for underflow in dispatch ioctls ast: - refactor show_cursor mgag200: - refactor show_cursor arcgpu: - encoder finding improvements mediatek: - mipi_tx, dsi and partial crtc support for MT8183 SoC - rotation support meson: - add suspend/resume support omap: - misc refactors tegra: - DisplayPort support for Tegra 210, 186 and 194. - IOMMU-backed DMA API fixes panfrost: - fix lockdep issue - simplify devfreq integration rcar-du: - R8A774B1 SoC support - fixes for H2 ES2.0 sun4i: - vcc-dsi regulator support virtio-gpu: - vmexit vs spinlock fix - move to gem shmem helpers - handle large command buffers with cma" * tag 'drm-next-2019-11-27' of git://anongit.freedesktop.org/drm/drm: (1855 commits) drm/amdgpu: invalidate mmhub semaphore workaround in gmc9/gmc10 drm/amdgpu: initialize vm_inv_eng0_sem for gfxhub and mmhub drm/amd/amdgpu/sriov skip RLCG s/r list for arcturus VF. drm/amd/amdgpu/sriov temporarily skip ras,dtm,hdcp for arcturus VF drm/amdgpu/gfx10: re-init clear state buffer after gpu reset merge fix for "ftrace: Rework event_create_dir()" drm/amdgpu: Update Arcturus golden registers drm/amdgpu/gfx10: fix out-of-bound mqd_backup array access drm/amdgpu/gfx10: explicitly wait for cp idle after halt/unhalt Revert "drm/amd/display: enable S/G for RAVEN chip" drm/amdgpu: disable gfxoff on original raven drm/amdgpu: remove experimental flag for Navi14 drm/amdgpu: disable gfxoff when using register read interface drm/amdgpu/powerplay: properly set PP_GFXOFF_MASK (v2) drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2 drm/radeon: fix bad DMA from INTERRUPT_CNTL2 drm/amd/display: Fix debugfs on MST connectors drm/amdgpu/nv: add asic func for fetching vbios from rom directly drm/amdgpu: put flush_delayed_work at first drm/amdgpu/vcn2.5: fix the enc loop with hw fini ...
2019-10-07cec: add cec_adapter to cec_notifier_cec_adap_unregister()Hans Verkuil1-2/+2
It is possible for one HDMI connector to have multiple CEC adapters. The typical real-world scenario is that where one adapter is used when the device is in standby, and one that's better/smarter when the device is powered up. The cec-notifier changes were made with that in mind, but I missed that in order to support this you need to tell cec_notifier_cec_adap_unregister() which adapter you are unregistering from the notifier. Add this additional argument. It is currently unused, but once all drivers use this, the CEC core will be adapted for these use-cases. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/e9fc8740-6be6-43a7-beee-ce2d7b54936e@xs4all.nl
2019-10-01media: seco-cec: Add a missing 'release_region()' in an error handling pathChristophe JAILLET1-0/+1
At the beginning of the probe function, we have a call to 'request_muxed_region(BRA_SMB_BASE_ADDR, 7, "CEC00001")()' A corresponding 'release_region()' is performed in the remove function but is lacking in the error handling path. Add it. Fixes: b03c2fb97adc ("media: add SECO cec driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-07-23media: seco-cec: use cec_notifier_cec_adap_(un)registerHans Verkuil1-25/+30
Use cec_notifier_cec_adap_(un)register instead of cec_notifier_get_conn, cec_notifier_put and cec_register_cec_notifier. Also enable the CEC_CAP_CONNECTOR_INFO capability. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: Ettore Chimenti <ek5.chimenti@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-27media: cec: add struct cec_connector_info supportDariusz Marcinkiewicz1-1/+1
Define struct cec_connector_info in media/cec.h and define CEC_CAP_CONNECTOR_INFO. In a later patch this will be moved to uapi/linux/cec.h. The CEC_CAP_CONNECTOR_INFO capability can be set by drivers, but cec_allocate_adapter() will remove it again until the public API for this can be enabled once all drm drivers wire this up correctly. Also add the cec_fill_conn_info_from_drm and cec_s_conn_info functions, which are needed by drm drivers to fill in the cec_connector info based on a drm_connector. The cec_notifier_(un)register and cec_register_cec_notifier prototypes were moved from cec-notifier.h to cec.h since cec.h no longer includes cec-notifier.h. These headers included each other before, which caused various problems. Due to these changes the seco-cec driver was changed as well: it should include cec-notifier.h, not cec.h. Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-22media: seco-cec: decrement HDMI device refcountHans Verkuil1-0/+1
The SECO CEC driver never decremented the HDMI device refcount. CEC drivers only need the HDMI device pointer as a key in the notifier list, it never accesses the device, so there is no need to keep a reference. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: seco-cec: add missing header file to fix buildRandy Dunlap1-0/+1
Fix build errors due to missing <linux/module.h> header file. The header file is inserted first because module-related errors begin showing up in <linux/acpi.h> (when CONFIG_ACPI is not set). Sample of build errors: In file included from ../include/linux/acpi.h:27:0, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../include/linux/device.h:1620:1: warning: data definition has no type or storage class [enabled by default] module_exit(__driver##_exit); ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ ../include/linux/device.h:1620:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int] module_exit(__driver##_exit); ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ In file included from ../include/linux/linkage.h:7:0, from ../include/linux/kernel.h:7, from ../include/linux/list.h:9, from ../include/linux/resource_ext.h:17, from ../include/linux/acpi.h:26, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../include/linux/export.h:18:30: warning: parameter names (without types) in function declaration [enabled by default] #define THIS_MODULE ((struct module *)0) ^ ../include/linux/platform_device.h:199:34: note: in expansion of macro 'THIS_MODULE' __platform_driver_register(drv, THIS_MODULE) ^ ../include/linux/device.h:1613:9: note: in expansion of macro 'platform_driver_register' return __register(&(__driver) , ##__VA_ARGS__); \ ^ ../include/linux/platform_device.h:229:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); ^ ../drivers/media/platform/seco-cec/seco-cec.c:793:20: error: expected declaration specifiers or '...' before string constant MODULE_DESCRIPTION("SECO CEC X86 Driver"); ^ ../drivers/media/platform/seco-cec/seco-cec.c:794:15: error: expected declaration specifiers or '...' before string constant MODULE_AUTHOR("Ettore Chimenti <ek5.chimenti@gmail.com>"); ^ ../drivers/media/platform/seco-cec/seco-cec.c:795:16: error: expected declaration specifiers or '...' before string constant MODULE_LICENSE("Dual BSD/GPL"); ^ In file included from ../include/linux/acpi.h:27:0, from ../drivers/media/platform/seco-cec/seco-cec.c:10: ../drivers/media/platform/seco-cec/seco-cec.c:791:24: warning: 'secocec_driver_init' defined but not used [-Wunused-function] module_platform_driver(secocec_driver); ^ ../include/linux/device.h:1611:19: note: in definition of macro 'module_driver' static int __init __driver##_init(void) \ ^ ../drivers/media/platform/seco-cec/seco-cec.c:791:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(secocec_driver); Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Ettore Chimenti <ek5.chimenti@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: seco-cec: declare ops as static constMauro Carvalho Chehab1-1/+1
As warned by smatch: drivers/media/platform/seco-cec/seco-cec.c:338:21: warning: symbol 'secocec_cec_adap_ops' was not declared. Should it be static? This struct should be static. Also, it is const, so declare it as such. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-22media: seco-cec: add Consumer-IR supportEttore Chimenti1-1/+124
Introduce support for Consumer-IR into seco-cec driver, as it shares the same interrupt for receiving messages. The device decodes RC5 signals only, defaults to hauppauge mapping. It will spawn an input interface using the RC framework (like CEC device). Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com> Reviewed-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-22media: add SECO cec driverEttore Chimenti1-0/+672
This patch adds support to the CEC device implemented with a STM32 microcontroller in X86 SECO Boards, including UDOO X86. The communication is achieved via Braswell integrated SMBus (i2c-i801). The driver use direct access to the PCI addresses, due to the limitations of the specific driver in presence of ACPI calls. The basic functionalities are tested with success with cec-ctl and cec-compliance. Inspired by cros-ec-cec implementation, attaches to i915 driver cec-notifier. Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>