aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-03-22[media] v4l: Create v4l2 subdev file handle structureStanimir Varbanov3-27/+96
Used for storing subdev information per file handle and hold V4L2 file handle. Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Antti Koskipaa <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Group media bus pixel codes by types and sort them alphabeticallyLaurent Pinchart1-31/+46
Adding new pixel codes at the end of the enumeration will soon create a mess, so group the pixel codes by type and sort them by bus_width, bits per component, samples per pixel and order of subsamples. As the codes are part of the kernel ABI their value can't change when a new code is inserted in the enumeration, so they are given an explicit numerical value. When inserting a new pixel code developers must use and update the next free value. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Rename V4L2_MBUS_FMT_GREY8_1X8 to V4L2_MBUS_FMT_Y8_1X8Laurent Pinchart6-13/+13
For consistency with the V4L2_MBUS_FMT_Y10_1X10 format. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Replace enums with fixed-sized fields in public structureLaurent Pinchart1-8/+9
The v4l2_mbus_framefmt structure will be part of the public userspace API and used (albeit indirectly) as an ioctl argument. As such, its size must be fixed across userspace ABIs. Replace the v4l2_field and v4l2_colorspace enums by __u32 fields and add padding for future enhancements. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Move the media/v4l2-mediabus.h header to include/linuxLaurent Pinchart4-62/+81
The header defines the v4l2_mbus_framefmt structure which will be used by the V4L2 subdevs userspace API. Change the type of the v4l2_mbus_framefmt::code field to __u32, as enum sizes can differ between different ABIs on the same architectures. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Make v4l2_subdev inherit from media_entityLaurent Pinchart4-6/+87
V4L2 subdevices are media entities. As such they need to inherit from (include) the media_entity structure. When registering/unregistering the subdevice, the media entity is automatically registered/unregistered. The entity is acquired on device open and released on device close. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Make video_device inherit from media_entityLaurent Pinchart3-7/+87
V4L2 devices are media entities. As such they need to inherit from (include) the media_entity structure. When registering/unregistering the device, the media entity is automatically registered/unregistered. The entity is acquired on device open and released on device close. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] v4l: Add a media_device pointer to the v4l2_device structureLaurent Pinchart3-11/+23
The pointer will later be used to register/unregister media entities when registering/unregistering a v4l2_subdev or a video_device. With the introduction of media devices, device drivers need to store a pointer to a driver-specific structure in the device's drvdata. v4l2_device can't claim ownership of the drvdata anymore. To maintain compatibility with drivers that rely on v4l2_device storing a pointer to itself in the device's drvdata, v4l2_device_register() will keep doing so if the drvdata is NULL. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Pipelines and media streamsLaurent Pinchart6-0/+130
Drivers often need to associate pipeline objects to entities, and to take stream state into account when configuring entities and links. The pipeline API helps drivers manage that information. When starting streaming, drivers call media_entity_pipeline_start(). The function marks all entities connected to the given entity through enabled links, either directly or indirectly, as streaming. Similarly, when stopping the stream, drivers call media_entity_pipeline_stop(). The media_entity_pipeline_start() function takes a pointer to a media pipeline and stores it in every entity in the graph. Drivers should embed the media_pipeline structure in higher-level pipeline structures and can then access the pipeline through the media_entity structure. Link configuration will fail with -EBUSY by default if either end of the link is a streaming entity, unless the link is marked with the MEDIA_LNK_FL_DYNAMIC flag. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Links setupLaurent Pinchart9-0/+356
Create the following ioctl and implement it at the media device level to setup links. - MEDIA_IOC_SETUP_LINK: Modify the properties of a given link The only property that can currently be modified is the ENABLED link flag to enable/disable a link. Links marked with the IMMUTABLE link flag can not be enabled or disabled. Enabling or disabling a link has effects on entities' use count. Those changes are automatically propagated through the graph. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Entities, pads and links enumerationLaurent Pinchart8-24/+731
Create the following two ioctls and implement them at the media device level to enumerate entities, pads and links. - MEDIA_IOC_ENUM_ENTITIES: Enumerate entities and their properties - MEDIA_IOC_ENUM_LINKS: Enumerate all pads and links for a given entity Entity IDs can be non-contiguous. Userspace applications should enumerate entities using the MEDIA_ENT_ID_FLAG_NEXT flag. When the flag is set in the entity ID, the MEDIA_IOC_ENUM_ENTITIES will return the next entity with an ID bigger than the requested one. Only forward links that originate at one of the entity's source pads are returned during the enumeration process. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Media device information queryLaurent Pinchart9-0/+526
Create the following ioctl and implement it at the media device level to query device information. - MEDIA_IOC_DEVICE_INFO: Query media device information The ioctl and its data structure are defined in the new kernel header linux/media.h available to userspace applications. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Entity use countLaurent Pinchart5-0/+73
Due to the wide differences between drivers regarding power management needs, the media controller does not implement power management. However, the media_entity structure includes a use_count field that media drivers can use to track the number of users of every entity for power management needs. The use_count field is owned by media drivers and must not be touched by entity drivers. Access to the field must be protected by the media device graph_mutex lock. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Entity graph traversalSakari Ailus3-0/+172
Add media entity graph traversal. The traversal follows enabled links by depth first. Traversing graph backwards is prevented by comparing the next possible entity in the graph with the previous one. Multiply connected graphs are thus not supported. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Vimarsh Zutshi <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Entities, pads and linksLaurent Pinchart7-1/+516
As video hardware pipelines become increasingly complex and configurable, the current hardware description through v4l2 subdevices reaches its limits. In addition to enumerating and configuring subdevices, video camera drivers need a way to discover and modify at runtime how those subdevices are connected. This is done through new elements called entities, pads and links. An entity is a basic media hardware building block. It can correspond to a large variety of logical blocks such as physical hardware devices (CMOS sensor for instance), logical hardware devices (a building block in a System-on-Chip image processing pipeline), DMA channels or physical connectors. A pad is a connection endpoint through which an entity can interact with other entities. Data (not restricted to video) produced by an entity flows from the entity's output to one or more entity inputs. Pads should not be confused with physical pins at chip boundaries. A link is a point-to-point oriented connection between two pads, either on the same entity or on different entities. Data flows from a source pad to a sink pad. Links are stored in the source entity. To make backwards graph walk faster, a copy of all links is also stored in the sink entity. The copy is known as a backlink and is only used to help graph traversal. The entity API is made of three functions: - media_entity_init() initializes an entity. The caller must provide an array of pads as well as an estimated number of links. The links array is allocated dynamically and will be reallocated if it grows beyond the initial estimate. - media_entity_cleanup() frees resources allocated for an entity. It must be called during the cleanup phase after unregistering the entity and before freeing it. - media_entity_create_link() creates a link between two entities. An entry in the link array of each entity is allocated and stores pointers to source and sink pads. When a media device is unregistered, all its entities are unregistered automatically. The code is based on Hans Verkuil <[email protected]> initial work. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Media deviceLaurent Pinchart8-1/+304
The media_device structure abstracts functions common to all kind of media devices (v4l2, dvb, alsa, ...). It manages media entities and offers a userspace API to discover and configure the media device internal topology. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-22[media] media: Media device node supportLaurent Pinchart4-0/+436
The media_devnode structure provides support for registering and unregistering character devices using a dynamic major number. Reference counting is handled internally, making device drivers easier to write without having to solve the open/disconnect race condition issue over and over again. The code is based on video/v4l2-dev.c. [[email protected]: Remove linux/smp_lock.h include to not break compilation on bisect] Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: subdev: Events supportSakari Ailus3-1/+105
Provide v4l2_subdevs with v4l2_event support. Subdev drivers only need very little to support events. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: David Cohen <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: subdev: Control ioctls supportLaurent Pinchart2-0/+41
Pass the control-related ioctls to the subdev driver through the control framework. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: subdev: Uninline the v4l2_subdev_init functionLaurent Pinchart2-26/+30
The function isn't small or performance sensitive enough to be inlined. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: subdev: Add device node supportLaurent Pinchart8-22/+158
Create a device node named subdevX for every registered subdev. As the device node is registered before the subdev core::s_config function is called, return -EGAIN on open until initialization completes. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Vimarsh Zutshi <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: subdev: Don't require core operationsLaurent Pinchart1-2/+1
There's no reason to require subdevices to implement the core operations. Remove the check for non-NULL core operations when initializing the subdev. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: Share code between video_usercopy and video_ioctl2Laurent Pinchart1-98/+11
The two functions are mostly identical. They handle the copy_from_user and copy_to_user operations related with V4L2 ioctls and call the real ioctl handler. Create a __video_usercopy function that implements the core of video_usercopy and video_ioctl2, and call that function from both. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] v4l: videobuf2: Typo fixLaurent Pinchart1-1/+1
vb2_get_plane_payload() gets the bytesused field for a plane, it doesn't set it. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] drivers:media:cx231xx.h remove one to many l's in the wordJustin P. Mattock1-1/+1
The patch below removes an extra "l" in the word. Signed-off-by: Justin P. Mattock <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] drivers:media:cx23418.h remove one to many l's in the wordJustin P. Mattock1-1/+1
The patch below removes an extra "l" in the word. Signed-off-by: Justin P. Mattock <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] staging/cx25721: serialize access to devlistArnd Bergmann5-16/+15
Out of the three files accessing the device list, one uses a mutex, one uses the BKL and one does not have any locking. That is of course pointless, so let's make all of them use the same mutex, and get rid of one more BKL user. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Palash Bandyopadhyay <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] tm6000: add audio conf for new cardsDmitri Belimov1-0/+4
Add configuration of an audio for our new TV cards. With my best regards, Dmitry. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dw2102: prof 1100 correctedIgor M. Liplianin1-9/+16
Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dw2102: i2c transfer corrected for yet another cardsIgor M. Liplianin1-2/+1
Related to Acorp DS120 and some revisions of DVBWorld DW2102. If you read three or more registers at one time, you get wrong value for third etc. Actually, it didn't affect the driver as it reads registers only by one at a time. But it needs to correct. Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dw2102: i2c transfer corrected for some cardsIgor M. Liplianin1-5/+5
Prof 7500 and TeVii s630, s660, s480 works better now Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dw2102: remove unnecessary delays for i2c transfer for some cardsIgor M. Liplianin1-2/+0
Prof 7500 and TeVii s630, s660, s480 works faster now Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dw2102: X3M TV SPC1400HD addedIgor M. Liplianin1-1/+6
The card consist of PCI to USB bridge and USB DVB-S2 receiver. Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] ds3000: wrong hardware tune function implementedIgor M. Liplianin1-2/+13
It is taken from another tree, where it is modified. Patch to fix that Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] stv0900: Update status when LOCK is missedAbylay Ospan1-0/+1
Signed-off-by: Abylay Ospan <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] stv0900: speed up DVB-S searchingIgor M. Liplianin1-0/+3
Simptoms: After zapping DVB-S2 channel searching for DVB-S tooks long time. Now it takes less than a second. Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] cx23885, altera-ci: remove operator return <value> in void procedureIgor M. Liplianin1-2/+0
Signed-off-by: Igor M. Liplianin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dib9000: fix return type in dib9000_mbx_send_attr()Dan Carpenter1-1/+2
dib9000_mbx_send_attr() returns an int. It doesn't work to save negative error codes in an unsigned char, so I've made "ret" an int type. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] dib8000: fix small memory leak on errorDan Carpenter1-1/+1
kfree(state) if fe allocation fails. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] ASoC: WL1273 FM radio: Access I2C IO functions through pointersMatti Aaltonen2-4/+9
These changes are needed to keep up with the changes in the MFD core and V4L2 parts of the wl1273 FM radio driver. Use function pointers instead of exported functions for I2C IO. Also move all preprocessor constants from the wl1273.h to include/linux/mfd/wl1273-core.h. Also update the year in the copyright statement. Signed-off-by: Matti J. Aaltonen <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] V4L2: WL1273 FM Radio: TI WL1273 FM radio driverMatti Aaltonen1-254/+106
This module implements V4L2 controls for the Texas Instruments WL1273 FM Radio and handles the communication with the chip. Signed-off-by: Matti J. Aaltonen <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] MFD: WL1273 FM Radio: MFD driver for the FM radioMatti Aaltonen3-4/+149
This is the core of the WL1273 FM radio driver, it connects the two child modules. The two child drivers are drivers/media/radio/radio-wl1273.c and sound/soc/codecs/wl1273.c. The radio-wl1273 driver implements the V4L2 interface and communicates with the device. The ALSA codec offers digital audio, without it only analog audio is available. Signed-off-by: Matti J. Aaltonen <[email protected]> Acked-by: Samuel Ortiz <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] DocBook/v4l2.xml: Update version of the specMauro Carvalho Chehab1-0/+8
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] DocBook: Document the removal of the old VIDIOC_*_OLD ioctlsMauro Carvalho Chehab1-6/+14
Those ioctls passed away. Properly documented it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] videodev2.h.xml: Update to reflect videodev2.h changesMauro Carvalho Chehab1-12/+129
A few changes happened at videodev2.h: - Addition of multiplane API; - removal of VIDIOC_*_OLD ioctls; - a few more video standards. Update the file to reflect the latest changes. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21matrox: Remove legacy VIDIOC_*_OLD ioctlsMauro Carvalho Chehab1-3/+0
Those ioctls were produced by the wrong arguments for _IO macros, and were replaced by fixed versions on an early 2.6 kernel. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] media/radio/wl1273: fix build errorsRandy Dunlap1-0/+1
RADIO_WL1273 needs to make sure that the mfd core is built to avoid build errors: ERROR: "mfd_add_devices" [drivers/mfd/wl1273-core.ko] undefined! ERROR: "mfd_remove_devices" [drivers/mfd/wl1273-core.ko] undefined! Signed-off-by: Randy Dunlap <[email protected]> Cc: Matti Aaltonen <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] via-camera: Add suspend/resume supportDaniel Drake1-0/+64
Add suspend/resume support to the via-camera driver, so that the video continues streaming over a suspend-resume cycle. Originally implemented by Jon Corbet. [[email protected]: fix a small CodingStyle issue] Signed-off-by: Daniel Drake <[email protected]> Acked-by: Jonathan Corbet <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] Technisat AirStar TeleStick 2Lukas Max Fisch2-1/+7
Based on staging 2.6.39. This patch is based on Veit Berwig's work. Signed-off-by: Lukas Fisch <[email protected]> Thanks-to: Veit Berwig <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2011-03-21[media] stv090x: handle allocation failuresDan Carpenter1-1/+10
kmalloc() can fail so check whether state->internal is NULL. append_internal() can return NULL on allocation failures so check that. Also if we hit the error condition later in the function then there is a memory leak and we need to call remove_dev() to fix it. Also Oliver Endriss pointed out an additional leak that I missed in the first version of this patch. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Oliver Endriss <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>