connectivity.cfg: make advanced networking features as modules

Linux networking supports advanced networking features like IPSEC, NETFILTERS,
BRIDGING etc and should be enabled only when user has specific usecase to
use them. Thats why all typical distros build them as modules so that all
the standard network usecases don't get any additional overhead and specific
case can load those modules when needed.

Lets align the config accordingly.

nsekhar@ti.com:
 * cherry-picked from TI's v3.12 tree.
 * updated to follow the v3.14 config fragment model
 * removed non-relevant config changes resulting from savedefconfig
 * tested on AM437x GP EVM. Ethernet performance went up from ~300Mbps
   to ~385Mbs on that platform.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  connectivity.cfg: make advanced networking features as modules

Signed-off-by: Dan Murphy <DMurphy@ti.com>
arm: dts: am43x-epos-evm: Add sleep pinctrl state for dss

Add "sleep" state for dss pincontrol nodes. This will ensure that
during suspend pins are set to the values that optimize power savings.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
arm: dts: am437x-gp-evm: Add sleep pinctrl state for dss

Add "sleep" state for dss pincontrol nodes. This will ensure that
during suspend pins are set to the values that optimize power savings.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: adopt pinctrl support

Update omapdss driver to set the state of the pins to:
- "default on resume
- "sleep" on suspend

By optionally putting the pins into sleep state in the suspend callback
we can accomplish two things.
- minimize current leakage from pins and thus save power,
- prevent the IP from driving pins output in an uncontrolled manner,
which may happen if the power domain drops the domain regulator.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
media: ti-vpe: Enabling CONFIG_VIDEO_TI_VPE_DEBUG enables debug in all files

Enabling CONFIG_VIDEO_TI_VPE_DEBUG currently enables -DDEBUG
for every files under ti-vpe not just vpe itself.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
media: ti-vpe: Use data offset for getting dma_addr for a plane

The data_offset in v4l2_planes structure will help us point to the start of
data content for that particular plane. This may be useful when a single
buffer contains the data for different planes e.g. Y planes of two fields in
the same buffer. With this, user space can pass queue top field and
bottom field with same dmafd and different data_offsets.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
media: ti-vpe: Use line average de-interlacing for first 2 frames

For n input fields, the VPE de-interlacer creates n - 2 progressive frames.

To support this, we use line average mode of de-interlacer for the first 2
input fields to generate 2 progressive frames. We then revert back to the
preferred EDI method, and create n - 2 frames, creating a sum of n frames.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
media: ti-vpe: Do not perform job transaction atomically

Current VPE driver does not start the job untill all the buffers for
a transaction are not queued. When running in multiple context, this might
increase the processing latency.

Alternate solution would be to try to continue the same context as long as
buffers for the transaction are ready; else switch the conext. This may
increase number of context switches but it reduces latency significantly.

In this approach, the job_ready always succeeds as long as there are buffers
on the CAPTURE and OUTPUT stream. Processing may start immediately as the
first 2 iterations don't need extra source buffers. Shift all the source buffers
after each iteration and remove the oldest buffer.

Also, with this removes the constraint of pre buffering 3 buffers before call
to STREAMON in case of deinterlacing.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
media: ti-vpe: Add support for SEQ_TB buffers

The video source can generate the data in the SEQ_TB buffer format.
In the case of TI SoC, the IVA_HD can generate the interlaced content in
the SEQ_TB buffer format. This is the format where the top and bottom field
data can be contained in a single buffer. For example, for NV12, interlaced
format, the data in Y buffer will be arranged as Y-top followed by Y-bottom.
And likewise for UV plane.

Also, queueing one buffer of SEQ_TB is euivalent to queueing two different
buffers for top and bottom fields. Driver needs to take care of this when
handling source buffer lists.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: Increasing max buffer height and width

Increasing max buffer height and width to allow for padded buffers.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: vpe: Return NULL for invalid buffer type

get_q_data can be called with different values for type
e.g. vpe_try_crop calls it with the buffer type which gets passed
from user space

Framework doesn't check wheather its correct type or not
If user space passes wrong type, kernel should not crash.
Return NULL when the passed type is invalid.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: Free vpdma buffers in vpe_release

Free vpdma buffers in vpe_release. Otherwise it was generating random
backtrace.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: 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.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: vpdma: Add support for setting 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.

Make use of different max width & height sets for different
of capture module (i.e. slices).

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: vip: Flush Q/DQ lists even if not streaming

When start_streaming fails, driver would return some error but it
might be possible that some buffers are already queued in the driver.
When closing the device or explicitely calling stream off, driver
doesn't flush all the buffers from Q list and DQ list if vb2 isn't streaming.

Fix this by flushing all the buffers in stop_streaming irrespective of
whether streaming or not.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vps: vpdma: Add abort channel desc and cleanup APIs

Whenever VPDMA processes a data descriptor of a list, it processes it
and sets up the channel for the DMA transaction. List manager holds the
descriptor in the list until the DMA is complete. If sync_on_channel
descriptor, or another descriptor for the same channel is present in the FIFO,
list manager keeps them until the current channel is free.

When the capture stream is closed suddenly while there are pending descriptors
in the FIFO (streamON failed, application killed), it would keep the VPDMA
in a busy state. Any further list post would fail with EBUSY.

To avoid this, drivers need to stop the current processing list and cleanup all
the resources VPDMA has taken and also clear the internal FSM of list manager.
The state machine is cleared by issuing channel specific abort descriptor.

Therefore, the vpdma_list_cleanup accepts an array of channels for which
abort_channel descriptors should be posted. It is driver's responsibility to post for
all the channels or the channels which were used in the last context.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vps: vip: Cleanup VPDMA lists in close

VPDMA lists needs to be cleaned up to release all the resources
and clear the internal FSM. This is necessay for robustness of the
driver, upon multiple open/close, driver should not keep the VPDMA
hardware in busy state.

Also, maintain a map of all the channels being used by the driver
so that while closing the stream, driver can post abort channel for
all the channels used by the driver since opening.

Mark the channel number as used when before vpdma_add_out_dtd is called
and reinitialize the channel map after cleanup.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: vip: correct framerate numerator/denominator values

Fix numerator and denominator values of the framerate were
interpreted vice-versa by the driver.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
v4l: ti-vpe: vip: Invert clock via SMA_SW1 for falling edge

If the video port uses the pixel clock which is active at falling edge,
then it needs to be inverted inside control module so that, when the
clock reaches the VIP module, the data is valid at rising edge.

This is done by setting bits in the CTRL_CORE_SMA_SW1. This register is
accessed via syscon regmap. Parse the property "syscin-smasw"
from device tree and save the regmap. When configuring the pixel clock
polarity, set the clock inversion bits depending on the instance.

Changed the device tree private data from string to an integer.
This is easier to compare v/s comparing strings.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>