OSDN Git Service

android-x86/kernel.git
9 years agoMerge branches '3.19/omapdss' and '3.19/simplefb' into fbdev
Tomi Valkeinen [Mon, 8 Dec 2014 07:16:31 +0000 (09:16 +0200)]
Merge branches '3.19/omapdss' and '3.19/simplefb' into fbdev

Merge fbdev topic branches.

9 years agovideo: uvesafb: Deletion of an unnecessary check before the function call "platform_d...
Markus Elfring [Sun, 23 Nov 2014 16:05:18 +0000 (17:05 +0100)]
video: uvesafb: Deletion of an unnecessary check before the function call "platform_device_put"

The platform_device_put() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-VIA: Deletion of an unnecessary check before the function call "framebuf...
Markus Elfring [Sun, 23 Nov 2014 15:30:05 +0000 (16:30 +0100)]
video: fbdev-VIA: Deletion of an unnecessary check before the function call "framebuffer_release"

The framebuffer_release() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-MMP: Deletion of an unnecessary check before the function call "mmp_unre...
Markus Elfring [Sun, 23 Nov 2014 14:45:03 +0000 (15:45 +0100)]
video: fbdev-MMP: Deletion of an unnecessary check before the function call "mmp_unregister_path"

The mmp_unregister_path() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: mx3fb: Deletion of an unnecessary check before the function call "backlight_de...
Markus Elfring [Sun, 23 Nov 2014 14:15:29 +0000 (15:15 +0100)]
video: mx3fb: Deletion of an unnecessary check before the function call "backlight_device_unregister"

The backlight_device_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-OMAP2: Deletion of unnecessary checks before the function call "i2c_put_...
Markus Elfring [Sun, 23 Nov 2014 13:07:22 +0000 (14:07 +0100)]
video: fbdev-OMAP2: Deletion of unnecessary checks before the function call "i2c_put_adapter"

The i2c_put_adapter() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-SIS: Deletion of unnecessary checks before the function call "pci_dev_put"
Markus Elfring [Sun, 23 Nov 2014 11:55:25 +0000 (12:55 +0100)]
video: fbdev-SIS: Deletion of unnecessary checks before the function call "pci_dev_put"

The pci_dev_put() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: smscufx: Deletion of unnecessary checks before the function call "vfree"
Markus Elfring [Sun, 23 Nov 2014 11:30:33 +0000 (12:30 +0100)]
video: smscufx: Deletion of unnecessary checks before the function call "vfree"

The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: udlfb: Deletion of unnecessary checks before the function call "vfree"
Markus Elfring [Sun, 23 Nov 2014 10:40:47 +0000 (11:40 +0100)]
video: udlfb: Deletion of unnecessary checks before the function call "vfree"

The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: uvesafb: Deletion of an unnecessary check before the function call "uvesafb_free"
Markus Elfring [Sun, 23 Nov 2014 10:00:26 +0000 (11:00 +0100)]
video: uvesafb: Deletion of an unnecessary check before the function call "uvesafb_free"

The uvesafb_free() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-LCDC: Deletion of an unnecessary check before the function call "vfree"
Markus Elfring [Sat, 22 Nov 2014 15:51:31 +0000 (16:51 +0100)]
video: fbdev-LCDC: Deletion of an unnecessary check before the function call "vfree"

The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev: arkfb: suppress build warning
Lad, Prabhakar [Wed, 26 Nov 2014 22:07:25 +0000 (22:07 +0000)]
video: fbdev: arkfb: suppress build warning

this patch fixes following build warning:

drivers/video/fbdev/arkfb.c: In function ‘ark_pci_probe’:
drivers/video/fbdev/arkfb.c:1019:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  par->state.vgabase = (void __iomem *) vga_res.start;
                       ^
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev: s3fb: suppress build warning
Lad, Prabhakar [Wed, 26 Nov 2014 22:07:24 +0000 (22:07 +0000)]
video: fbdev: s3fb: suppress build warning

this patch fixes following build warning:
drivers/video/fbdev/s3fb.c: In function ‘s3_pci_probe’:
drivers/video/fbdev/s3fb.c:1185:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  par->state.vgabase = (void __iomem *) vga_res.start;
                       ^
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev: vt8623fb: suppress build warning
Lad, Prabhakar [Wed, 26 Nov 2014 22:07:23 +0000 (22:07 +0000)]
video: fbdev: vt8623fb: suppress build warning

this patch fixes following build warning:
drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  par->state.vgabase = (void __iomem *) vga_res.start;
                       ^
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi5: Fix bit field for IEC958_AES2_CON_SOURCE
Jyri Sarha [Wed, 3 Dec 2014 14:24:06 +0000 (16:24 +0200)]
OMAPDSS: hdmi5: Fix bit field for IEC958_AES2_CON_SOURCE

The bit field for IEC958_AES2_CON_SOURCE is bits 3-0 in
HDMI_CORE_FC_AUDSCHNLS2, not imaginary bits 3-4 (reverse order).

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi: Remove __exit qualifier from hdmi_uninit_output()
Jyri Sarha [Tue, 2 Dec 2014 12:12:56 +0000 (14:12 +0200)]
OMAPDSS: hdmi: Remove __exit qualifier from hdmi_uninit_output()

Remove __exit qualifier from hdmi_uninit_output() because it is used
also in omapdss_hdmihw_probe().

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi5: Change hdmi_wp idlemode to to no_idle for audio playback
Jyri Sarha [Thu, 23 Oct 2014 10:07:05 +0000 (13:07 +0300)]
OMAPDSS: hdmi5: Change hdmi_wp idlemode to to no_idle for audio playback

Enabling idle mode during audio playback causes the glitches on OMAP5
HDMI. The TRM also suggests to use no-idle for HDMI audio playback.

This patch sets HDMI idle mode to no-idle for the duration of the
playback, and restores it back to original value afterwards.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: Remove all references to obsolete HDMI audio callbacks
Jyri Sarha [Wed, 25 Jun 2014 17:20:57 +0000 (20:20 +0300)]
OMAPDSS: Remove all references to obsolete HDMI audio callbacks

In new model these callbacks are obsolete since the ASoC component
drivers are integrated into the HDMI drivers and no callbacks are
needed anymore.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoASoC: omap: Remove obsolete HDMI audio code and Kconfig options
Jyri Sarha [Tue, 27 May 2014 13:23:51 +0000 (16:23 +0300)]
ASoC: omap: Remove obsolete HDMI audio code and Kconfig options

Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
Kconfig options, and Makefile entries. The HDMI DAI drivers has been
integrated directly to OMAP4+ HDMI drivers and simple-card driver is
used instead of omap-hdmi-card driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi5: Register ASoC platform device for omap hdmi audio
Jyri Sarha [Fri, 23 May 2014 13:20:46 +0000 (16:20 +0300)]
OMAPDSS: hdmi5: Register ASoC platform device for omap hdmi audio

Implements callbacks for OMAP HDMI audio platform driver and registers
it in probe function. Unregistering is done in remove function.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi5: Remove callbacks for the old ASoC DAI driver
Jyri Sarha [Mon, 12 May 2014 08:48:22 +0000 (11:48 +0300)]
OMAPDSS: hdmi5: Remove callbacks for the old ASoC DAI driver

Removes the OMAP5 HDMI audio callbacks for the old external DAI driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi4: Register ASoC platform device for omap hdmi audio
Jyri Sarha [Fri, 23 May 2014 09:48:28 +0000 (12:48 +0300)]
OMAPDSS: hdmi4: Register ASoC platform device for omap hdmi audio

Implements callbacks for OMAP HDMI audio platform driver and registers
it in probe function. Unregistering is done in remove function.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi4: Remove callbacks for the old ASoC DAI driver
Jyri Sarha [Mon, 12 May 2014 08:42:49 +0000 (11:42 +0300)]
OMAPDSS: hdmi4: Remove callbacks for the old ASoC DAI driver

Removes the OMAP4 HDMI audio callbacks for the old external DAI driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi: Make hdmi_mode_has_audio() more user friedly
Jyri Sarha [Fri, 22 Aug 2014 15:42:18 +0000 (18:42 +0300)]
OMAPDSS: hdmi: Make hdmi_mode_has_audio() more user friedly

Make hdmi_mode_has_audio() more user friedly by taking hdmi_config as
parameter.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: Kconfig: Remove HDMI audio booleans from Kconfig
Jyri Sarha [Mon, 15 Sep 2014 19:36:23 +0000 (22:36 +0300)]
OMAPDSS: Kconfig: Remove HDMI audio booleans from Kconfig

The booleans are not used anymore. Just select SND_OMAP_SOC_HDMI_AUDIO
to enable OMAP HDMI audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoASoC: omap-hdmi-audio: Add platform device for OMAP HDMI audio support
Jyri Sarha [Fri, 15 Aug 2014 12:44:44 +0000 (15:44 +0300)]
ASoC: omap-hdmi-audio: Add platform device for OMAP HDMI audio support

The platform device should only be registered from OMAPDSS HDMI
driver. The platform driver registers and unregisters all ASoC
components needed for OMAP HDMI audio.

The hdmi audio driver implements cpu-dai component using the callbacks
provided by OMAPDSS and registers the component under DSS HDMI
device. Omap-pcm is registered for platform component also under DSS
HDMI device. Dummy codec is used as as codec component. The hdmi audio
driver implements also the card and registers it under its own
platform device.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi.h: Add members to hdmi drvdata for audio implementation
Jyri Sarha [Tue, 7 Oct 2014 09:24:10 +0000 (12:24 +0300)]
OMAPDSS: hdmi.h: Add members to hdmi drvdata for audio implementation

Adds display_enabled flag and audio_abort_cb callback to struct hdmi.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi: Add pdev pointer for audio_pdev in HDMI DRV data
Jyri Sarha [Mon, 15 Sep 2014 19:34:20 +0000 (22:34 +0300)]
OMAPDSS: hdmi: Add pdev pointer for audio_pdev in HDMI DRV data

This is used to store omap-hdmi-audio pdev for unregistering it.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi: Make hdmi structure public
Jyri Sarha [Fri, 27 Jun 2014 13:47:00 +0000 (16:47 +0300)]
OMAPDSS: hdmi: Make hdmi structure public

Unify the private anonymous struct in hdmi4.c and hdmi5.c, name it as
struct omap_hdmi, and make it public in hdmi.h.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi_wp: Add function for getting audio dma address
Jyri Sarha [Fri, 23 May 2014 13:13:57 +0000 (16:13 +0300)]
OMAPDSS: hdmi_wp: Add function for getting audio dma address

The audio dma port is found in the hdmi_wp physical address space.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi4_core: Remove unused hdmi4_audio_get_dma_port()
Jyri Sarha [Fri, 22 Aug 2014 17:26:00 +0000 (20:26 +0300)]
OMAPDSS: hdmi4_core: Remove unused hdmi4_audio_get_dma_port()

hdmi4_audio_get_dma_port() is unused and and broken.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi: Remove most of OMAP[45]_DSS_HDMI_AUDIO ifdefs
Jyri Sarha [Fri, 22 Aug 2014 12:15:47 +0000 (15:15 +0300)]
OMAPDSS: hdmi: Remove most of OMAP[45]_DSS_HDMI_AUDIO ifdefs

It does not waste too many bytes to compile all audio related core
functions always in with HDMI support. It should help readability and
in keeping the audio code in working shape. Leave the options just for
disabling and enabling the functionality in hdmi[45].c.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
Jyri Sarha [Thu, 10 Apr 2014 07:36:26 +0000 (10:36 +0300)]
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value

The OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in
hdmi_core_audio_layout enum. I found the correct value from ti-linux
3.8 tree.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi5_core: Initialize mandatory sample_order parameter
Jyri Sarha [Tue, 4 Nov 2014 16:54:40 +0000 (18:54 +0200)]
OMAPDSS: hdmi5_core: Initialize mandatory sample_order parameter

The hdmi_wp_audio_config_format() expects sample_order of struct
hdmi_audio_format to be initialized. The only allowed value is
HDMI_AUDIO_SAMPLE_LEFT_FIRST.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: hdmi_wp: Protect reserved bits in hdmi_wp_audio_config_format()
Jyri Sarha [Tue, 4 Nov 2014 16:58:27 +0000 (18:58 +0200)]
OMAPDSS: hdmi_wp: Protect reserved bits in hdmi_wp_audio_config_format()

Only OMAP4 DSS has non reserved bits above 6th bit in HDMI_WP_AUDIO_CFG.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodt-bindings: simplefb-sunxi: Add sunxi simplefb extensions
Hans de Goede [Tue, 18 Nov 2014 11:10:51 +0000 (12:10 +0100)]
dt-bindings: simplefb-sunxi: Add sunxi simplefb extensions

If pre-filled framebuffer nodes are used, the firmware may need extra
properties to find the right node. This documents the properties to use
for this on sunxi platforms.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodt-bindings: simplefb: Drop the advice about using a specific path for nodes
Hans de Goede [Tue, 18 Nov 2014 11:10:50 +0000 (12:10 +0100)]
dt-bindings: simplefb: Drop the advice about using a specific path for nodes

This goes contrary to how devicetree usually works, so drop it. Instead if
the firmware needs to be able to find a specific node it should use a
platform specific compatible + properties for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: Fix build errors when CONFIG_COMMON_CLK is not defined
Hans de Goede [Tue, 25 Nov 2014 11:13:30 +0000 (12:13 +0100)]
simplefb: Fix build errors when CONFIG_COMMON_CLK is not defined

Both CONFIG_OF and CONFIG_COMMON_CLK must be defined to be able to use of
clocks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-MMP: Fix a typo for the word "destroyed"
Markus Elfring [Mon, 24 Nov 2014 14:55:23 +0000 (15:55 +0100)]
video: fbdev-MMP: Fix a typo for the word "destroyed"

A word was corrected in the description for a parameter of
the mmp_unregister_path() function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: fbdev-MMP: Fix typos for the word "destroy"
Markus Elfring [Mon, 24 Nov 2014 14:50:15 +0000 (15:50 +0100)]
video: fbdev-MMP: Fix typos for the word "destroy"

Two mistyped words were corrected in the description for
the mmp_unregister_path() function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agovideo: ARM CLCD: Remove duplicated include in amba-clcd.c
Qiang Chen [Mon, 17 Nov 2014 09:25:01 +0000 (17:25 +0800)]
video: ARM CLCD: Remove duplicated include in amba-clcd.c

This patch fixes duplicated include dma-mapping.h in
drivers/video/fbdev/amba-clcd.c

Signed-off-by: Qiang Chen <qiang2.chen@sonymobile.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: Change simplefb_init from module_init to fs_initcall
Hans de Goede [Fri, 14 Nov 2014 12:26:55 +0000 (13:26 +0100)]
simplefb: Change simplefb_init from module_init to fs_initcall

One of the reasons for having the simplefb nodes in /chosen, and doing
explicit enumeration of the nodes there, is too allow enumerating them sooner,
so that we get a console earlier on.

Doing this earlier then fs_initcall is not useful, since the fb only turns
into a console when fbcon intializes, which is a fs_initcall too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agofbcon: Change fbcon_init from module_init to fs_initcall
Hans de Goede [Fri, 14 Nov 2014 12:26:54 +0000 (13:26 +0100)]
fbcon: Change fbcon_init from module_init to fs_initcall

Various fb drivers register themselves before module_init so as to have a
console as early as possible, this is of little use if fbcon does not
initialize early too.

Fbcon cannot initialize earlier then fs_initcall, because then the creation
of /sys/class/graphics/fbcon will fail.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: Add support for enumerating simplefb dt nodes in /chosen
Hans de Goede [Fri, 14 Nov 2014 12:26:53 +0000 (13:26 +0100)]
simplefb: Add support for enumerating simplefb dt nodes in /chosen

Update simplefb to support the new preferred location for simplefb dt nodes
under /chosen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoof.h: Keep extern declaration of of_* variables when !CONFIG_OF
Hans de Goede [Fri, 14 Nov 2014 12:26:52 +0000 (13:26 +0100)]
of.h: Keep extern declaration of of_* variables when !CONFIG_OF

Keep the extern declaration of of_allnodes and friends, when building without
of support, this way code using them can be written like this:

if (IS_ENABLED(CONFIG_OF_PLATFORM) && of_chosen) {
for_each_child_of_node(of_chosen, np)
...
}

And rely on the compiler optimizing it away, avoiding the need for #ifdef-ery.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodt-bindings: simplefb: Specify node location and handoff related properties
Hans de Goede [Fri, 14 Nov 2014 12:26:51 +0000 (13:26 +0100)]
dt-bindings: simplefb: Specify node location and handoff related properties

Since simplefb nodes do not relate directly to hw typically they have been
placed in the root of the devicetree. As the represent runtime information
having them as sub-nodes of /chosen is more logical, specify this.

Also specify when to set the chosen stdout-path property to a simplefb node.

For reliable handover to a hardware specific driver, that driver needs to
know which simplefb to unregister when taking over, specify how the hw driver
can find the matching simplefb node.

Last add some advice on how to fill and use simplefb nodes from a firmware
pov.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: add clock handling code
Luc Verhaegen [Fri, 14 Nov 2014 12:26:50 +0000 (13:26 +0100)]
simplefb: add clock handling code

This claims and enables clocks listed in the simple framebuffer dt node.
This is needed so that the display engine, in case the required clocks
are known by the kernel code and are described in the dt, will remain
properly enabled.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
[hdegoede@redhat.com: Change clks from list to dynamic array]
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: add goto error path to probe
Luc Verhaegen [Fri, 14 Nov 2014 12:26:49 +0000 (13:26 +0100)]
simplefb: add goto error path to probe

Use the usual kernel style of goto error_foo to free resources on probe
error. This is a preparation patch for adding clocks support.

While at it also update ioremap_wc error return from ENODEV to ENOMEM.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: formalize pseudo palette handling
Luc Verhaegen [Fri, 14 Nov 2014 12:26:48 +0000 (13:26 +0100)]
simplefb: formalize pseudo palette handling

Add a proper struct describing simplefb private data, with the palette in there,
instead of directly storing the palette in the fb_info->par pointer.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stephen Warren <swarren@nvidia.com>
[hdegoede@redhat.com: drop unnecessary void * cast]
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodt-bindings: Add a clocks property to the simple-framebuffer binding
Hans de Goede [Fri, 14 Nov 2014 12:26:47 +0000 (13:26 +0100)]
dt-bindings: Add a clocks property to the simple-framebuffer binding

A simple-framebuffer node represents a framebuffer setup by the firmware /
bootloader. Such a framebuffer may have a number of clocks in use, add a
property to communicate this to the OS.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agosimplefb: Add simplefb MAINTAINERS entry
Hans de Goede [Fri, 14 Nov 2014 12:26:46 +0000 (13:26 +0100)]
simplefb: Add simplefb MAINTAINERS entry

During the discussion about adding clock handling code to simplefb, it became
clear that simplefb currently does not have an active maintainer.

I've discussed this with Stephen Warren <swarren@wwwdotorg.org>, the original
author of simplefb, and with his permisson I'm picking up maintainership of
simplefb.

Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: features: remove unused DSI PLL features
Tomi Valkeinen [Fri, 7 Nov 2014 14:44:02 +0000 (16:44 +0200)]
OMAPDSS: features: remove unused DSI PLL features

Now that the DSS has the common DSS PLL, we no longer use the DSI PLL
feature flags from dss_features.c.

Remove all the unused feature flags.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: use common DSS PLL support
Tomi Valkeinen [Wed, 22 Oct 2014 12:02:17 +0000 (15:02 +0300)]
OMAPDSS: HDMI: use common DSS PLL support

Now that we have the common DSS PLL support, change HDMI to use it. This
results in quite a lot of changes, but almost all of them are trivial
name changes.

The function to program the PLL settings can be removed from hdmi_pll.c,
as the common PLL API contains the same functionality.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: remove extra poweroff
Tomi Valkeinen [Fri, 17 Oct 2014 10:55:08 +0000 (13:55 +0300)]
OMAPDSS: HDMI: remove extra poweroff

hdmi_pll_enable powers off the PLL as the first thing it does. Right
after that, it enables the PLL powers.

The initial power-off is pointless, so let's remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: split PLL enable & config
Tomi Valkeinen [Thu, 16 Oct 2014 13:01:51 +0000 (16:01 +0300)]
OMAPDSS: HDMI: split PLL enable & config

At the moment we have one function, hdmi_pll_enable, which enables the
PLL and writes the PLL configuration to registers.

To make the HDMI PLL ahere to the DSS PLL API, split the hdmi_pll_enable
into two parts: hdmi_pll_enable which enables the PLL HW, and
hdmi_pll_set_config which writes the config.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: store WP pointer to hdmi_pll_data
Tomi Valkeinen [Thu, 16 Oct 2014 12:31:38 +0000 (15:31 +0300)]
OMAPDSS: HDMI: store WP pointer to hdmi_pll_data

HDMI PLL code needs the pointer to the WP block so that it can manage
its power. Currently this is passed as a function parameter to
hdmi_pll_enable and hdmi_pll_disable. To make the PLL function adhere to
the DSS PLL API, we need to remove the WP parameter.

This patch stores the WP pointer to hdmi_pll_data in hdmi_pll_init, so
that it's available when needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: Remove HDMI PLL reset
Tomi Valkeinen [Mon, 10 Nov 2014 10:28:57 +0000 (12:28 +0200)]
OMAPDSS: HDMI: Remove HDMI PLL reset

The SYSRESET bits in HDMI PLL do not reset the PLL itself, but only
affect the power used for the PLL.

Afaik there is no reason to use the SYSRESET bits, and we don't use it
in the other PLLs, so let's remove the HDMI PLL reset to make the PLL
code simpler and similar to other PLLs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: rewrite HDMI PLL calculation code
Tomi Valkeinen [Mon, 15 Sep 2014 12:40:47 +0000 (15:40 +0300)]
OMAPDSS: HDMI: rewrite HDMI PLL calculation code

The code calculating HDMI PLL parameters has always been very confusing.
Now that we are implementing a common PLL library for the DSS, it's
important that the PLL code is understandable.

This patch rewrites the calculation code, and removes a few hacks that
were used there.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI5: disable interlace modes
Tomi Valkeinen [Tue, 16 Sep 2014 09:46:33 +0000 (12:46 +0300)]
OMAPDSS: HDMI5: disable interlace modes

We don't support interlace modes properly on OMAP5+ HDMI, so we need to
reject interlace timings.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: HDMI: fix setting REFSEL
Tomi Valkeinen [Mon, 15 Sep 2014 12:48:39 +0000 (15:48 +0300)]
OMAPDSS: HDMI: fix setting REFSEL

Only OMAP5+ has REFSEL field, but at the moment it's set also on OMAP4.

Fix this by adding a "has_refsel" field, and setting the REFSEL based on
that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: use common DSS PLL support
Tomi Valkeinen [Wed, 22 Oct 2014 11:49:14 +0000 (14:49 +0300)]
OMAPDSS: DSI: use common DSS PLL support

Now that we have the common DSS PLL support, change DSI to use it. This
results in quite a lot of changes, but almost all of them are trivial
name changes.

The functions to calculate and program the PLL settings can be removed
from dsi.c, as the common PLL API contains the same functionality.

We also need to create struct dss_pll_hw entries for PLL hardware
features for different OMAP platforms, instead of using the
dss_features.c as the old code does.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: Add common PLL code
Tomi Valkeinen [Wed, 22 Oct 2014 11:21:59 +0000 (14:21 +0300)]
OMAPDSS: Add common PLL code

OMAP DSS currently contains two different PLLs: DSI PLL (Type A PLL) and
HDMI PLL (Type B PLL). When DRA7 support is added, we will also support
Video PLLs (Type A).

The driver currently handles all PLLs totally separately. This patch
adds common DSS PLL code, which

a) lets us have common code for the PLLs
b) lets the users of the PLLs use a common API, instead of DSI API or
   HDMI API.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: dsi_runtime_get/put in pll_init
Tomi Valkeinen [Fri, 8 Aug 2014 07:04:31 +0000 (10:04 +0300)]
OMAPDSS: DSI: dsi_runtime_get/put in pll_init

When DPI uses the DSI PLL for pixel clock, the DPI code will call
dsi_runtime_get/put to keep the DSI block enabled. A much simpler way to
handle this is to do dsi_runtime_get/put in DSI's dsi_pll_init() and
dsi_pll_uninit(), thus removing the need for DSI to call the runtime PM
functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: features: combine dsi & dispc hsdivs
Tomi Valkeinen [Thu, 7 Aug 2014 11:29:24 +0000 (14:29 +0300)]
OMAPDSS: DSI: features: combine dsi & dispc hsdivs

The HSDIV outputs of DSI PLL (and also other PLLs) all have the same
bit width for the divider value.

Simplify the code by merging HSDIV divider widths into one width.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: turn hsdivs fields to arrays
Tomi Valkeinen [Fri, 7 Nov 2014 11:13:24 +0000 (13:13 +0200)]
OMAPDSS: DSI: turn hsdivs fields to arrays

We are creating a common DSS PLL code, so having fixed DSI specific
hsdiv fields in the clock information is not ok.

This patch changes the hsdiv fields to arrays, so that we can use all
the 4 possible hsdiv outputs (DSI only usees 2), and we have generic way
to access the hsdivs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: rename clkin4ddr to clkdco
Tomi Valkeinen [Fri, 7 Nov 2014 11:08:16 +0000 (13:08 +0200)]
OMAPDSS: DSI: rename clkin4ddr to clkdco

We are creating a common DSS PLL code, so rename 'clkin4ddr' field,
which is DSI specific name, to 'clkdco' which is a generic name.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: use struct copy instead of individual field copy
Tomi Valkeinen [Fri, 7 Nov 2014 11:09:42 +0000 (13:09 +0200)]
OMAPDSS: DSI: use struct copy instead of individual field copy

Now that dsi_clock_info only contains information about the PLL, we can
just copy the whole struct when storing the clock information, instead
of copying individual fields.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: remove pll_locked field
Tomi Valkeinen [Thu, 7 Aug 2014 10:38:34 +0000 (13:38 +0300)]
OMAPDSS: DSI: remove pll_locked field

We have pll_locked field in struct dsi_data, but it doesn't have any
meaningful use anymore, and can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: remove clkin from dsi_clock_info
Tomi Valkeinen [Wed, 6 Aug 2014 13:16:32 +0000 (16:16 +0300)]
OMAPDSS: DSI: remove clkin from dsi_clock_info

struct dsi_clock_info contains clkin field, which is the rate of the
PLL's input clock. This field is not needed, as it can be easily
retrieved by using the clk_get_rate().

This patch removes the clkin field.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: separate LP clock info from dsi_clock_info
Tomi Valkeinen [Wed, 6 Aug 2014 12:45:26 +0000 (15:45 +0300)]
OMAPDSS: DSI: separate LP clock info from dsi_clock_info

struct dsi_clock_info represents the clocks handled by the DSI, mostly
PLL related clocks. In an effort to create common PLL code, we need to
remove all the non-PLL items from dsi_clock_info.

This patch removes LP clock related fields from dsi_clock_info, and
creates a new struct dsi_lp_clock_info for holding clock info for the LP
clock.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: always power on hsclk & hsdiv
Tomi Valkeinen [Wed, 6 Aug 2014 10:31:47 +0000 (13:31 +0300)]
OMAPDSS: DSI: always power on hsclk & hsdiv

The DSS PLL has support to power on the PLL's highspeed clock output
and HSDIV output separately. In practice both need to powered on, as in
most OMAP's that's the only working configuration. We already do that in
dsi_pll_init(), by overriding the passed arguments so that both are
always powered.

Simplify the code by removing the support for choosing which outputs to
power on.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: remove unused hsdiv wait funcs
Tomi Valkeinen [Mon, 4 Aug 2014 10:56:50 +0000 (13:56 +0300)]
OMAPDSS: DSI: remove unused hsdiv wait funcs

With the previous patch "OMAPDSS: DSI: wait for hsdiv clocks when
enabling PLL",  dsi_wait_pll_hsdiv_dispc_active and
dsi_wait_pll_hsdiv_dsi_active are no longer needed, so they and the
callers can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSI: wait for hsdiv clocks when enabling PLL
Tomi Valkeinen [Mon, 4 Aug 2014 10:46:05 +0000 (13:46 +0300)]
OMAPDSS: DSI: wait for hsdiv clocks when enabling PLL

At the moment we have two functions to wait for the HSDIV clocks to get
active, dsi_wait_pll_hsdiv_dispc_active and
dsi_wait_pll_hsdiv_dsi_active. Instead of such inconvenient functions,
let's just make sure that the hsdiv clocks are active after the pll has
been enabled.

This patch adds code to dsi_pll_set_clock_div() to wait until HSDIV
clocks are active.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSS: add a param to dpi_select_source which specifies it's port number
Archit Taneja [Wed, 23 Apr 2014 12:30:18 +0000 (18:00 +0530)]
OMAPDSS: DSS: add a param to dpi_select_source which specifies it's port number

Add a 'port' parameter in dpi_select_source. The param tells the port
number of the DPI instance that we want to configure. We use this number
to select the overlay manager for that DPI instance.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DPI: Add support for multiple instances
Archit Taneja [Tue, 6 May 2014 11:37:39 +0000 (17:07 +0530)]
OMAPDSS: DPI: Add support for multiple instances

Register DPI outputs, and assign the port_num to them as specified by the
'reg' property in the DPI ports in DT.

To support multiple DPI instances, dpi_get_channel needs to take the DPI
instance's port number to get the corresponding channel. Make it take this
argument. We just pass 0 in the non-DT path, since we don't support multiple
instances in the non-DT case.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DT: Get source endpoint by matching reg-id
Archit Taneja [Tue, 22 Apr 2014 12:13:48 +0000 (17:43 +0530)]
OMAPDSS: DT: Get source endpoint by matching reg-id

In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
and then see what omapdss output has the matching device_node pointer in
omap_dss_find_output_by_node.

For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
device_node pointer. If the source is one of these outputs, the above method
won't work.

To get the correct output for ports within DSS(and in other cases in the future,
where multiple ports might be under one device), we require additional
information which is exclusive to the output port.

We create a new field in omap_dss_device called 'port_num', this provides port
number of the output port corresponding to this device. When searching for the
source endpoint in DT, we extract the 'reg' property from the port corresponding
to the endpoint source. From the list of registered outputs, we pick out that
output which has both dev->of_node and port_num matching with the device_node
pointer and 'reg' of the source endpoint node from DT.

For encoder blocks(the ones which have both an input and output port), we need
to set the port_num as the 'reg' property for the output port as defined in the
DT bindings. We set port_num to 1 in the tfp410 and tpd12s015 encoder drivers.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DSS: init dss ports cleanly
Archit Taneja [Thu, 22 May 2014 11:31:57 +0000 (17:01 +0530)]
OMAPDSS: DSS: init dss ports cleanly

The init/uninit port functions are used to set up the DPI and SDI outputs under
the dss platform device. A 'reg' property is used to determine the port number
of the output. This tells us whether the port is DPI or SDI for OMAP34xx DSS
revision. For other DSS revisions, we only have DPI outputs under the dss
platform device.

For multiple DPI output instances(introduced in DRA7xx DSS), we will use the
the port number to specify which DPI output instance is being inited.

The current functions work fine if there is only one DPI output instance in
DSS. For multiple DPI instances, it would get complicated to figure out whether
port number was used to specify whether the output is SDI, or another DPI
instance.

We create a list of port types supported for each DSS rev, with the index of the
port in the list specifying the port number of the output for that DSS revision.
This allows us to have a more generic way to init/uninit ports within DSS, and
also support multiple DPI ports.

We make the uninit_port functions iterative since we will have multiple DPI
ports to uninit in the future.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DPI: Store dpi_data pointer in the DT port's data
Archit Taneja [Mon, 2 Jun 2014 08:41:51 +0000 (14:11 +0530)]
OMAPDSS: DPI: Store dpi_data pointer in the DT port's data

DPI and SDI ports are backed by only one parent DSS device. We don't have a
corresponding platform_device for ports under DSS. In order to support multiple
instances of DPI, we need to pass the driver data pointer through the DPI port's
private data ('data' member in device_node struct).

dpi_init_output/dpi_uninit_output are untouched and only used for non-DT case,
these are called when the DPI platform device probed/removed. These funcs will
be removed when non-DT mode is removed.

dpi_init_output_port/dpi_uninit_output_port are created and used for the DT
path, called when DSS inits/uninits it's ports. These new functions retrieve
the dpi_data pointer from 'port->data', and not from the platform device's
data(pdev->dev) like in the non-DT path.

We add some code in dss_uninit_ports() to pass a pointer to the DPI port in
dpi_uninit_port().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DPI: Allocate driver data
Archit Taneja [Sun, 1 Jun 2014 07:17:44 +0000 (12:47 +0530)]
OMAPDSS: DPI: Allocate driver data

Allocate driver data(dpi_data) for each DPI instance. It's allocated in
omap_dpi_probe() when DT isn't used, and in dpi_init_port() when DT is used.
The dpi_data struct instance is no longer global. In the case of DPI ops, it's
retrieved from dpi_get_data_from_dssdev(). 'dssdev' passed by the connected
encoder/panel driver is a pointer to the 'output' member in dpi_data, and thus
can be used to get the DPI instance's driver data. In the case of probe/ini_port
functions, it's set as DPI/DSS device's private data embedded in the
platform_device struct.

Having dpi_data as private data of the platform device will not work for
multiple DPI instances in the DT case. This is because there is no corresponding
platform_device for DPI or SDI, they exist only as ports under the parent DSS
platform_device in the DT case. The DPI port's private data('data' member in
device_node struct) will later be used to store dpi_data.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoOMAPDSS: DPI: Use DPI driver data
Archit Taneja [Fri, 30 May 2014 10:56:22 +0000 (16:26 +0530)]
OMAPDSS: DPI: Use DPI driver data

DPI related data is currently a static global struct parameter. It is accessed
directly by functions in the driver.

This method won't work if we want the driver to support multiple DPI instances.
Create struct dpi_data, and pass its pointer to functions which need to use it.

We still have a static instance defined for dpi_data, which is accessed by top
level DPI ops. This will be removed when the driver dynamically allocates
dpi_data for each DPI instance.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agom501fb: don't return zero on failure path in sm501fb_probe()
Alexey Khoroshilov [Fri, 31 Oct 2014 22:40:47 +0000 (01:40 +0300)]
m501fb: don't return zero on failure path in sm501fb_probe()

If no framebuffers found, sm501fb_probe() breaks off initialization,
deallocates sm501fb_info, but returns zero. As a result, use after free
can happen in sm501fb_remove().

The patch adds -ENODEV as a return value in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agofbdev: mxsfb: Add support for mx6sl and mx6sx
Fabio Estevam [Sat, 25 Oct 2014 13:28:47 +0000 (11:28 -0200)]
fbdev: mxsfb: Add support for mx6sl and mx6sx

mx6sl and mx6sx share the same LCD controller as mx23 and mx28.

Add support for it.

The basic difference is the number of clocks that are required:

- mx23/mx28: only one clock
- mx6sl: two clocks
- mx6sx: three clocks

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agoLinux 3.18-rc3
Linus Torvalds [Sun, 2 Nov 2014 23:01:51 +0000 (15:01 -0800)]
Linux 3.18-rc3

9 years agoMerge tag 'for-linus-20141102' of git://git.infradead.org/linux-mtd
Linus Torvalds [Sun, 2 Nov 2014 22:45:52 +0000 (14:45 -0800)]
Merge tag 'for-linus-20141102' of git://git.infradead.org/linux-mtd

Pull MTD fixes from Brian Norris:
 "Three main MTD fixes for 3.18:

   - A regression from 3.16 which was noticed in 3.17.  With the
     restructuring of the m25p80.c driver and the SPI NOR library
     framework, we omitted proper listing of the SPI device IDs.  This
     means m25p80.c wouldn't auto-load (modprobe) properly when built as
     a module.  For now, we duplicate the device IDs into both modules.

   - The OMAP / ELM modules were depending on an implicit link ordering.
     Use deferred probing so that the new link order (in 3.18-rc) can
     still allow for successful probing.

   - Fix suspend/resume support for LH28F640BF NOR flash"

* tag 'for-linus-20141102' of git://git.infradead.org/linux-mtd:
  mtd: cfi_cmdset_0001.c: fix resume for LH28F640BF chips
  mtd: omap: fix mtd devices not showing up
  mtd: m25p80,spi-nor: Fix module aliases for m25p80
  mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id
  mtd: m25p80: get rid of spi_get_device_id

9 years agoMerge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb...
Linus Torvalds [Sun, 2 Nov 2014 22:39:35 +0000 (14:39 -0800)]
Merge tag 'scsi-for-linus' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is a set of six patches consisting of:
   - two MAINTAINER updates
   - two scsi-mq fixs for the old parallel interface (not every request
     is tagged and we need to set the right flags to populate the SPI
     tag message)
   - a fix for a memory leak in scatterlist traversal caused by a
     preallocation update in 3.17
   - an ipv6 fix for cxgbi"

[ The scatterlist fix also came in separately through the block layer tree ]

* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  MAINTAINERS: ufs - remove self
  MAINTAINERS: change hpsa and cciss maintainer
  libcxgbi : support ipv6 address host_param
  scsi: set REQ_QUEUE for the blk-mq case
  Revert "block: all blk-mq requests are tagged"
  lib/scatterlist: fix memory leak with scsi-mq

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sun, 2 Nov 2014 22:27:30 +0000 (14:27 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Nothing too astounding or major: radeon, i915, vmwgfx, armada and
  exynos.

  Biggest ones:
   - vmwgfx has one big locking regression fix
   - i915 has come displayport fixes
   - radeon has some stability and a memory alloc failure
   - armada and exynos have some vblank fixes"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (24 commits)
  drm/exynos: correct connector->dpms field before resuming
  drm/exynos: enable vblank after DPMS on
  drm/exynos: init kms poll at the end of initialization
  drm/exynos: propagate plane initialization errors
  drm/exynos: vidi: fix build warning
  drm/exynos: remove explicit encoder/connector de-initialization
  drm/exynos: init vblank with real number of crtcs
  drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.
  drm/vmwgfx: Fix hash key computation
  drm/vmwgfx: fix lock breakage
  drm/i915/dp: only use training pattern 3 on platforms that support it
  drm/radeon: remove some buggy dead code
  drm/i915: Ignore VBT backlight check on Macbook 2, 1
  drm/radeon: remove invalid pci id
  drm/radeon: dpm fixes for asrock systems
  radeon: clean up coding style differences in radeon_get_bios()
  drm/radeon: Use drm_malloc_ab instead of kmalloc_array
  drm/radeon/dpm: disable ulv support on SI
  drm/i915: Fix GMBUSFREQ on vlv/chv
  drm/i915: Ignore long hpds on eDP ports
  ...

9 years agoMerge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Linus Torvalds [Sun, 2 Nov 2014 20:56:20 +0000 (12:56 -0800)]
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
 - add the new bpf syscall to ARM.
 - drop a redundant return statement in __iommu_alloc_remap()
 - fix a performance issue noticed by Thomas Petazzoni with
   kmap_atomic().
 - fix an issue with the L2 cache OF parsing code which caused it to
   incorrectly print warnings on each boot, and make the warning text
   more consistent with the rest of the code

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8180/1: mm: implement no-highmem fast path in kmap_atomic_pfn()
  ARM: 8183/1: l2c: Improve l2c310_of_parse() error message
  ARM: 8181/1: Drop extra return statement
  ARM: 8182/1: l2c: Make l2x0_cache_size_of_parse() return 'int'
  ARM: enable bpf syscall

9 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sun, 2 Nov 2014 20:31:02 +0000 (12:31 -0800)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "A small set of x86 fixes.  The most serious is an SRCU lockdep fix.

  A bit late - needed some time to test the SRCU fix, which only came in
  on Friday"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: vmx: defer load of APIC access page address during reset
  KVM: nVMX: Disable preemption while reading from shadow VMCS
  KVM: x86: Fix far-jump to non-canonical check
  KVM: emulator: fix execution close to the segment limit
  KVM: emulator: fix error code for __linearize

9 years agoMerge branch 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Dave Airlie [Sun, 2 Nov 2014 19:23:17 +0000 (05:23 +1000)]
Merge branch 'exynos-drm-fixes' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-fixes

This pull-request includes some bug fixes and code cleanups.
Especially, this fixes the bind failure issue occurred when it tries
to re-bind Exynos drm driver after unbound, and the modetest failure
issue incurred by not having a pair to vblank on and off requests.

* 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: correct connector->dpms field before resuming
  drm/exynos: enable vblank after DPMS on
  drm/exynos: init kms poll at the end of initialization
  drm/exynos: propagate plane initialization errors
  drm/exynos: vidi: fix build warning
  drm/exynos: remove explicit encoder/connector de-initialization
  drm/exynos: init vblank with real number of crtcs

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sun, 2 Nov 2014 18:28:43 +0000 (10:28 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull VFS fixes from Al Viro:
 "A bunch of assorted fixes, most of them followups to overlayfs merge"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  ovl: initialize ->is_cursor
  Return short read or 0 at end of a raw device, not EIO
  isofs: don't bother with ->d_op for normal case
  isofs_cmp(): we'll never see a dentry for . or ..
  overlayfs: fix lockdep misannotation
  ovl: fix check for cursor
  overlayfs: barriers for opening upper-layer directory
  rcu: Provide counterpart to rcu_dereference() for non-RCU situations
  staging: android: logger: Fix log corruption regression

9 years agoirda: stop calling sk_prot->disconnect() on connection failure
Linus Torvalds [Sun, 2 Nov 2014 18:20:26 +0000 (10:20 -0800)]
irda: stop calling sk_prot->disconnect() on connection failure

The sk_prot is irda's own set of protocol handlers, so irda should
statically know what that function is anyway, without using an indirect
pointer.  And as it happens, we know *exactly* what that pointer is
statically: it's NULL, because irda doesn't define a disconnect
operation.

So calling that function is doubly wrong, and will just cause an oops.

Reported-by: Martin Lang <mlg.hessigheim@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrm/exynos: correct connector->dpms field before resuming
Andrzej Hajda [Fri, 10 Oct 2014 12:31:56 +0000 (14:31 +0200)]
drm/exynos: correct connector->dpms field before resuming

During system suspend after connector switch off its dpms field
is set to connector previous dpms state. To properly resume dpms field
should be set to its actual state (off) before resuming to previous dpms state.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: enable vblank after DPMS on
Andrzej Hajda [Fri, 10 Oct 2014 12:31:55 +0000 (14:31 +0200)]
drm/exynos: enable vblank after DPMS on

Before DPMS off driver disables vblank.
It should be balanced by vblank enable after DPMS on.
The patch fixes issue with page_flip ioctl not being able
to acquire vblank counter introduced by patch:
drm: Always reject drm_vblank_get() after drm_vblank_off()

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: init kms poll at the end of initialization
Andrzej Hajda [Fri, 10 Oct 2014 12:31:54 +0000 (14:31 +0200)]
drm/exynos: init kms poll at the end of initialization

HPD events can be generated by components even if drm_dev is not fully
initialized, to skip such events kms poll initialization should
be performed at the end of load callback followed directly by forced
connection detection.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: propagate plane initialization errors
Andrzej Hajda [Fri, 10 Oct 2014 12:31:53 +0000 (14:31 +0200)]
drm/exynos: propagate plane initialization errors

In case of error during plane initialization load callback
incorrectly return success, this patch fixes it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: vidi: fix build warning
Inki Dae [Tue, 7 Oct 2014 15:16:34 +0000 (00:16 +0900)]
drm/exynos: vidi: fix build warning

encoder object isn't used anymore so remove it.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove explicit encoder/connector de-initialization
Andrzej Hajda [Mon, 22 Sep 2014 09:30:48 +0000 (11:30 +0200)]
drm/exynos: remove explicit encoder/connector de-initialization

All KMS objects are destroyed by drm_mode_config_cleanup in proper order
so component drivers should not care about it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: init vblank with real number of crtcs
Andrzej Hajda [Tue, 7 Oct 2014 13:09:14 +0000 (22:09 +0900)]
drm/exynos: init vblank with real number of crtcs

Initialization of vblank with MAX_CRTC caused attempts
to disabling vblanks for non-existing crtcs in case
drm used fewer crtcs. The patch fixes it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoKVM: vmx: defer load of APIC access page address during reset
Paolo Bonzini [Sun, 2 Nov 2014 06:54:30 +0000 (07:54 +0100)]
KVM: vmx: defer load of APIC access page address during reset

Most call paths to vmx_vcpu_reset do not hold the SRCU lock.  Defer loading
the APIC access page to the next vmentry.

This avoids the following lockdep splat:

[ INFO: suspicious RCU usage. ]
3.18.0-rc2-test2+ #70 Not tainted
-------------------------------
include/linux/kvm_host.h:474 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
1 lock held by qemu-system-x86/2371:
 #0:  (&vcpu->mutex){+.+...}, at: [<ffffffffa037d800>] vcpu_load+0x20/0xd0 [kvm]

stack backtrace:
CPU: 4 PID: 2371 Comm: qemu-system-x86 Not tainted 3.18.0-rc2-test2+ #70
Hardware name: Dell Inc. OptiPlex 9010/0M9KCM, BIOS A12 01/10/2013
 0000000000000001 ffff880209983ca8 ffffffff816f514f 0000000000000000
 ffff8802099b8990 ffff880209983cd8 ffffffff810bd687 00000000000fee00
 ffff880208a2c000 ffff880208a10000 ffff88020ef50040 ffff880209983d08
Call Trace:
 [<ffffffff816f514f>] dump_stack+0x4e/0x71
 [<ffffffff810bd687>] lockdep_rcu_suspicious+0xe7/0x120
 [<ffffffffa037d055>] gfn_to_memslot+0xd5/0xe0 [kvm]
 [<ffffffffa03807d3>] __gfn_to_pfn+0x33/0x60 [kvm]
 [<ffffffffa0380885>] gfn_to_page+0x25/0x90 [kvm]
 [<ffffffffa038aeec>] kvm_vcpu_reload_apic_access_page+0x3c/0x80 [kvm]
 [<ffffffffa08f0a9c>] vmx_vcpu_reset+0x20c/0x460 [kvm_intel]
 [<ffffffffa039ab8e>] kvm_vcpu_reset+0x15e/0x1b0 [kvm]
 [<ffffffffa039ac0c>] kvm_arch_vcpu_setup+0x2c/0x50 [kvm]
 [<ffffffffa037f7e0>] kvm_vm_ioctl+0x1d0/0x780 [kvm]
 [<ffffffff810bc664>] ? __lock_is_held+0x54/0x80
 [<ffffffff812231f0>] do_vfs_ioctl+0x300/0x520
 [<ffffffff8122ee45>] ? __fget+0x5/0x250
 [<ffffffff8122f0fa>] ? __fget_light+0x2a/0xe0
 [<ffffffff81223491>] SyS_ioctl+0x81/0xa0
 [<ffffffff816fed6d>] system_call_fastpath+0x16/0x1b

Reported-by: Takashi Iwai <tiwai@suse.de>
Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reviewed-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Tested-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Fixes: 38b9917350cb2946e368ba684cfc33d1672f104e
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoKVM: nVMX: Disable preemption while reading from shadow VMCS
Jan Kiszka [Wed, 8 Oct 2014 16:05:39 +0000 (18:05 +0200)]
KVM: nVMX: Disable preemption while reading from shadow VMCS

In order to access the shadow VMCS, we need to load it. At this point,
vmx->loaded_vmcs->vmcs and the actually loaded one start to differ. If
we now get preempted by Linux, vmx_vcpu_put and, on return, the
vmx_vcpu_load will work against the wrong vmcs. That can cause
copy_shadow_to_vmcs12 to corrupt the vmcs12 state.

Fix the issue by disabling preemption during the copy operation.
copy_vmcs12_to_shadow is safe from this issue as it is executed by
vmx_vcpu_run when preemption is already disabled before vmentry.

This bug is exposed by running Jailhouse within KVM on CPUs with
shadow VMCS support.  Jailhouse never expects an interrupt pending
vmexit, but the bug can cause it if, after copy_shadow_to_vmcs12
is preempted, the active VMCS happens to have the virtual interrupt
pending flag set in the CPU-based execution controls.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>