summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media
AgeCommit message (Collapse)AuthorFilesLines
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds2-2/+2
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-06Merge tag 'media/v4.16-2' of ↵Linus Torvalds49-2767/+2281
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - videobuf2 was moved to a media/common dir, as it is now used by the DVB subsystem too - Digital TV core memory mapped support interface - new sensor driver: ov7740 - several improvements at ddbridge driver - new V4L2 driver: IPU3 CIO2 CSI-2 receiver unit, found on some Intel SoCs - new tuner driver: tda18250 - finally got rid of all LIRC staging drivers - as we don't have old lirc drivers anymore, restruct the lirc device code - add support for UVC metadata - add a new staging driver for NVIDIA Tegra Video Decoder Engine - DVB kAPI headers moved to include/media - synchronize the kAPI and uAPI for the DVB subsystem, removing the gap for non-legacy APIs - reduce the kAPI gap for V4L2 - lots of other driver enhancements, cleanups, etc. * tag 'media/v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (407 commits) media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32 media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32 media: v4l2-compat-ioctl32.c: avoid sizeof(type) media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32 media: v4l2-compat-ioctl32.c: fix the indentation media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF media: v4l2-ioctl.c: don't copy back the result for -ENOTTY media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt media: vivid: fix module load error when enabling fb and no_error_inj=1 media: dvb_demux: improve debug messages media: dvb_demux: Better handle discontinuity errors media: cxusb, dib0700: ignore XC2028_I2C_FLUSH media: ts2020: avoid integer overflows on 32 bit machines media: i2c: ov7740: use gpio/consumer.h instead of gpio.h media: entity: Add a nop variant of media_entity_cleanup ...
2018-02-01Merge tag 'staging-4.16-rc1' of ↵Linus Torvalds3-20/+20
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO updates from Greg KH: "Here is the big Staging and IIO driver patches for 4.16-rc1. There is the normal amount of new IIO drivers added, like all releases. The networking IPX and the ncpfs filesystem are moved into the staging tree, as they are on their way out of the kernel due to lack of use anymore. The visorbus subsystem finall has started moving out of the staging tree to the "real" part of the kernel, and the most and fsl-mc codebases are almost ready to move out, that will probably happen for 4.17-rc1 if all goes well. Other than that, there is a bunch of license header cleanups in the tree, along with the normal amount of coding style churn that we all know and love for this codebase. I also got frustrated at the Meltdown/Spectre mess and took it out on the dgnc tty driver, deleting huge chunks of it that were never even being used. Full details of everything is in the shortlog. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (627 commits) staging: rtlwifi: remove redundant initialization of 'cfg_cmd' staging: rtl8723bs: remove a couple of redundant initializations staging: comedi: reformat lines to 80 chars or less staging: lustre: separate a connection destroy from free struct kib_conn Staging: rtl8723bs: Use !x instead of NULL comparison Staging: rtl8723bs: Remove dead code Staging: rtl8723bs: Change names to conform to the kernel code staging: ccree: Fix missing blank line after declaration staging: rtl8188eu: remove redundant initialization of 'pwrcfgcmd' staging: rtlwifi: remove unused RTLHALMAC_ST and RTLPHYDM_ST staging: fbtft: remove unused FB_TFT_SSD1325 kconfig staging: comedi: dt2811: remove redundant initialization of 'ns' staging: wilc1000: fix alignments to match open parenthesis staging: wilc1000: removed unnecessary defined enums typedef staging: wilc1000: remove unnecessary use of parentheses staging: rtl8192u: remove redundant initialization of 'timeout' staging: sm750fb: fix CamelCase for dispSet var staging: lustre: lnet/selftest: fix compile error on UP build staging: rtl8723bs: hal_com_phycfg: Remove unneeded semicolons staging: rts5208: Fix "seg_no" calculation in reset_ms_card() ...
2018-01-30Merge branch 'misc.poll' of ↵Linus Torvalds5-7/+7
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull poll annotations from Al Viro: "This introduces a __bitwise type for POLL### bitmap, and propagates the annotations through the tree. Most of that stuff is as simple as 'make ->poll() instances return __poll_t and do the same to local variables used to hold the future return value'. Some of the obvious brainos found in process are fixed (e.g. POLLIN misspelled as POLL_IN). At that point the amount of sparse warnings is low and most of them are for genuine bugs - e.g. ->poll() instance deciding to return -EINVAL instead of a bitmap. I hadn't touched those in this series - it's large enough as it is. Another problem it has caught was eventpoll() ABI mess; select.c and eventpoll.c assumed that corresponding POLL### and EPOLL### were equal. That's true for some, but not all of them - EPOLL### are arch-independent, but POLL### are not. The last commit in this series separates userland POLL### values from the (now arch-independent) kernel-side ones, converting between them in the few places where they are copied to/from userland. AFAICS, this is the least disruptive fix preserving poll(2) ABI and making epoll() work on all architectures. As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and it will trigger only on what would've triggered EPOLLWRBAND on other architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered at all on sparc. With this patch they should work consistently on all architectures" * 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits) make kernel-side POLL... arch-independent eventpoll: no need to mask the result of epi_item_poll() again eventpoll: constify struct epoll_event pointers debugging printk in sg_poll() uses %x to print POLL... bitmap annotate poll(2) guts 9p: untangle ->poll() mess ->si_band gets POLL... bitmap stored into a user-visible long field ring_buffer_poll_wait() return value used as return value of ->poll() the rest of drivers/*: annotate ->poll() instances media: annotate ->poll() instances fs: annotate ->poll() instances ipc, kernel, mm: annotate ->poll() instances net: annotate ->poll() instances apparmor: annotate ->poll() instances tomoyo: annotate ->poll() instances sound: annotate ->poll() instances acpi: annotate ->poll() instances crypto: annotate ->poll() instances block: annotate ->poll() instances x86: annotate ->poll() instances ...
2018-01-23media: staging: tegra-vde: select DMA_SHARED_BUFFERArnd Bergmann1-0/+1
Without CONFIG_DMA_SHARED_BUFFER we run into a link error for the dma_buf_* APIs: ERROR: "dma_buf_map_attachment" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_attach" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_get" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_put" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_detach" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_unmap_attachment" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-01-04media: staging: use tabs instead of spaces at Kconfig and davinciMauro Carvalho Chehab2-12/+12
Even on text and Kconfigs, what we do on media is to use tabs for indentation. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: imx: fix breakages when compiling for armMauro Carvalho Chehab1-2/+2
As reported: drivers/staging/media/imx/imx-media-dev.c: In function 'find_async_subdev': >> drivers/staging/media/imx/imx-media-dev.c:55:49: error: request for member 'name' in something not a structure or union if (devname && !strcmp(asd->match.device_name.name, ^ drivers/staging/media/imx/imx-media-dev.c: In function 'imx_media_add_async_subdev': drivers/staging/media/imx/imx-media-dev.c:110:25: error: request for member 'name' in something not a structure or union asd->match.device_name.name = devname; ^ Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: v4l2-async: simplify v4l2_async_subdev structureMauro Carvalho Chehab1-2/+2
The V4L2_ASYNC_MATCH_FWNODE match criteria requires just one struct to be filled (struct fwnode_handle). The V4L2_ASYNC_MATCH_DEVNAME match criteria requires just a device name. So, it doesn't make sense to enclose those into structs, as the criteria can go directly into the union. That makes easier to document it, as we don't need to document weird senseless structs. At drivers, this makes even clearer about the match criteria. Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Benoit Parrot <bparrot@ti.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Hyun Kwon <hyun.kwon@xilinx.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Fix DMI matching entry for MRD7Andy Shevchenko1-1/+2
MRD7 board has in particular Base Board Information Manufacturer: Intel Corp. Product Name: TABLET Version: MRD 7 Fix the DMI matching entry for it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Use standard DMI match tableAndy Shevchenko1-39/+70
The traditional pattern is to use DMI matching table and provide a corresponding driver_data in it. Convert driver to use DMI matching table. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Unexport local functionAndy Shevchenko2-4/+2
There is no need to export function which is only used once in the same module where it's defined. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Remove redundant PCI codeAndy Shevchenko2-9/+0
There is no need to keep a reference to PCI root bridge. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Switch to use struct device_driver directlyAndy Shevchenko3-15/+11
In a preparation of split PCI glue driver from core part, convert the driver to use more generic struct device_driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Remove non-ACPI leftoversAndy Shevchenko9-93/+49
Since all drivers are solely requiring ACPI enumeration, there is no need to additionally check for legacy platform data or ACPI handle. Remove leftovers from the sensors and platform code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Disable custom format for nowAndy Shevchenko3-1/+8
Custom video format 'M101' is not supported in upstream and as a result user will get ugly warning: Unknown pixelformat 0x3130314d ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1574 at drivers/media/v4l2-core/v4l2-ioctl.c:1291 v4l_enum_fmt+0xcf1/0x13a0 [videodev] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: lm3554: Fix control valuesAndy Shevchenko1-5/+5
Driver fails to initialize due to insane settings in the control init array. Fix this by moving to sanity. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Remove duplicate NULL-checkAndy Shevchenko1-2/+2
GPIO framework checks for NULL pointer when gpiod_set_value() is called. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Don't leak GPIO resources if clk_get() failedAndy Shevchenko1-2/+2
In case devm_clk_get() call fails the previously requested GPIOs are left requested. Fix this by moving GPIO request code after devm_clk_get() call. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp2: replace DEVICE_ATTR with DEVICE_ATTR_ROAishwarya Pant1-4/+4
This is a clean-up patch which replaces DEVICE_ATTR() macro with file permission specific DEVICE_ATTR_RO() macro for compaction and readability. Done using coccinelle: @r@ identifier attr, show_fn; declarer name DEVICE_ATTR; @@ DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); @script: python p@ attr_show; attr << r.attr; @@ // standardise the show fn name to {attr}_show coccinelle.attr_show = attr + "_show" @@ identifier r.attr, r.show_fn; declarer name DEVICE_ATTR_RO; @@ // change the attr declaration - DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); + DEVICE_ATTR_RO(attr); @rr@ identifier r.show_fn, p.attr_show; @@ // rename the show function - show_fn + attr_show (...) { ... } @depends on rr@ identifier r.show_fn, p.attr_show; @@ // rename fn usages - show_fun + attr_show Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: Staging: media: atomisp: made function staticSergiy Redko1-0/+1
Fixed sparse warning by making 'dtrace_dot' function static. Signed-off-by: Sergiy Redko <sergredko@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: fix indentation in atomisp-ov5693Riccardo Schirone1-1/+1
Fix "suspect code indent for conditional statements" checkpatch issue Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: improves comparisons readability in atomisp-ov5693Riccardo Schirone1-5/+5
Fix "Comparisons should place the constant on the right side of the test" checkpatch issue. Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: improve comments usage in atomisp-ov5693Riccardo Schirone1-13/+25
- Fix "Block comments use a trailing */ on a separate line" checkpatch issue - Fix "Block comments use * on subsequent lines" checkpatch issue Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: add missing blank line after declarations in atomisp-ov5693Riccardo Schirone1-0/+13
Fix "Missing a blank line after declarations" warning reported by checkpatch. Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: atomisp: deprecate pci_get_bus_and_slot()Sinan Kaya1-1/+1
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as where a PCI device is present. This restricts the device drivers to be reused for other domain numbers. Getting ready to remove pci_get_bus_and_slot() function. Since ISP always uses domain 0, hard-code it in the code when calling the replacement function pci_get_domain_bus_and_slot(). Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: convert timestamps to ktime_tArnd Bergmann3-13/+9
timespec overflows in 2038 on 32-bit architectures, and the getnstimeofday() suffers from possible time jumps, so the timestamps here are better done using ktime_get(), which has neither of those problems. In case of ov2680, we don't seem to use the timestamp at all, so I just remove it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: fixes for "symbol was not declared. Should it be ↵Jeremy Sowden1-12/+12
static?" sparse warnings Defined some const arrays as static since they don't need external linkage. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: fix for sparse "using plain integer as NULL ↵Jeremy Sowden1-1/+1
pointer" warnings The "address" member of struct ia_css_host_data is a pointer-to-char, so define default as NULL. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-28media: move dvb kAPI headers to include/mediaMauro Carvalho Chehab2-2/+1
Except for DVB, all media kAPI headers are at include/media. Move the headers to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18Merge 4.15-rc4 into staging-nextGreg Kroah-Hartman160-1746/+1746
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-15media: staging/imx: update TODOSteve Longerbeam1-12/+51
Update TODO file: - Remove TODO info about the OV564x driver, while this still needs to be done (add a OV5642 driver or merge with OV5640 driver), it is not relevant here. - Update TODO about methods for retrieving CSI bus config. - Add some TODO's about OF graph parsing restrictions. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: reorder function prototypesSteve Longerbeam1-9/+12
Re-order some of the function prototypes in imx-media.h to group them correctly by source file. No functional changes. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: convert static vdev lists to list_headSteve Longerbeam4-66/+68
Although not technically necessary because imx-media has only a maximum of 8 video devices, and once setup the video device lists are static, in anticipation of moving control ineritance to v4l2-core, make the vdev lists more generic by converting to dynamic list_head's. After doing that, 'struct imx_media_pad' is now just a list_head of video devices reachable from a pad. Allocate an array of list_head's, one list_head for each pad, and attach that array to sd->host_priv. An entry in the pad lists is of type 'struct imx_media_pad_vdev', and points to a video device from the master list. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: remove static subdev arraysSteve Longerbeam7-218/+216
For more complex OF graphs, there will be more async subdevices registered. Remove the static subdev[IMX_MEDIA_MAX_SUBDEVS] array, so that imx-media places no limits on the number of async subdevs that can be added and registered. There were two uses for 'struct imx_media_subdev'. First was to act as the async subdev list to be passed to v4l2_async_notifier_register(). Second was to aid in inheriting subdev controls to the capture devices, and this is done by creating a list of capture devices that can be reached from a subdev's source pad. So 'struct imx_media_subdev' also contained a static array of 'struct imx_media_pad' for placing the capture device lists at each pad. 'struct imx_media_subdev' has been completely removed. Instead, at async completion, allocate an array of 'struct imx_media_pad' and attach it to the subdev's host_priv pointer, in order to support subdev controls inheritance. Likewise, remove static async_ptrs[IMX_MEDIA_MAX_SUBDEVS] array. Instead, allocate a 'struct imx_media_async_subdev' when forming the async list, and add it to an asd_list list_head in imx_media_add_async_subdev(). At async completion, allocate the asd pointer list and pull the asd's off asd_list for v4l2_async_notifier_register(). Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: pass fwnode handle to find/add async subdevSteve Longerbeam3-16/+15
Pass the subdev's fwnode_handle to imx_media_find_async_subdev() and imx_media_add_async_subdev(), instead of a device_node. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: remove devname string from imx_media_subdevSteve Longerbeam2-4/+1
A separate string for the device name, for DEVNAME async match, was never needed. Just assign the asd device name to the passed platform device name pointer in imx_media_add_async_subdev(). Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: of: allow for recursing downstreamSteve Longerbeam3-88/+21
Calling of_parse_subdev() recursively to a downstream path that has already been followed is ok, it just means that call will return immediately since the subdevice was already added to the async list. With that there is no need to determine whether a subdevice's port is a sink or source, so 'num_{sink|src}_pads' is no longer used and is removed. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: remove static media link arraysSteve Longerbeam4-296/+281
Remove the static list of media links that were formed at probe time. These links can instead be created after all registered async subdevices have been bound in imx_media_probe_complete(). The media links between subdevices that exist in the device tree, can be created post-async completion by using v4l2_fwnode_parse_link() for each endpoint node of that subdevice. Note this approach assumes device-tree ports are equivalent to media pads (pad index equals port id), and that device-tree endpoints are equivalent to media links between pads. Because links are no longer parsed by imx_media_of_parse(), its sole function is now only to add subdevices that it encounters by walking the OF graph to the async list, so the function has been renamed imx_media_add_of_subdevs(). Similarly, the media links between the IPU-internal subdevice pads (the CSI source pads, and all pads between the vdic, ic-prp, ic-prpenc, and ic-prpvf subdevices), can be created post-async completion by looping through the subdevice's media pads and using the const internal_subdev table. Because links are no longer parsed by imx_media_add_internal_subdevs(), this function no longer needs an array of CSI subdevs to form links from. In summary, the following functions, which were used to form a list of media links at probe time, are removed: imx_media_add_pad_link() add_internal_links() of_add_pad_link() replaced by these functions, called at probe time, which only populate the async subdev list: imx_media_add_of_subdevs() imx_media_add_internal_subdevs() and these functions, called at async completion, which create the media links: imx_media_create_of_links() imx_media_create_csi_of_links() imx_media_create_internal_links() Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-15media: staging/imx: get CSI bus type from nearest upstream entitySteve Longerbeam5-161/+150
The imx-media driver currently supports a device tree graph of limited complexity. This patch is a first step in allowing imx-media to work with more general OF graphs. The CSI subdevice assumes the originating upstream subdevice (the "sensor") is connected directly to either the CSI mux or the MIPI CSI-2 receiver. But for more complex graphs, the sensor can be distant, with possible bridge entities in between. Thus the sensor's bus type could be quite different from what is entering the CSI. For example a distant sensor could have a parallel interface, but the stream entering the i.MX is MIPI CSI-2. To remove this assumption, get the entering bus config from the entity that is directly upstream from either the CSI mux, or the CSI-2 receiver. If the CSI-2 receiver is not in the enabled pipeline, the bus type to the CSI is parallel, otherwise the CSI is receiving MIPI CSI-2. Note that we can't use the direct upstream source connected to CSI (which is either the CSI mux or the CSI-2 receiver) to determine bus type. The bus entering the CSI from the CSI-2 receiver is a 32-bit parallel bus containing the demultiplexed MIPI CSI-2 virtual channels. But the CSI and its IDMAC channels must be configured based on whether it is receiving data from the CSI-2 receiver or from the CSI mux's parallel interface pins. The function csi_get_upstream_endpoint() is used to find this endpoint. It makes use of a new utility function imx_media_find_upstream_pad(), that if given a grp_id of 0, will return the closest upstream pad from start_entity. With these changes, imx_media_find_sensor() is no longer used and is removed. As a result there is also no longer a need to identify any sensor or set the sensor subdev's group id as a method to search for it. So IMX_MEDIA_GRP_ID_SENSOR is removed. Also the video-mux group id IMX_MEDIA_GRP_ID_VIDMUX was never used so that is removed as well. The remaining IMX_MEDIA_GRP_ID_* definitions are entities internal to the i.MX. Another use of imx_media_find_sensor() in the CSI was to call the sensor's g_skip_frames op to determine if a delay was needed before enabling the CSI at stream on. If necessary this will have to be re-addressed at a later time. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging/cxd2099: cosmetics: improve stringsDaniel Scheller1-4/+5
Prefix dev_*() I2C address prints with 0x, change CXD2099 to CXD2099AR, change the MODULE_DESCRIPTION to a proper one and have a better (and shorter) description for the buffermode modparam. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging/cxd2099: fix debug message severityDaniel Scheller1-1/+1
Debug messages should go to KERN_DEBUG, thus change the slot_shutdown() notice from dev_info() to dev_dbg(). Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging/cxd2099: fix remaining checkpatch-strict issuesDaniel Scheller2-25/+8
Fix up all remaining cosmetic issues as reported by checkpatch.pl. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging: remove lirc_zilog driverSean Young6-1720/+0
The ir-kbd-i2c driver behaves like the lirc_zilog driver, except it can send raw IR and receives scancodes rather than lirccodes. The lirc_zilog driver only polls if the lirc chardev is opened; similarly the ir-kbd-i2c driver only polls if the corresponding input device is opened, or the lirc device. Polling is disabled during IR transmission through the mutex. The polling period is 402ms in the ir-kdb-i2c driver, and 260ms in the lirc_zilog driver. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging: media: Introduce NVIDIA Tegra video decoder driverDmitry Osipenko7-0/+1306
NVIDIA Tegra20/30/114/124/132 SoC's have video decoder engine that supports standard set of video formats like H.264 / MPEG-4 / WMV / VC1. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: i.MX6: Fix MIPI CSI-2 LP-11 checkKrzysztof Hałasa1-2/+2
Bitmask for the MIPI CSI-2 data PHY status doesn't seem to be correct. Fix it. Signed-off-by: Krzysztof Ha?asa <khalasa@piap.pl> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: imx-csi: fix burst sizeRussell King1-1/+1
Setting a burst size of "8" doesn't work for IMX219 with 8-bit bayer, but a burst size of "16" does. Fix this. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-11media: staging/imx: fix complete handlerRussell King1-2/+5
The complete handler walks all entities, expecting to find an imx subdevice for each and every entity. However, camera drivers such as smiapp can themselves contain multiple entities, for which there will not be an imx subdevice. This causes imx_media_find_subdev_by_sd() to fail, making the imx capture system unusable with such cameras. Work around this by killing the error entirely, thereby allowing the imx capture to be used with such cameras. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-08media: staging: imx: use ktime_t for timestampsArnd Bergmann3-20/+20
The imx media driver passes around monotonic timestamps in the deprecated 'timespec' format. This is not a problem for the driver, as they won't overflow, but moving to either timespec64 or ktime_t is preferred. I'm picking ktime_t for simplicity here. frame_interval_monitor() is the main function that changes, as it tries to compare a time interval in microseconds. The algorithm slightly changes here, to avoid 64-bit division. The code previously assumed that the error was at most 32-bit worth of microseconds here, so I'm making the same assumption but add an explicit test for it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-08media: staging: media: imx: fix inconsistent IS_ERR and PTR_ERRGustavo A. R. Silva1-1/+1
Fix inconsistent IS_ERR and PTR_ERR in csi_link_validate. The proper pointer to be passed as argument is sensor. This issue was detected with the help of Coccinelle. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-08media: imx: Remove incorrect check for queue state in start/stop_streamingIan Jamison1-6/+0
It is possible to call STREAMON without the minimum number of buffers queued. In this case the vb2_queue state will be set to streaming but the start_streaming vb2_op will not be called. Later when enough buffers are queued, start_streaming will be called but vb2_is_streaming will already return true. Also removed the queue state check in stop_streaming since it's not valid there either. Signed-off-by: Ian Jamison <ian.dev@arkver.com> Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>