summaryrefslogtreecommitdiff
path: root/drivers/staging/media/omap4iss
AgeCommit message (Collapse)Author
2018-02-06Merge tag 'media/v4.16-2' of ↵Linus Torvalds
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 ...
2017-12-08media: Staging: media: omap4iss: Use WARN_ON() instead of BUG_ON()Srishti Sharma
Use WARN_ON() instead of BUG_ON() to avoid crashing the kernel. Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-11-27media: annotate ->poll() instancesAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-08-27media: staging: omap4iss: make v4l2_file_operations constBhumika Goyal
Make this const as it is only stored in a const field of a video_device structure. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-18[media] staging: media: omap4iss: Replace a bit shift by a use of BITArushi Singhal
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-03[media] staging: omap4iss: fix coding style issueAvraham Shukron
Broke argument list so that it won't exceed 80 characters Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-03[media] staging: omap4iss: fix multiline comment styleAvraham Shukron
Fixed multi-line comments to their preferred style (First line empty) Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] v4l: omap4iss: Clean up file handle in open() and release()Shailendra Verma
Both functions initialize the file handle with v4l2_fh_init() and thus need to call clean up with v4l2_fh_exit() as appropriate. Fix it. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-27[media] media: Rename graph and pipeline structs and functionsSakari Ailus
The media_entity_pipeline_start() and media_entity_pipeline_stop() functions are renamed as media_pipeline_start() and media_pipeline_stop(), respectively. The reason is two-fold: the pipeline struct is, rightly, already called media_pipeline (rather than media_entity_pipeline) and what this really is about is a pipeline. A pipeline consists of entities --- and, well, other objects embedded in these entities. As the pipeline object will be in the future moved from entities to pads in order to support multiple pipelines through a single entity, do the renaming now. Similarly, functions operating on struct media_entity_graph as well as the struct itself are renamed by dropping the "entity_" part from the prefix of the function family and the data structure. The graph traversal which is what the functions are about is not specifically about entities only and will operate on pads for the same reason as the media pipeline. The patch has been generated using the following command: git grep -l media_entity |xargs perl -i -pe ' s/media_entity_pipeline/media_pipeline/g; s/media_entity_graph/media_graph/g' And a few manual edits related to line start alignment and line wrapping. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-16Staging: media: omap4iss: Unnecessary KERN_ERRMihaela Muraru
This patch remove unnecessary KERN_ERR in WARN() within iss_csi2.c Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19[media] staging: media: omap4iss: mark omap4iss_flush() staticBaoyou Xie
We get 1 warning when building kernel with W=1: drivers/staging/media/omap4iss/iss.c:64:6: warning: no previous prototype for 'omap4iss_flush' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. so this patch marks this function with 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09[media] media: Move media_device link_notify operation to an ops structureLaurent Pinchart
This will allow adding new operations without increasing the media_device structure size for drivers that don't implement any media device operation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24[media] v4l2: remove g/s_crop from video opsHans Verkuil
Replace all calls to g/s_crop by calls to the get/set_selection pad ops. Remove the old g/s_crop video ops since they are now no longer used. The cropcap video op is now only used to pass pixelaspect information, and is only needed if the pixelaspect is not 1:1. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil
Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] staging/media: convert drivers to use the new vb2_queue dev fieldHans Verkuil
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-05-20Merge tag 'staging-4.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO driver updates from Greg KH: "Here's the big staging and iio driver update for 4.7-rc1. I think we almost broke even with this release, only adding a few more lines than we removed, which isn't bad overall given that there's a bunch of new iio drivers added. The Lustre developers seem to have woken up from their sleep and have been doing a great job in cleaning up the code and pruning unused or old cruft, the filesystem is almost readable :) Other than that, just a lot of basic coding style cleanups in the churn. All have been in linux-next for a while with no reported issues" * tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits) Staging: emxx_udc: emxx_udc: fixed coding style issue staging/gdm724x: fix "alignment should match open parenthesis" issues staging/gdm724x: Fix avoid CamelCase staging: unisys: rename misleading var ii with frag staging: unisys: visorhba: switch success handling to error handling staging: unisys: visorhba: main path needs to flow down the left margin staging: unisys: visorinput: handle_locking_key() simplifications staging: unisys: visorhba: fail gracefully for thread creation failures staging: unisys: visornic: comment restructuring and removing bad diction staging: unisys: fix format string %Lx to %llx for u64 staging: unisys: remove unused struct members staging: unisys: visorchannel: correct variable misspelling staging: unisys: visorhba: replace functionlike macro with function staging: dgnc: Need to check for NULL of ch staging: dgnc: remove redundant condition check staging: dgnc: fix 'line over 80 characters' staging: dgnc: clean up the dgnc_get_modem_info() staging: lustre: lnet: enable configuration per NI interface staging: lustre: o2iblnd: properly set ibr_why staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini ...
2016-04-13[media] media: Rename is_media_entity_v4l2_io to ↵Laurent Pinchart
is_media_entity_v4l2_video_device All users of is_media_entity_v4l2_io() (the exynos4-is, omap3isp, davince_vpfe and omap4iss drivers and the v4l2-mc power management code) use the function to check whether entities are video_device instances, either to ensure they can cast the entity to a struct video_device, or to count the number of video nodes users. The purpose of the function is thus to identify whether the media entity instance is an instance of the video_device object, not to check whether it can perform I/O. Rename it accordingly, we will introduce a more specific is_media_entity_v4l2_io() check when needed. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-28staging: media: omap4iss: Match alignment with open parenthesis.Heena Sirwani
The following patch fixes the following checkpatch.pl warning: CHECK: Alignment should match open parenthesis Signed-off-by: Heena Sirwani <heenasirwani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-17Merge tag 'staging-4.6-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big staging driver pull request for 4.6-rc1. Lots of little things here, over 1600 patches or so. Notable is all of the good Lustre work happening, those developers have finally woken up and are cleaning up their code greatly. The Outreachy intern application process is also happening, which brought in another 400 or so patches. Full details are in the very long shortlog. All of these have been in linux-next with no reported issues" * tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits) staging: lustre: fix aligments in lnet selftest staging: lustre: report minimum of two buffers for LNet selftest load test staging: lustre: test for proper errno code in lstcon_rpc_trans_abort staging: lustre: filter remaining extra spacing for lnet selftest staging: lustre: remove extra spacing when setting variable for lnet selftest staging: lustre: remove extra spacing of variable declartions for lnet selftest staging: lustre: fix spacing issues checkpatch reported in lnet selftest staging: lustre: remove returns in void function for lnet selftest staging: lustre: fix bogus lst errors for lnet selftest staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc staging: android: ion: fix up file mode staging: ion: debugfs invalid gfp mask staging: rts5208: Replace pci_enable_device with pcim_enable_device Staging: ieee80211: Place constant on right side of the test. staging: speakup: Replace del_timer with del_timer_sync staging: lowmemorykiller: fix 2 checks that checkpatch complained staging: mt29f_spinand: Drop void pointer cast staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED ...
2016-03-11staging: media: omap4iss: Remove unnecessary platform_set_drvdata()Amitoj Kaur Chawla
Unnecessary platform_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ struct platform_device *pdev; @@ - platform_set_drvdata(pdev, NULL); //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03[media] staging: v4l: omap4iss: Use V4L2 graph PM operationsSakari Ailus
Power on devices represented by entities in the graph through the pipeline state using V4L2 graph PM operations instead of what was in the omap3isp driver. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: v4l: omap4iss: Use the new media graph walk interfaceSakari Ailus
The media graph walk requires initialisation and cleanup soon. Update the users to perform the soon necessary API calls. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: v4l: omap4iss: Use media entity enumeration interfaceSakari Ailus
Instead of using a bitmap directly in a driver, use the new media entity enumeration interface to perform the same. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: v4l: omap4iss: Fix sub-device power management codeSakari Ailus
The same bug was present in the omap4iss driver as was in the omap3isp driver. The code got copied to the omap4iss driver while broken. Fix the omap4iss driver as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: omap4iss: remove pads prefix from *_create_pads_links()Javier Martinez Canillas
The functions that create ISS internal and external entities links are called *_create_pads_links() but the "pads" prefix is redundant since the driver doesn't handle any other kind of link so it can be removed. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: use unsigned for pad indexMauro Carvalho Chehab
The pad index is unsigned. Replace the occurences of it where pertinent. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media framework: rename pads init function to media_entity_pads_init()Mauro Carvalho Chehab
With the MC next gen rework, what's left for media_entity_init() is to just initialize the PADs. However, certain devices, like a FLASH led/light doesn't have any input or output PAD. So, there's no reason why calling media_entity_init() would be mandatory. Also, despite its name, what this function actually does is to initialize the PADs data. So, rename it to media_entity_pads_init() in order to reflect that. The media entity actual init happens during entity register, at media_device_register_entity(). We should move init of num_links and num_backlinks to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] omap4iss: change the logic that checks if an entity is a subdevMauro Carvalho Chehab
As we're getting rid of an specific number range for the V4L2 subdev, we need to replace the check for MEDIA_ENT_T_V4L2_SUBDEV by a macro. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] omap3/omap4/davinci: get rid of MEDIA_ENT_T_V4L2_SUBDEV abuseMauro Carvalho Chehab
On omap3/omap4/davinci drivers, MEDIA_ENT_T_V4L2_SUBDEV macro is abused in order to "simplify" the pad checks. Basically, it does a logical or of this macro, in order to check for a local index and if the entity is either a subdev or not. As we'll get rid of MEDIA_ENT_T_V4L2_SUBDEV macro, replace it by 2 << 16 where it occurs, and add a note saying that the code there is actually a hack. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: use macros to check for V4L2 subdev entitiesMauro Carvalho Chehab
Instead of relying on media subtype, use the new macros to detect if an entity is a subdev or an A/V DMA entity. Please note that most drivers assume that there's just AV_DMA or V4L2 subdevs. This is not true anymore, as we've added MC support for DVB, and there are plans to add support for ALSA and FB/DRM too. Ok, on the current pipelines supported by those drivers, just V4L stuff are there, but, assuming that some day a pipeline that also works with other subsystems will ever added, it is better to add explicit checks for the AV_DMA stuff. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: omap4iss: separate links creation from entities initJavier Martinez Canillas
The omap4iss driver initializes the entities and creates the pads links before the entities are registered with the media device. This does not work now that object IDs are used to create links so the media_device has to be set. Split out the pads links creation from the entity initialization so are made after the entities registration. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: use entity.graph_obj.mdev instead of .parentJavier Martinez Canillas
The struct media_entity has a .parent field that stores a pointer to the parent struct media_device. But recently a media_gobj was embedded into the entities and since struct media_gojb already has a pointer to a struct media_device in the .mdev field, the .parent field becomes redundant and can be removed. This patch replaces all the usage of .parent by .graph_obj.mdev so that field will become unused and can be removed on a later patch. No functional changes. The transformation was made using the following coccinelle spatch: @@ struct media_entity *me; @@ - me->parent + me->graph_obj.mdev @@ struct media_entity *link; @@ - link->source->entity->parent + link->source->entity->graph_obj.mdev @@ struct exynos_video_entity *ve; @@ - ve->vdev.entity.parent + ve->vdev.entity.graph_obj.mdev Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: rename the function that create pad linksMauro Carvalho Chehab
With the new API, a link can be either between two PADs or between an interface and an entity. So, we need to use a better name for the function that create links between two pads. So, rename the such function to media_create_pad_link(). No functional changes. This patch was created via this shell script: for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] staging: omap4iss: get entity ID using media_entity_id()Javier Martinez Canillas
Accessing media_entity ID should now use media_entity_id() macro to obtain the entity ID, as a next patch will remove the .id field from struct media_entity . So, get rid of it, otherwise the omap4iss driver will fail to build. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab
Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-18[media] media: videobuf2: Move timestamp to vb2_bufferJunghak Sung
Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-18[media] vb2: drop v4l2_format argument from queue_setupHans Verkuil
The queue_setup callback has a void pointer that is just for V4L2 and is the pointer to the v4l2_format struct that was passed to VIDIOC_CREATE_BUFS. The idea was that drivers would use the information from that struct to buffers suitable for the requested format. After the vb2 split series this pointer is now a void pointer, which is ugly, and the reality is that all existing drivers will effectively just look at the sizeimage field of v4l2_format. To make this more generic the queue_setup callback is changed: the void pointer is dropped, instead if the *num_planes argument is 0, then use the current format size, if it is non-zero, then it contains the number of requested planes and the sizes array contains the requested sizes. If either is unsupported, then return -EINVAL, otherwise use the requested size(s). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: omap4iss: Make module stop timeout print a warning messageLaurent Pinchart
Module stop timeouts are serious enough that they deserve a proper warning message, not a debug message that will go unnoticed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: omap4iss: csi2: Fix IRQ handling when stopping moduleLaurent Pinchart
When stopping the CSI2 receiver the s_stream handler will wait for the IRQ handler to notice the stop request. The receiver, automatically disabled by the hardware after each frame, is then not reenabled by the IRQ handler as it returns immediately. As the IRQ handler check is performed before handling the context IRQ, the context IRQ source isn't cleared, and the CSI2 IRQ is then fired again immediately. The IRQ handler then fails to notice that the module is being stopped, processes the IRQ normally and reenables the CSI2 hardware. The problem goes unnoticed at stream stop time, but depending on the IRQ and s_stream scheduling timings, the CSI2 receiver can end up being hanged and will not produce any interrupt the next time it gets enabled, despite being soft-reset then. Fix this by checking for module stop after clearing the context IRQ source. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] omap4iss: Fix overlapping luma/chroma planesNate Weibley
The chroma data base address for NV12 formatted data should begin offset rows*bytes_per_row from the base address for luminance data. We were OBO causing a stripe of green pixels at the bottom of the frame. Signed-off-by: Nate Weibley <nweibley@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] staging: omap4iss: Compiling V4L2 framework and I2C as modules is fineSakari Ailus
Don't require V4L2 framework and I2C being linked to the kernel directly. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] include/media: move platform_data to linux/platform_data/mediaMauro Carvalho Chehab
Let's not mix platform_data headers with the core headers. Instead, let's create a subdir at linux/platform_data and move the headers to that common place, adding it to MAINTAINERS. The headers were moved with: mkdir include/linux/platform_data/media/; git mv include/media/gpio-ir-recv.h include/media/ir-rx51.h include/media/mmp-camera.h include/media/omap1_camera.h include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h include/media/soc_camera_platform.h include/media/timb_radio.h include/media/timb_video.h include/linux/platform_data/media/ And the references fixed with this script: MAIN_DIR="linux/platform_data/" PREV_DIR="media/" DIRS="media/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2015-11-05Merge tag 'media/v4.4-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: "Media updates, including: - Lots of improvements at the kABI documentation - Split of Videobuf2 into a common part and a V4L2 specific one - Split of the VB2 tracing events into a separate header file - s5p-mfc got support for Exynos 5433 - v4l2 fixes for 64-bits alignment when running 32 bits userspace on ARM - Added support for SDR radio transmitter at core, vivid and hackrf drivers - Some y2038 fixups - Some improvements at V4L2 colorspace support - saa7164 converted to use the V4L2 core control framework - several new boards additions, cleanups and fixups PS: There are two patches for scripts/kernel-doc that are needed by the documentation patches on Media. Jon is OK on merging those via my tree" * tag 'media/v4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (146 commits) [media] c8sectpfe: Remove select on CONFIG_FW_LOADER_USER_HELPER_FALLBACK [media] DocBook media: update copyright/version numbers [media] ivtv: Convert to get_user_pages_unlocked() [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL [media] DocBook media: Fix a typo in encoder cmd [media] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR [media] DocBook: add SDR specific info to G_TUNER / S_TUNER [media] hackrf: do not set human readable name for formats [media] hackrf: add support for transmitter [media] hackrf: switch to single function which configures everything [media] hackrf: add control for RF amplifier [media] DocBook: add modulator type field [media] v4l: add type field to v4l2_modulator struct [media] DocBook: document SDR transmitter [media] v4l2: add support for SDR transmitter [media] DocBook: document tuner RF gain control [media] v4l2: add RF gain control [media] v4l2: rename V4L2_TUNER_ADC to V4L2_TUNER_SDR [media] media/vivid-osd: fix info leak in ioctl [media] media: videobuf2: Move v4l2-specific stuff to videobuf2-v4l2 ...
2015-10-27staging: media: omap4iss: Fixes line breakAmarjargal Gundjalam
This patch fixes the checkpatch issue: CHECK: Logical continuations should be on the previous line Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: media: omap4iss: Matches alignment with open parenthesisAmarjargal Gundjalam
This patch fixes some of the checkpatch issue: CHECK: Alignment should match open parenthesis Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: media: omap4iss: Removes unnecessary blank linesAmarjargal Gundjalam
This patch fixes checkpatch issues: CHECK: Blank lines aren't necessary before a close brace '}' CHECK: Please don't use multiple blank lines Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: media: omap4iss: Replaces bit shift on 1 with BIT MacroAmarjargal Gundjalam
This patch fixes some of the checkpatch issue: CHECK: Prefer using the BIT macro Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: media: omap4iss: Fixes misspellingAmarjargal Gundjalam
This patch fixes the checkpatch issue: CHECK: 'splitted' may be misspelled - perhaps 'split'? Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: media: omap4iss: Fixes NULL comparisonAmarjargal Gundjalam
This patch fixes the checkpatch issue: CHECK: Comparison to NULL could be written Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-20[media] media: videobuf2: Change queue_setup argumentJunghak Sung
Replace struct v4l2_format * with void * to make queue_setup() for common use. And then, modify all device drivers related with this change. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix missing const in fimc-lite.c] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>