ti_fragments: audio_display: Enable DRM features by default

Enabling DRM features as built-in instead of modular.

Some HLOS expects these drivers to be built-in.

Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
ti_fragments: audio_display: Enable OMAP DSS driver

Enable OMAP DSS driver. This is needed for DRA7x display.

DRA7x HLOS display needs these drivers to be built-in.

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
media: ti-vpfe: driver restructuring to fix a kernel panic

While using 'yavta' the system team uncovered an issue with the way
the vpfe driver was handling it's mutex causing a deadlock.
Also as part of the upstream effort some of the review comment
suggested making uses of now available vb2 and v4l2 helper functions
to basically handle the locking mechanism.

Consequently the driver has been substancially cleaned up.
The exported/visible API have not changed.
This a cleaner more upstreamable version of vpfe capture driver.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
OMAPDSS: panel-tlc59108: fix error handling

If the panel driver fails to read from the TLC59108, its probe returns
an error without releasing the reference to omapdss.

Fix the error handling so that the reference is released.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
ARM: dts: dra72-evm: move hpd_pin mux to correct place

The HPD pin is handled by the tpd12s015 level shifter. Move the hpd
pinctrl from dss to tpd12s015.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
ARM: dts: dra7-evm: move hpd_pin mux to correct place

The HPD pin is handled by the tpd12s015 level shifter. Move the hpd
pinctrl from dss to tpd12s015.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
ASoC: edma-pcm: Increase period_bytes_min from 32 to 512

32 byte period size is ridiculously small and there hardly any
practical use for it. 512 byte period size appears to work OK even
when the system is loaded.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
drm/omap/fb: disable console switching during pm operations

The default behavior of consoles during power management operations is:
On entry to suspend a new console is allocated and switched to. On
resume the original console is restored.

However this isn't the observed behavior and the original console is not
restored. This commit avoids the problem by disabling the switching of
consoles at suspend/resume. This works because the driver already
restores all necessary hardware context during such pm operations.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
ARM: DTS: dra7: add syscon reference to dispc node

On DRA7, DISPC needs to access CTRL_CORE_SMA_SW_1 register in the
control module. So add syscon reference to the control module.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
OMAPDSS: DISPC: program dispc polarities to control module

On DRA7, DISPC needs to write output signal polarities not only to a
DISPC register, like for all earlier DSS versions, but to control
module's CTRL_CORE_SMA_SW_1 register.

This patch adds support to write the polarities to control module.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
ARM: DRA7: hwmod: add DMM hwmod description

Add hwmod entries for dmm ip block that is present in both DRA74x and DRA72x.

This removes the message:

[    0.346624] platform 4e000000.dmm: Cannot lookup hwmod 'dmm'

from the boot logs.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
ti_fragments: audio_display: Change HDMI encoders to builtins

Make the HDMI encoders used by omapdss all builtins.  This allows display
during kernel boot, before userspace and udev is available.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
ti_fragments: audio_display: make tda998x a builtin

The TILCDC DRM driver has been forced to be a builtin, but the tda998x also
needs to be a builtin otherwise display initialization fails on BeagleBone
Black.  This commit changes tda998x HDMI encoder driver to be a builtin.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree into ti-linux-3.14.y

TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  ti_fragments: audio_display: make tda998x a builtin
  ti_fragments: audio_display: Change HDMI encoders to builtins
  ARM: DRA7: hwmod: add DMM hwmod description
  OMAPDSS: DISPC: program dispc polarities to control module
  ARM: DTS: dra7: add syscon reference to dispc node
  drm/omap/fb: disable console switching during pm operations
  ASoC: edma-pcm: Increase period_bytes_min from 32 to 512
  ARM: dts: dra7-evm: move hpd_pin mux to correct place
  ARM: dts: dra72-evm: move hpd_pin mux to correct place
  OMAPDSS: panel-tlc59108: fix error handling
  media: ti-vpfe: driver restructuring to fix a kernel panic
  ti_fragments: audio_display: Enable OMAP DSS driver
  ti_fragments: audio_display: Enable DRM features by default

Signed-off-by: Dan Murphy <DMurphy@ti.com>
media: xc5000: Fix get_frequency()

commit a3eec916cbc17dc1aaa3ddf120836cd5200eb4ef upstream.

The programmed frequency on xc5000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: xc4000: Fix get_frequency()

commit 4c07e32884ab69574cfd9eb4de3334233c938071 upstream.

The programmed frequency on xc4000 is not the middle
frequency, but the initial frequency on the bandwidth range.
However, the DVB API works with the middle frequency.

This works fine on set_frontend, as the device calculates
the needed offset. However, at get_frequency(), the returned
value is the initial frequency. That's generally not a big
problem on most drivers, however, starting with changeset
6fe1099c7aec, the frequency drift is taken into account at
dib7000p driver.

This broke support for PCTV 340e, with uses dib7000p demod and
xc4000 tuner.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: au0828: Only alt setting logic when needed

commit 64ea37bbd8a5815522706f0099ad3f11c7537e15 upstream.

It seems that there's a bug at au0828 hardware/firmware
related to alternate setting: when the device is already at
alt 5, a further call causes the URBs to receive -ESHUTDOWN.

I found two different encarnations of this issue:

1) at qv4l2, it fails the second time we try to open the
video screen;
2) at xawtv, when audio underrun occurs, with is very
frequent, at least on my test machine.

The fix is simple: just check if alt=5 before calling
set_usb_interface().

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: media-device: Remove duplicated memset() in media_enum_entities()

commit f8ca6ac00d2ba24c5557f08f81439cd3432f0802 upstream.

After the zeroing the whole struct struct media_entity_desc u_ent,
it is no longer necessary to memset(0) its u_ent.name field.

Signed-off-by: Salva Peiró <speiro@ai2.upv.es>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: mt9v032: fix hblank calculation

commit f17bc3f4707eb87bdb80b895911c551cdd606fbd upstream.

Since (min_row_time - crop->width) can be negative, we have to do a signed
comparison here. Otherwise max_t casts the negative value to unsigned int
and sets min_hblank to that invalid value.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: v4l: vsp1: Remove the unneeded vsp1_video_buffer video field

commit e51daefc228aa164adcc17fe8fce0f856ad0a1cc upstream.

The field is assigned but never read, remove it.

This fixes a bug caused by the struct vb2_buffer field not being be the
very first field of the vsp1_video_buffer buffer structure as required
by videobuf2.

Reported-by: Takanari Hayama <taki@igel.co.jp>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>