android-sdk/kernel-video.git
7 years agov4l: ti-vps: vip: Different list_head for dequeue list vip
Nikhil Devshatwar [Mon, 28 Apr 2014 14:21:14 +0000 (19:51 +0530)]
v4l: ti-vps: vip: Different list_head for dequeue list

VIP driver maintains two lists
stream->vidq = List of buffers which are queued by user space (queue)
dev->vip_bufs = List of buffers waiting for DMA completion (dequeue)

At any point of time, a buffer would be present in only one of them.
But when buffers are dropped continously, and suddenly user space starts
queueing the buffers, some buffers need to be held by the dequeue list
even if they are already dequeued. This scenario causes list corruption
and eventually kernel crash.

Solution to this problem would be to use a different list for maintaining
buffers which are waiting for DMA. This would allow referencing the buffer
from both lists.

Change-Id: I5a615f32a183eecc33e01a3f71b2a4885be9b047
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Populate sequence number for frame
Nikhil Devshatwar [Mon, 28 Apr 2014 13:09:08 +0000 (18:39 +0530)]
v4l: ti-vps: vip: Populate sequence number for frame

When the capture driver is dropping frmaes, there is no way for user space
to identify wheather a frame is dropped or not.

struct v4l2_buffer has a field 'sequence' which should be populated with the
sequence number of the frame. A change in the sequence is suffiecient to know
the frame drop.

This patch fills in the stream->sequence in the vb2->v4l2_buf before dequeue.
The stream->sequence is incremented at every interrupt (Even for frame drops)

Change-Id: I00de4dac3afa200eed55a3ba3943c509a00d9323
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Handle short frames irqs
Nikhil Devshatwar [Sun, 6 Apr 2014 08:58:26 +0000 (14:28 +0530)]
v4l: ti-vps: vip: Handle short frames irqs

At any point of time, lists for FIFO_SIZE number of buffers are posted.
And driver expects those many distinct IRQs.

If a short frame comes, DMA for the frame would be completed immediately.
If VPDMA generates IRQ for short frame even before the IRQ for last frame
was cleared, both IRQs can be combined into one.

Once an IRQ is missed, number of buffers posted reduces by one.
This would lead to FIFO being empty, resulting in frame drop.

A better appraoch would be to post only one list in the streamON
In the IRQ handler, post for next buffer.
Do not dequeue the buffer only for first two IRQs

With this change, at any point of time, driver is posting only one list
So there is no chance of combining IRQs and leading to deadlock.

If a short frame occurs, only problem is that the next buffer would be missed
But capture continues as normal.

Change-Id: If5c8f09bc191fbe548543f7422740172a8d9e6a1
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Add gpio properties for fpdlink camera
Nikhil Devshatwar [Mon, 14 Apr 2014 11:11:16 +0000 (16:41 +0530)]
arm: dts: dra7xx: Add gpio properties for fpdlink camera

The gpios will be parsed and set by the driver before use.
CAMP_FPD_MUX_S0 is pcf_hdmi 3 0      (P0)
SEL_TVP_FPD_S0  is i2c1 pcf_lcd3 8 0 (P10)

Change-Id: I5f006286421764393707a26e26be91b861e4a942
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: fpdlink: Parse and set gpios in probe
Nikhil Devshatwar [Mon, 14 Apr 2014 11:04:24 +0000 (16:34 +0530)]
i2c: fpdlink: Parse and set gpios in probe

Signals from FPDlink deserializer on JAMR3 board is connected
to J6 EVM via two board muxes. These are driven by two gpios
camp_fpd_mux_s0 and sel_tvp_fpd_s0 signals.

This patch allows the driver to parse and sets the corresponding gpios
in probe and also in the set format callbcak.

Change-Id: If896fd0d9c385754aa9fbb3bdefabd9c98eae28b
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Populate field ID for interlaced capture
Nikhil Devshatwar [Fri, 11 Apr 2014 17:47:18 +0000 (23:17 +0530)]
v4l: ti-vps: vip: Populate field ID for interlaced capture

When capturing interlaced video, read field ID from the write descriptor
and populate the v4l2_buffer before dequeueing.

Reading field id through write descriptor is preferred over reading it
directly from parser register as the field ID can change anytime
while the frame is being parsed.

Change-Id: I09f6b01c1538431768c3df29be74ee862dbf8ccd
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: Use write desciptor bit in dtd
Nikhil Devshatwar [Fri, 11 Apr 2014 17:46:48 +0000 (23:16 +0530)]
v4l: ti-vps: vpdma: Use write desciptor bit in dtd

VPDMA can create a descriptor after an outbound descriptor is processed.
The output descriptor contains useful information like the width height
of the DMA transfer, Also it contains field id of the data.

update_dma_addr function changes the descriptor so that, every time the
write descriptor bit is set allowing the driver to read these properties.

Change-Id: I69db45fe86b79f00dbd6d0ab4ed42bd86a166782
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: Add enum for max width height
Nikhil Devshatwar [Fri, 11 Apr 2014 10:38:22 +0000 (16:08 +0530)]
v4l: ti-vps: vpdma: Add enum for max width height

Added enums for max_width and max_height fields of the
outbound data descriptor.

Changed vpdma_add_out_dtd to accept two more arguments
for max width and height.

Change-Id: Iab8b4dcbde618232af0369aa959a6c2abcfba387
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Dequeue only once while dropping
Nikhil Devshatwar [Tue, 8 Apr 2014 15:05:44 +0000 (20:35 +0530)]
v4l: ti-vps: vip: Dequeue only once while dropping

When buffers are dropped continuously, driver decrements the
buffer count and calls the buffer_ready.
Calling it multiple times is ok as long as buffer is dequeued only once
If user space queues back the same buffer while next buffers are being
dropped, calling buf_ready would actually dequeue the buffer immediately.

This patch adds a flag in the vip_buffer which would allow the driver to
dequeue the buffer(call buf_ready) only once.

Change-Id: I14b632451ee8894e6361cee493342cfb380f8111
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Improve buffer dropping logic
Nikhil Devshatwar [Fri, 4 Apr 2014 13:55:22 +0000 (19:25 +0530)]
v4l: ti-vps: vip: Improve buffer dropping logic

Current implemtation for dropping buffer allocates a struct vb2_buffer
(around 100 bytes) inside irq handler whenever a buffer has to be allocated.

A better approach can be used where the driver would mark the buffer as ready
for dequeing but not delete from the list.
On every interrupt, drop_count of the first buffer is decremented, if it
reaches zero, delete it from the list.

While queuing, initialize the count to 1 and when there is no buffer to post,
increment drop_count of last element in the posted list.

This approach works for both cases
    - user space completely stopped queueing buffers
    - user space is slow in queueing buffers (alternate drops)

Change-Id: Ieb8274e14ff61fc63e9cb7119c5a07c3ef66eb80
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Set max width height as capture size
Nikhil Devshatwar [Sat, 5 Apr 2014 06:31:23 +0000 (12:01 +0530)]
v4l: ti-vps: vip: Set max width height as capture size

When an outbound descriptor is created, max width and height for
VPDMA are set to 1920x1080
When cameras give out data more than the size allocated, it may lead
to buffer corruption.

This patch uses different max width & height sets for different slices
and overrides the descriptor with width & height same as capture size.

Change-Id: I55b8c3098abb8841d4aba26e01a30ff612424f20
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: tvp5158: Register subdevice only when analog camera detected
Nikhil Devshatwar [Thu, 3 Apr 2014 13:58:49 +0000 (19:28 +0530)]
i2c: tvp5158: Register subdevice only when analog camera detected

Registering a subdevice would mean that the camera is present
and the v4l2_device can use it and call subdev callbacks.
If the priority for the TVP camera is higher and no camera is connected,
Still it would be selected for capture resulting in a failure

This patch registers the subdevice only when the camera is detected and
signal is present.

Change-Id: I74ba9e399bf01a246fe7bc44f31482d203fd5c22
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: ov1063x: Fix probe failure for cam5,6
Nikhil Devshatwar [Wed, 26 Mar 2014 15:04:39 +0000 (20:34 +0530)]
i2c: ov1063x: Fix probe failure for cam5,6

For cam5 and cam6, ret was used uninitialized,
Therefore, cam5 and cam6 instances failed to probe
This patch fixes it by calling set_gpio correctly

Change-Id: I477d752113226b9716050126d11015b90f2fdcf1
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Fix multiple video device registration
Nikhil Devshatwar [Thu, 20 Mar 2014 14:46:17 +0000 (20:16 +0530)]
v4l: ti-vps: vip: Fix multiple video device registration

Video device should be registered once per stream
Currently, it is registered in the async_bound callback
This patch would register it only once per stream

This reverts commit 0aa59b0d94767ae65625be6afd9ff2cebe334021.

Change-Id: I3155771515901664af99a0b2bb4d4f6cbf0eb0e3
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Add optional ioctls for ctrl and std
Nikhil Devshatwar [Wed, 19 Mar 2014 10:34:48 +0000 (16:04 +0530)]
v4l: ti-vps: vip: Add optional ioctls for ctrl and std

Add optional ioctls to query/get/set input, controls and video standard
These ioctls always succeed returning 0

The s_input ioctls can be used later to allow switching between different
cameras at runtime.

Change-Id: I08019926d63f7ab15ac1245f33d320d7c518f096
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Remove delay in buf_prepare qop
Nikhil Devshatwar [Sat, 22 Mar 2014 14:07:41 +0000 (19:37 +0530)]
v4l: ti-vps: vip: Remove delay in buf_prepare qop

This delay isn't required for any of the reason
This increases queue time by 33ms for every queue.

buf_prepare gets called for every QBUF ioctl
Because of this, Queue latency increases and frames get dropped
when capturing at 60fps

Removing it as its not required

Change-Id: Ie1e2cd2630b019c32317461d82781cac516fce0e
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Keep LVDS cam2 disabled by default
Nikhil Devshatwar [Fri, 21 Mar 2014 20:32:42 +0000 (02:02 +0530)]
arm: dts: dra7xx: Keep LVDS cam2 disabled by default

On board level, vin2a singals are muxed with emac1 signals
Only one of them can be used at the same time
This patch disables LVDS cam2 by default

Change-Id: I7134d9e5062cbeabefd84883041ffb31055fd0f1
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: ov1063x: set vin2_s0 gpio only for LVDS cam2
Nikhil Devshatwar [Fri, 21 Mar 2014 19:35:06 +0000 (01:05 +0530)]
i2c: ov1063x: set vin2_s0 gpio only for LVDS cam2

vin2a_s0 gpio is needed only when LVDS cam2 is used
For other sensors, it should be don't care

Also, the CPLD muxes need to be changed only for cam1 and cam3
Only if cam2 is enabled, this gpio would be touched
All other sensors would not change the gpio

Change-Id: I2d873bacd7c72385d153c2b85e739cb58dc2f765
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoti-ec: Fix up the buffering logic
Sundar Raman [Fri, 21 Mar 2014 20:39:40 +0000 (15:39 -0500)]
ti-ec: Fix up the buffering logic

The buffering logic was having issues. It was using
only one buffer from the VIP driver. Moreover, the
start streaming and setformat apis were being called
every time. Fixed both these issues.

Change-Id: I7a07a01d27bb72aee29d2156635b30b34f40acc1
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: Use an array to communicate dma bufs
Sundar Raman [Fri, 21 Mar 2014 21:00:25 +0000 (16:00 -0500)]
v4l: ti-vps: vip: Use an array to communicate dma bufs

Early camera will require each buffer that is completed
to be available in the form of an array so that it can
index it using the buffer index and display it.
Add support for this.

Change-Id: I15e68bc3ee2d279567890f77eedcc6d77b1ef706
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: fix multiple vip_open issue
Sundar Raman [Fri, 21 Mar 2014 20:44:33 +0000 (15:44 -0500)]
v4l: ti-vps: vip: fix multiple vip_open issue

Sometimes the application tries to open the camera
multiple times. We should return proper error if
the driver is already open. Also, added some
NULL checks for file->private_data before calling
the fh close.

Change-Id: I56bde106c3090a0f7a6c711a399f23880d64b8b5
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoRevert "v4l: ti-vps: vip: Use a more safer api for releasing v4l fh"
Sundar Raman [Fri, 21 Mar 2014 20:46:15 +0000 (15:46 -0500)]
Revert "v4l: ti-vps: vip: Use a more safer api for releasing v4l fh"

This reverts commit d78c645d1d6549e1168b24a91c031b6b5192fcfb.

The patch had issues that v4l2_fh_release was also freeing the fh
using kfree which is incorrect. Also, the file pointer was not
passed as input to the api which was a bug.

Change-Id: I28f7bd5ca2bb5f0bd60f85d537cd1bbe8882955f
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: Use a more safer api for releasing v4l fh
Sundar Raman [Tue, 18 Mar 2014 20:27:10 +0000 (15:27 -0500)]
v4l: ti-vps: vip: Use a more safer api for releasing v4l fh

v4l2_fh_del is not NULL safe and crashes if fh is NULL.
Use v4L2_fh_release which checks for NULL and hence more
safer. In addition, it also calls v4l2_fh_exit internally
and as it is saves an additional invocation in code.

Change-Id: I270853d655bc611e35ac886e640860bd965675d4
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: Register the video device only if sensor is probed
Sundar Raman [Tue, 18 Mar 2014 20:23:23 +0000 (15:23 -0500)]
v4l: ti-vps: vip: Register the video device only if sensor is probed

The V4L devices should be registered only if the sensor is probed.
Move the registration logic to async bound callback from sensor
so that we are sure that the sensor is present before registering
the device.

Change-Id: Iaff635af794a42fe3a0c9ca7f9385314d4cd318e
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: switch verbose log from error to debug
Sundar Raman [Fri, 14 Mar 2014 19:02:26 +0000 (14:02 -0500)]
v4l: ti-vps: vip: switch verbose log from error to debug

Every time there are no free buffers in the driver, an error
message is constantly printed in the kernel console. This hogs
the cpu and thus slows down the entire system. Switch this print
to debug so that it can be enabled only whenever it's required.

Change-Id: I04ce1eec19b06ca11279303f840c268690e08785
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoti-ec: Adds the vip_s_fmt_vid_cap API
Arthur Philpott [Tue, 11 Mar 2014 23:17:38 +0000 (18:17 -0500)]
ti-ec: Adds the vip_s_fmt_vid_cap API

This patch is a temporary patch that hard codes
the parameters expected for an omnivision sensor
and passes those parameters to the vip_s_fmt_vid_cap
API

Change-Id: I8d7b50dc7b8efa01d54dec30bb3a0d94bd53936e
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: Export vip_s_fmt_vid_cap API
Arthur Philpott [Tue, 11 Mar 2014 23:16:16 +0000 (18:16 -0500)]
v4l: ti-vps: vip: Export vip_s_fmt_vid_cap API

This patch exports the vip_s_fmt_vid_cap API which
is needed by earlycamera module to ensure that the
proper GPIOs are configured for the appropriate
sensor.

Change-Id: I2b496622115cd1ce35d0355445368089bd8c6ab9
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: fpdlink: camera: Add fpdlink camera driver
Nikhil Devshatwar [Mon, 10 Mar 2014 18:12:08 +0000 (23:42 +0530)]
i2c: fpdlink: camera: Add fpdlink camera driver

It is possible to use output of FPDLink display as a camera
if it is connected to the deserializer of JAMR3 board.
Deserializer output is given to Vin1a

As, VIP can communicate with only subdevices, we need a subdevice to
use the fpdlink display as camera.

This patch adds a device tree node for the camera and the compatible driver.
The i2c driver for the fpdlink camera only registers a v4l2 subdevice
The display can be looped back from the same EVM or can come externally
via the FPDLink. In any case, deserializer configuration is done at the
remote end (serializer side), so this driver won't configure the deserializer.

Change-Id: I910aff26ff31444c38afda8fe5acd59ee2d8ec8f
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Add support for RGB capture
Nikhil Devshatwar [Mon, 10 Mar 2014 11:32:27 +0000 (17:02 +0530)]
v4l: ti-vps: vip: Add support for RGB capture

Add ARGB capture format (32 bits including alpha)
Corrected channel number to be used for RGB capture
Allow setting RGB_LO mux select from the slice

Currently, CSC is not enabled, so input and output formats are same
For now, RGB capture is only passthrough mode.

Change-Id: Ic8b2256607b0df21b7e34e58634b1de367d1d74a
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: Set background color
Nikhil Devshatwar [Thu, 27 Feb 2014 09:54:24 +0000 (15:24 +0530)]
v4l: ti-vps: vpdma: Set background color

If a VPDMA client doesn't provide data for any component, it is taken from
the background color register. e.g. for ARGB capture, alpha component
is not provided by VIP client.

VPDMA picks the value from this registers and repeats for all the pixels.

Change-Id: Ib61f7d632356492efa6479d4639b408d38c895db
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Add d16-d23 for vin1a
Nikhil Devshatwar [Fri, 7 Mar 2014 10:39:19 +0000 (16:09 +0530)]
arm: dts: dra7xx: Add d16-d23 for vin1a

For RGB capture to work, vin1a should be configured for 24bit interface
The d16-d23 pins conflict with vin2a pins
By default, this is commented, if using RGB camera, enable this and
disable the vin2a pins

Change-Id: Ia448b7c1d87584a2d083a2741931480f0789211a
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Device tree node for tvp5158
Sathishkumar S [Wed, 5 Mar 2014 14:57:05 +0000 (20:27 +0530)]
arm: dts: dra7xx: Device tree node for tvp5158

Add a dts entry for TVP5158 video decoder chip.

Change-Id: I183ddd42a4aa3cf621b66fc5c93c83a5924be60d
Signed-off-by: Sathishkumar S <sathish.omap@gmail.com>
7 years agoi2c: ov1063x: Free gpios after use
Sathishkumar S [Fri, 28 Feb 2014 11:16:35 +0000 (16:46 +0530)]
i2c: ov1063x: Free gpios after use

Request gpios with appropriate settings and
free them after use for other drivers, as
there are multiple sensors sharing the gpios

Change-Id: If2206fac8673dc8915e34da32d544e2b04e30c33
Signed-off-by: Sathishkumar S <sathish.omap@gmail.com>
7 years agoi2c: tvp5158: Analog camera Driver Support
Sathishkumar S [Tue, 25 Feb 2014 07:12:56 +0000 (12:42 +0530)]
i2c: tvp5158: Analog camera Driver Support

Add support for TVP5158 video decoder. This driver
does the default initialization for single channel
NTSC decode. It is tested with NTSC camera source.

Change-Id: Ida5a9b45414a917bd6f515882fe72a4b4b8e0947
Signed-off-by: Sathishkumar S <sathish.omap@gmail.com>
7 years agov4l: ti-vps: vip: Configure parser for chosen sensor
Nikhil Devshatwar [Thu, 27 Feb 2014 17:17:12 +0000 (22:47 +0530)]
v4l: ti-vps: vip: Configure parser for chosen sensor

Whenever a sensor (v4l2_subdev) is bound via async notifier,
save check the priority based on the index in the array

Maintain a pointer to the v4l2_endpoint of the chosen sensor in vip_dev
Added a new function to setup the parser according to the way sensor
interface is described in endpoint

Cuurently, only BT656 and parallel busses are suppoted
Following properties are set:
- hsync, vsync, actvid, pclk polarities
- Port interfaces and sync typei

Change-Id: Ib60a99d0901f69e72aff21cf0e12f23457b5f6a4
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Functions for setting parser props
Nikhil Devshatwar [Thu, 27 Feb 2014 17:14:02 +0000 (22:44 +0530)]
v4l: ti-vps: vip: Functions for setting parser props

Add helper functions for configuring the parser so that
pixel clock sampling and hsync method(using actvid) can be set

Change-Id: I0ff8d10345ac6024633279e5abfd509269b064c9
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Parse sensor endpoints in probe
Nikhil Devshatwar [Tue, 18 Feb 2014 08:24:50 +0000 (13:54 +0530)]
v4l: ti-vps: vip: Parse sensor endpoints in probe

Modified of_probe to iterate over all endpoints
Get the i2c address of the sensors (parent nodes of remote-endpoint)
Save all the parsed data in the v4l2_of_endpoint

Change-Id: I6290d1f8ae28aabc6d64a7ce2d3f1e1a774530b8
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Endpoint nodes for vip and i2c
Nikhil Devshatwar [Tue, 18 Feb 2014 06:00:32 +0000 (11:30 +0530)]
arm: dts: dra7xx: Endpoint nodes for vip and i2c

Following the binding doc video-interfaces
Every VIP has some ports - 0A and 1A
Every port can have multiple endpoints - one can be chosen to use

Added ports and endpoint nodes for all the sensor nodes
Sensor endpoints specify the interface used - hsync, vsync, etc
Order of endpoints still decides the priority

Change-Id: Ibcce7f477795942f60df2702444c4ae6fb185143
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: of: New property to specify number of channels
Nikhil Devshatwar [Tue, 25 Feb 2014 13:35:06 +0000 (19:05 +0530)]
v4l: of: New property to specify number of channels

For time multiplexed video signal, number of channels multiplexed
is specified by adding a new property 'num-channels' to the endpoint

Change-Id: Ic51e8e44ffb5838eca73e3d744faf33c3b3a5fd0
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: of: Drop acquired reference to node when getting next endpoint
Laurent Pinchart [Wed, 3 Jul 2013 02:05:51 +0000 (23:05 -0300)]
v4l: of: Drop acquired reference to node when getting next endpoint

The of_get_child_by_name() function takes a reference to the node it
returns. Make sure to drop it when looking for the ports node in
v4l2_of_get_next_endpoint().

Change-Id: I97a1a5cd4ea833ab52df498f96742899299bbb77
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: of: Use of_get_child_by_name()
Laurent Pinchart [Wed, 3 Jul 2013 02:04:25 +0000 (23:04 -0300)]
v4l: of: Use of_get_child_by_name()

Replace a manual loop through child nodes with a call to
of_get_child_by_name().

Change-Id: I97bbaa432368ff412ba7e10445aeb4c26bb7bb88
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoV4L: Remove incorrect EXPORT_SYMBOL() usage at v4l2-of.c
Sylwester Nawrocki [Tue, 2 Apr 2013 14:41:19 +0000 (11:41 -0300)]
V4L: Remove incorrect EXPORT_SYMBOL() usage at v4l2-of.c

v4l2_of_parse_parallel_bus() function is now static and
EXPORT_SYMBOL() doesn't apply to it any more. Drop this
meaningless statement, which was supposed to be done in
the original merged patch.
While at it, edit the copyright notice so it is sorted in
both the v4l2-of.c and v4l2-of.h file in newest entries
on top order, and state clearly I'm just the author of
parts of the code, not the copyright owner.

Change-Id: Ia1e11851844b15132b767fc862b6a432b87cdc95
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoAdd a V4L2 OF parser
Guennadi Liakhovetski [Wed, 26 Sep 2012 08:24:03 +0000 (05:24 -0300)]
Add a V4L2 OF parser

Add a V4L2 OF parser, implementing bindings documented in
Documentation/devicetree/bindings/media/video-interfaces.txt.
[s.nawrocki@samsung.com: various corrections and improvements
since the initial version]

Change-Id: If9df83c65e01ad3cf99fe403c7307d3935f41f85
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoAdd common video interfaces OF bindings documentation
Guennadi Liakhovetski [Tue, 11 Sep 2012 15:44:18 +0000 (12:44 -0300)]
Add common video interfaces OF bindings documentation

This patch adds a document describing common OF bindings for video
capture, output and video processing devices. It is curently mainly
focused on video capture devices, with data busses defined by
standards such as ITU-R BT.656 or MIPI-CSI2.
It also documents a method of describing data links between devices.

Change-Id: I4077340ca0c55b049513a1ee56ad698b528da5fb
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoti-ec: Create file pointer to interact with VIP directly
Arthur Philpott [Wed, 5 Mar 2014 21:49:34 +0000 (15:49 -0600)]
ti-ec: Create file pointer to interact with VIP directly

This moves to a new implementation where a file pointer
is created in the early_camera module.  This fp is used
to open and close an instance of the VIP as well as make
IOCTL calls directly.

Change-Id: I5c3c30b2f2c3f097a99c8eaef3979bfe2ce281e9
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: early_camera clean up
Arthur Philpott [Wed, 5 Mar 2014 21:47:11 +0000 (15:47 -0600)]
v4l: ti-vps: vip: early_camera clean up

This patch removes all references to the early_camera
module that was present in the previous implementation.
It also exports the vip_open and vip_release functions
so that the early_camera module is able to open
the VIP driver directly without altering it.

Change-Id: I8624b2e0c6a117179411fc7d7bfe2617d34a96f6
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: Separate vpdma lists for slices
Nikhil Devshatwar [Wed, 12 Feb 2014 11:45:20 +0000 (17:15 +0530)]
v4l: ti-vps: vip: Separate vpdma lists for slices

Use individual lists for different slices
Slice0 - uses int0 of VIP (only list0 enabled)
Slice1 - uses int1 of VIP (only list1 enabled)
Using slice_id to decide the irq_num and list_num
Correct the interrupt status reading and clearing logic

Change-Id: Ice44b99b1e51d3a16c95cd352d0f0802f20809f0
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Fix race condition between slices of VIP
Nikhil Devshatwar [Wed, 12 Feb 2014 15:11:07 +0000 (20:41 +0530)]
v4l: ti-vps: vip: Fix race condition between slices of VIP

First slice for which open gets called would allocate a shared struct
needed for VPDMA and other slice should start using that

But when both slices are opened one after another, both slices try to allocate
their own structures leading to a kernel crash
This happens because there isn't any lock
vip_driver_mutex would avoid the race condition between the two slices

Release the lock after initializing vpdma

Change-Id: I1afa6d86ab630c80624ae07afd4020f585532c6a
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: Add support for using all lists
Nikhil Devshatwar [Wed, 12 Feb 2014 10:46:34 +0000 (16:16 +0530)]
v4l: ti-vps: vpdma: Add support for using all lists

Current VPDMA library allows to submit descriptors for
no other than List 0
Sometimes using multiple lists is needed (multiple slice of VIP)
This patch allows to submit descriptors for all lists 0-7

Change-Id: I3766c974f26e15c8aaec6241de627cdfe066166d
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: Support all irqs of vpdma
Nikhil Devshatwar [Thu, 6 Feb 2014 08:07:26 +0000 (13:37 +0530)]
v4l: ti-vps: vpdma: Support all irqs of vpdma

Current VPDMA library uses only int0 of VPDMA
This patch adds support for using other interrupts of VPDMA

Change-Id: I84718f27c457d28478a06c6331216a259316e9bc
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Conflicts:
drivers/media/platform/ti-vps/vip.c

7 years agov4l: ti-vps: vip: Add support for both VIP slices
Nikhil Devshatwar [Wed, 12 Feb 2014 14:54:10 +0000 (20:24 +0530)]
v4l: ti-vps: vip: Add support for both VIP slices

Create a vip_dev per slice
Request resource and map register memory one time
Perform all dev initialization once per slice
Use different irqs for different slices
Return 0 if at least one slice is registered correctly

Use the same vip_shared for both slices - set as platform data
Save the devices allocated in shared structure
Use them to free when device is released

Change-Id: Ia03e5a85b4bc6df50381ef0595c23960adc115e4
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: correct setting active_low polarities
Nikhil Devshatwar [Wed, 22 Jan 2014 14:39:12 +0000 (20:09 +0530)]
v4l: ti-vps: vpdma: correct setting active_low polarities

Correct resetting bitfield logic  when polarity is zero
For active low signal, reset only the corresponding bit

Change-Id: I5a1a7139978379416b00194108345d297e1ea7ec
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Added pinmux for Vin2a and Vin6a
Nikhil Devshatwar [Wed, 8 Jan 2014 16:51:05 +0000 (22:21 +0530)]
arm: dts: dra7xx: Added pinmux for Vin2a and Vin6a

Not enabling Vin6a since it conflicts with the mcasp3

Change-Id: I854ab983f40d4ed4d1fe1c2878300e960e8f3da4
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: update global DMA address for earlycam
Arthur Philpott [Thu, 27 Feb 2014 22:41:15 +0000 (16:41 -0600)]
v4l: ti-vps: update global DMA address for earlycam

This patch ensures that the correct DMA address is
stored in the proper global variable utilized by
the earlycam module.

Change-Id: Ic7ce8963106581f58f251659d68c69c459037e47
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: ov1063x: change client address when LVDS is detected
Arthur Philpott [Thu, 27 Feb 2014 22:37:19 +0000 (16:37 -0600)]
i2c: ov1063x: change client address when LVDS is detected

This patch changes the client address of the attached
sensors to the serializers in order to prevent
scrambled images from being rendered onto the display.

Change-Id: I342d49ee874da3586dbff97be0867c34ad15b875
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: ov1063x: LVDS initial configuration changes
Arthur Philpott [Tue, 28 Jan 2014 20:05:09 +0000 (14:05 -0600)]
i2c: ov1063x: LVDS initial configuration changes

For the LVDS usecase setup there are several
registers that need to be configured initially
that differ from the single-cam instance. This
patch adds a flag that can be enabled in the
config file which will set the proper registers
initally for the LVDS usecase.

Change-Id: Ia5cee1a174a96f77a73fcd59c8e258e094674ac1
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: allow buffer drop when no buffers
Nikhil Devshatwar [Thu, 27 Feb 2014 15:34:16 +0000 (09:34 -0600)]
v4l: ti-vps: vip: allow buffer drop when no buffers

When the queued list is empty, driver doesn't post any of the list
start_dma(dev, NULL) would post for dropping the data If the list is
empty, Allocate a vip_buffer and add it to the list Inside irq
handler, free it if it has to be dropped

Change-Id: Iddea73ee5a6aad7ba86a82a63ccf26e729f61f04

7 years agov4l: ti-vps: vip: post vpdma list w/o sync_on_channel
Nikhil Devshatwar [Mon, 6 Jan 2014 19:27:00 +0000 (00:57 +0530)]
v4l: ti-vps: vip: post vpdma list w/o sync_on_channel

Change the design of posting vpdma descriptor lists as:

Descriptor posting:
- Populate the full descriptor (channel no, height, width) one time
- Do not add sync on channel descriptor
- For posting a desc list each time, update the dma address and
    reuse the same descriptor for posting list

Posting lists:
- In start_streaming, post lists for all the buffers till vpdma is busy
- Every time a descriptor is copied to FIFO, list complete irq is genereated
- Also, vpdma starts capturing data to the buffers immediately

Interrupt handling:
- Ignore all the interrupts till the FIFO is full
- Next interrupt indicates one more descriptor getting copied to FIFO
    This happens when the capture for the first descriptor in FIFO is done
    and FIFO shifts, This can be used as a signal for transfer complete
    of first descriptor
- Similarly, consider every (n+f)th irq as transfer complete of (n)th buffer
    Where 'f' is the size of FIFO

List handling:
- Maintain all queued buffers whose vpdma lists are NOT posted in stream->vidq
    'vip_buf_queue' would add into this list
- Maintain all queued buffers whose vpdma lists are posted in dev->vip_bufs
    * 'start_streaming' would post initial 'f' descriptor lists and
         transfer buffers from vidq to vip_bufs
    * 'vip_active_buf_next' would post descriptor for one more buffer and
          transfer one buffer each time
- stream->cur_buf maintains the buffers which need to be dequeued whenever next
    list complete irq occurs

Cleanup:
- Delete all the buffers from the vidq and vip_bufs in stop_streaming

Change-Id: Ice739c8aba77aa70e0d1768a6cc42e99cccd2039
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vpdma: New API to update start address
Nikhil Devshatwar [Mon, 6 Jan 2014 18:52:35 +0000 (00:22 +0530)]
v4l: ti-vps: vpdma: New API to update start address

If only one descriptor is used, dtds need not be added every time
This API allows updating the start address and option to drop the data

It will update the start assuming first descriptor in the list being an
outbound data descriptor

Change-Id: I34c27b95c24b532934cead4e273247ad28fb597f
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: code cleanup to remove compiler warnings
Arthur Philpott [Mon, 10 Feb 2014 21:28:39 +0000 (15:28 -0600)]
v4l: ti-vps: vip: code cleanup to remove compiler warnings

This patch provides code cleanup in order to remove
compiler warnings caused by VIP.

Change-Id: I483fcb32e1d1b424f7624f68beba1377680367bb
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: earlycam: added data tag to vip of_device_id
Arthur Philpott [Mon, 10 Feb 2014 20:20:15 +0000 (14:20 -0600)]
v4l: ti-vps: vip: earlycam: added data tag to vip of_device_id

Added data tag to vip of_device_id. This data tag
is used to allocate the early_dev and early_stream
exptected by the earlycamera driver only on VIP1
instance.

Change-Id: I474bb5ba2ad0c52d5c3260de6fb2aaa37511e20d
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vpdma: correct write desc mask
Nikhil Devshatwar [Mon, 6 Jan 2014 18:59:15 +0000 (00:29 +0530)]
v4l: ti-vps: vpdma: correct write desc mask

Write descriptor start address should be masked with [31:5] bits
instead of shifting the address

Change-Id: I7a5653134607a4305f60cad85e36b3f71e11b4f3
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoHACK: i2c: ov1063x: Set the pixel clock to 96MHz
Sathishkumar S [Mon, 6 Jan 2014 09:57:50 +0000 (15:27 +0530)]
HACK: i2c: ov1063x: Set the pixel clock to 96MHz

The LVDS camera pixel clock is pushed to 96Mhz in case
of 1280x720 capture. The PLL settings are hard-coded
for now. The same settings work for 1280x720 onboard
camera capture as well.

Change-Id: Id2bd8b9e7d783e4632f714962fe7009bebccb5b9
Signed-off-by: Sathishkumar S <x0203598@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: ov1063x: Write actual i2c address to 0x300c register
Nikhil Devshatwar [Tue, 24 Dec 2013 11:01:23 +0000 (16:31 +0530)]
i2c: ov1063x: Write actual i2c address to 0x300c register

0x300c should be written with actual i2c address.
Generally it is hard coded in the sensors
0x30 for OV10635 and 0x37 for OV10633

client->addr is just the alias, sensor doesn't know
about aliased i2c address

Change-Id: If58164b71067e0b1c0549f67293af7ca332907f2
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: vip: Get subdevice from device tree
Nikhil Devshatwar [Fri, 7 Feb 2014 16:16:03 +0000 (10:16 -0600)]
v4l: ti-vps: vip: Get subdevice from device tree

Instead of hard-coding VIP slice and sensor mapping,
Get it from device tree.
Parse 'sensor0' property and get the list of I2C clients.
Use the I2C client addresses for v4l2 subdev async notification.

Added subdev list in vip_dev node
- vip_of_probe parses all the i2c phandles
- Use the order of list as priority when multiple devices notify

Change-Id: I34068fb75a52fc86274d08e84bb319b35420dfe8
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agov4l: ti-vps: vip: Make driver compatible to vip2,3
Nikhil Devshatwar [Fri, 7 Feb 2014 16:12:58 +0000 (10:12 -0600)]
v4l: ti-vps: vip: Make driver compatible to vip2,3

VIP registers should be initialized once per device
- Remove static flag and use a per device flag
Fix kernel crash in release
- Call stop streaming to free all active buffers before releasing
Fix kernel crash in interrupt handler
- IRQs should be disabled in STREAMOFF and should be enabled again
Select pinmux explicitly to default

Change-Id: I2fd9b2b3783edf6de16b3b91732dee6203e0f3d2
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: ov1063x: Select muxes based on the connector
Nikhil Devshatwar [Thu, 5 Dec 2013 18:13:37 +0000 (23:43 +0530)]
i2c: ov1063x: Select muxes based on the connector

Don't select muxing GPIOs from sensor name
- Removed sensor_name from private data
Detect sensor connector from the I2C slave address
Request all GPIOs only once and set them before s_fmt
- Static flag to avoid multiple requests

Change-Id: Ic83e3b4d14d2fd423a709b4906212f71c4266cc3
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: ov1063x: Configure serializer and deserializer through sensor
Nikhil Devshatwar [Tue, 26 Nov 2013 16:40:25 +0000 (22:10 +0530)]
i2c: ov1063x: Configure serializer and deserializer through sensor

Parse serializer and deserializer i2c nodes for the sensor
Configure serdes using these i2c clients
Get gpios before calling video_probe
First setup deserializer, then power up sensor (init_sensor)
and then setup serializer

MUX changes to route serdes camera to Vin1a

Change-Id: I6528a3d8d730ad7586dbfe8054dd51e92c2f9a79
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: dra7xx: dummy driver for i2c expander
Nikhil Devshatwar [Thu, 28 Nov 2013 10:11:35 +0000 (15:41 +0530)]
i2c: dra7xx: dummy driver for i2c expander

Dummy Driver for enabling i2c expanders on vision board
I2C expander addresses conflict with HDMI receiver, so
Parse HDMI receiver node and resolve conflict

Change-Id: I932ae7b725c80a8a467382a636f565ac4c5f935c
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Update VIP2 and VIP3 interrupts
Nikhil Devshatwar [Wed, 27 Nov 2013 10:46:12 +0000 (16:16 +0530)]
arm: dts: dra7xx: Update VIP2 and VIP3 interrupts

Update interrupts for both slices of VIP2 and VIP3
Add reg property (Overrides hwmod values)

Change-Id: Ia4ab51fa423c8e5ede2babf8fc67df8807f1e2b3
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoarm: dts: dra7xx: Added pinmux for Vin3a and Vin5a
Nikhil Devshatwar [Fri, 7 Feb 2014 16:06:00 +0000 (10:06 -0600)]
arm: dts: dra7xx: Added pinmux for Vin3a and Vin5a

Don't add pinmux nodes to dra7_pmx_core directly
Add pinmux to pinctrl-0 of each VIP node

Added a new propery 'sensor0' to hold the phandle for the I2C device
of the sensor. This will be parsed for an I2C client corresponding to
the sensor used for capture.

Change-Id: Iade003ccef83d2dff41d002ad66ccf2047fef62d
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoarm: dts: dra7xx: Added i2c nodes for serdes
Nikhil Devshatwar [Fri, 7 Feb 2014 16:04:07 +0000 (10:04 -0600)]
arm: dts: dra7xx: Added i2c nodes for serdes

Added i2c slaves for
- Deserializer chip
- Serializer chip
- OV cameras connected through serdes
- I2C expander

All these are slaves on vision board and serdes daughter card.

Change-Id: Id29c1ea6e4d401633bc849a9c0d4383940103373
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoarm: dts: dra7_evm: initialize n_latch for reverse gpio to 1
Sundar Raman [Tue, 4 Feb 2014 15:25:50 +0000 (09:25 -0600)]
arm: dts: dra7_evm: initialize n_latch for reverse gpio to 1

Set the n_latch value for reverse gear gpio such that logic 1
is output during bootup since this is an input gpio

Resolves an issue with not detecting reverse gear if the
gpio is pressed before board reset

Change-Id: I115dddcd9519c56853ba23afae18be1e2045bfee
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoti-ec: remove the delay after gpio event
Sundar Raman [Tue, 4 Feb 2014 15:14:23 +0000 (09:14 -0600)]
ti-ec: remove the delay after gpio event

The issue with vip has been resolved and this
delay is no longer needed

Change-Id: I7f6be3f19e5a75d318c852121c74651c25c2c359
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoVIP: Early-Cam: Resolves empty buffer issue
Arthur Philpott [Thu, 30 Jan 2014 20:31:57 +0000 (14:31 -0600)]
VIP: Early-Cam: Resolves empty buffer issue

During bootup, the early camera driver was
competing with Android to open up an instance
of the VIP module. This patch eliminates that
race condition. It also adds a delay in the
vip_buf_prepare function in order for the buffers
to be populated on rapid triggering of the GPIO
interrupt pin.

Change-Id: Ib1a4dc8e9b4242b00dcb035ba1712197be132943
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoti-ec: Add GPIO detection for reverse gear
Sundar Raman [Wed, 29 Jan 2014 03:42:22 +0000 (21:42 -0600)]
ti-ec: Add GPIO detection for reverse gear

This patch adds in GPIO detection to simulate the
reverse gear engage and dis-enagage actions to launch
and close down the camera preview.

This currently uses a polling mechanism for getting to
known when the user pressed or release the gpio which
should be replaced by an interrupt based mechanism
later

Also, the VIP driver seems to be having issues in
closing and re-launching. It takes a long time to
shut down and restart. So, if we wait and re-launch
the camera, then it works properly. Otherwise, it
doesn't work.

Change-Id: Ia56d84673d2028c2bd8eb3089faa987de98ab72f
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoti-ec: Implement sensor detection
Sundar Raman [Thu, 30 Jan 2014 06:40:25 +0000 (00:40 -0600)]
ti-ec: Implement sensor detection

Detect if the sensor is present by querying
the VIP driver and proceed with the use-case.

Change-Id: I3919f844f6ad378ede6319ae17acaf1e29c3535c
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoVIP: Add an early sensor detect api
Sundar Raman [Thu, 30 Jan 2014 06:35:11 +0000 (00:35 -0600)]
VIP: Add an early sensor detect api

Sensor detection is required for early camera
as certain key resources such as pipeline and
the VIP are kept reserved for the early camera
use-case. In case the sensor is not present on
the board, we will have to detect that and bail
out without acquiring these resources. This patch
adds a sensor detection api for early camera
driver to query the presence of the sensor. It
does this by simply checking if the subdev
device pointer is populated in the device
structure and returning a boolean value to the
caller.

Change-Id: I2228517f0001decb486b5fa99f72d15428aad97e
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoVIP: Misc fixes for early interface
Sundar Raman [Thu, 30 Jan 2014 03:58:13 +0000 (21:58 -0600)]
VIP: Misc fixes for early interface

The address variables should be reset to NULL upon release.
vpdma list descriptor should be freed upon port closure.

Change-Id: I9b72eafc4759ab4e53bcb2d816a65788cbd45f63
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoVIP: Disable irqs after vip release
Sundar Raman [Thu, 30 Jan 2014 01:57:08 +0000 (19:57 -0600)]
VIP: Disable irqs after vip release

disable_irqs should be called to prevent any irqs
from occuring after the vip has been released.
This resolved a crash seen after early_release
was called due to a pending VIP interrupt.

Change-Id: I1a45538fa3672fd06e1c238a12a2f1d5248e2e79
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoti-ec: Add early camera module
Sundar Raman [Thu, 26 Dec 2013 19:24:26 +0000 (13:24 -0600)]
ti-ec: Add early camera module

This patch adds the early camera kernel module. This
launches early during bootup (<2s) and configures the
VIP and DSS to show camera preview intended to be used
as rear view camera in a car. This module uses VIP
kernel export APIs for configuring VIP and uses
multiple buffers for camera frames. It also uses the
DSS2 apis directly, and the VID3 pipe for posting
camera frames to the display.

This module currently displays around 1000 frames
and runs all the way into the android bootup which
happens in the background and shuts itself off
after it's done.

This will be further enhanced to add a GPIO to
launch the rearview camera on-demand.

Change-Id: I3d55fe6e2b0abebe19dcf4781d4d244ce737185f
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agoVIP: Added support for early camera usecase
Arthur Philpott [Mon, 20 Jan 2014 19:11:15 +0000 (13:11 -0600)]
VIP: Added support for early camera usecase

Ported the need V4L2 functionality over to kernel
side in order to support the early camera usecase.

Change-Id: I45d98cf1c13ccdb1d802fbb1cbe0caed1162adb2
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoVIP: Deferred initializations to vip_open and beyond
Sundar Raman [Mon, 18 Nov 2013 22:26:50 +0000 (16:26 -0600)]
VIP: Deferred initializations to vip_open and beyond

Moved VIP and subdev initializations to vip_open and
beyond so as not to create conflict with early
camera from ipu.

Change-Id: Icb91a7cb938662fe0b0334636b40a3a339e4451c
Signed-off-by: Sundar Raman <sunds@ti.com>
7 years agov4l: ti-vps: vip: support for dmabuf importing
Nikhil Devshatwar [Mon, 11 Nov 2013 06:01:31 +0000 (11:31 +0530)]
v4l: ti-vps: vip: support for dmabuf importing

This patch enhances TI vip driver with a support for importing a buffer
from DMABUF file descriptors.

Change-Id: Ie2e14451a9d48781990236d1201795c9f8a08e14
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: Export vpdma functions
Nikhil Devshatwar [Mon, 11 Nov 2013 10:06:08 +0000 (15:36 +0530)]
v4l: ti-vps: Export vpdma functions

This patch exports the functions provided by
VPDMA library, so that they can be used by VIP/VPE modules

Change-Id: I6b81d47528134d28e50641c116edb3f7e0961dc6
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l: ti-vps: Do not add objects in ti-vps from outside
Nikhil Devshatwar [Thu, 24 Oct 2013 15:26:42 +0000 (20:56 +0530)]
v4l: ti-vps: Do not add objects in ti-vps from outside

This patch fixes the build error when kernel is compiled with
make O=.build flag
It adds the ti-vps/Makefile always, and depending on the config,
ti-vip / ti-vpe  vpdma will be selected.

Change-Id: Idedf01b3268c6960598db2ede729b562573e07ca
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoi2c: Create generic driver for Omnivision Sensors
Arthur Philpott [Tue, 26 Nov 2013 20:10:06 +0000 (14:10 -0600)]
i2c: Create generic driver for Omnivision Sensors

Renamed ov10635.c to ov1063x.c to make it generic
to omnivision sensors. This patch also makes changes
to the initial register configuration which was needed
to enable the onboard LI-OV10633 sensor.

Change-Id: I00d9cee6f4b032671b07fd8cfb94988e13262c02
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoDTS: Default to onboard OV10633 sensor
Arthur Philpott [Tue, 12 Nov 2013 16:02:30 +0000 (10:02 -0600)]
DTS: Default to onboard OV10633 sensor

If both OV10633 and OV10635 sensors are attached
this ordering will ensure that the onboard sensor
is probed first, thus enabling it by default.

Change-Id: Ica087ad6a58441d2cd6df892c197a460a61bae54
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoVIP: Added support for OV10633 sensor
Arthur Philpott [Tue, 12 Nov 2013 15:49:04 +0000 (09:49 -0600)]
VIP: Added support for OV10633 sensor

Added new v4l2_async_subdev for the OV10633
sensor support.

Change-Id: I2f904c10ca1d4d563d6f944a9765459f8c742372
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoVPDMA: Create Load Kernel VPDMA F/W flag
Arthur Philpott [Wed, 30 Oct 2013 18:49:11 +0000 (13:49 -0500)]
VPDMA: Create Load Kernel VPDMA F/W flag

Create Load Kernel VPDMA F/W flag in order to specify
whether the VPDMA F/W will be loaded from kernel.

Change-Id: If510eca81b30847534fd2a4a2e4593732cf03b16
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoDTS: Added ov10633 sensor support to the DTS file
Arthur Philpott [Fri, 25 Oct 2013 21:57:27 +0000 (16:57 -0500)]
DTS: Added ov10633 sensor support to the DTS file

-Created new entry for ov10633 support
-Removed camera module from VIP handle and placed along
 with sensors

Change-Id: I738f907ff2b33fc842c67dc13d4421037da20a17
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: ov10635: Added support for the OV10633 sensor
Arthur Philpott [Fri, 25 Oct 2013 21:51:33 +0000 (16:51 -0500)]
i2c: ov10635: Added support for the OV10633 sensor

-Added support for the OV10633 sensor
-Added GPIO configurations to toggle mux settings
 for the OV1063x sensors

Change-Id: Ia28d8d69687a80c9aa2dac9d44eb2b23958adeff
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoVIP: Remove GPIO configuration for OV1063x sensors
Arthur Philpott [Fri, 25 Oct 2013 21:50:12 +0000 (16:50 -0500)]
VIP: Remove GPIO configuration for OV1063x sensors

The GPIO configurations for the OV1063x sensors have
been removed from the VIP driver to keep the framework
generic.

Change-Id: I51a9aa57f903cfc64fe99c62817530471bd8f9f5
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoVPDMA FW: Include VPDMA FW in kernel firmware directory.
Arthur Philpott [Thu, 17 Oct 2013 23:41:11 +0000 (18:41 -0500)]
VPDMA FW: Include VPDMA FW in kernel firmware directory.

Ease deployment and include the VPDMA firmware in build/install.

Change-Id: I28449361aa19e2c328c2e583d2faaac51a5d6ed5
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoMerge branch 'vip' into p-ti-linux-3.8.y-video
Arthur Philpott [Tue, 15 Oct 2013 22:17:51 +0000 (17:17 -0500)]
Merge branch 'vip' into p-ti-linux-3.8.y-video

This merge contains all of the VIP changes.
It enables functionality of the OV10635
sensor. It also combines the VIP and VPE
into one common directory in order to utilize
the shared VPDMA library.

* vip:
  i2c: Add support for OV10635 sensor
  VIP: Added Support for OV10635 sensor
  i2c: Added device tree support for OV10635 sensor
  v4l2: Added v4l2 asynchronous probing capabilities
  VIP: Add device tree support for VIP
  Added Kconfig for vpdma
  VIP: Initial version of DRA7xx VIP driver

Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
7 years agoi2c: Add support for OV10635 sensor
Arthur Philpott [Mon, 9 Sep 2013 22:18:31 +0000 (17:18 -0500)]
i2c: Add support for OV10635 sensor

Added driver support for OV10635 sensor.

Change-Id: I3971f746366c82abd536c3179884cb30599fcb13
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
[Fixed checkpatch error]
Signed-off-by: Somnath Mukherjee <somnath@ti.com>
7 years agoVIP: Added Support for OV10635 sensor
Arthur Philpott [Mon, 9 Sep 2013 22:23:30 +0000 (17:23 -0500)]
VIP: Added Support for OV10635 sensor

Added support for OV10635 sensor in the VIP driver.

Change-Id: Ie9d16f02add9d16c9686abafff5fbf36218b4304
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
[Fixed checkpatch error]
Signed-off-by: Somnath Mukherjee <somnath@ti.com>
7 years agoi2c: Added device tree support for OV10635 sensor
Arthur Philpott [Mon, 9 Sep 2013 22:19:29 +0000 (17:19 -0500)]
i2c: Added device tree support for OV10635 sensor

-Added device tree support for OV10635 sensor.
-Disabled HDMI because there is a conflict between
 HDMI and VIP muxing on the pc8575.

Change-Id: I8309e3339e7a876a9b9562b0c25d8030812de51d
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agov4l2: Added v4l2 asynchronous probing capabilities
Arthur Philpott [Mon, 9 Sep 2013 22:15:48 +0000 (17:15 -0500)]
v4l2: Added v4l2 asynchronous probing capabilities

Added v4l2 asynchronous probing capabilities.

Change-Id: I9ed6f0d1f056b79d2bd66e668f65ac129d1d631e
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 years agoVIP: Add device tree support for VIP
Arthur Philpott [Mon, 9 Sep 2013 19:17:08 +0000 (14:17 -0500)]
VIP: Add device tree support for VIP

Add device tree support for VIP.

Change-Id: Iefbae706f8186698500df6d2942a9775f50f2fba
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>