platform/adaptation/renesas_rcar/renesas_kernel.git
9 years agoASoC: rsnd: fixup loop exit timing of dma name search
Kuninori Morimoto [Wed, 18 Jun 2014 08:55:09 +0000 (17:55 +0900)]
ASoC: rsnd: fixup loop exit timing of dma name search

Current dma name search loop didn't care about SSI index
This patch fixes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c08c3b088053cec1465051258844e7934d3e3e37)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: fixup rsnd_gen_dma_addr() for Gen1
Kuninori Morimoto [Wed, 18 Jun 2014 08:54:43 +0000 (17:54 +0900)]
ASoC: rsnd: fixup rsnd_gen_dma_addr() for Gen1

ad32d0c7b0e993433df152ae747652647eb65a27
(ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
added rsnd_gen_dma_addr() to calculate DMA addr,
but, it is necessary only for Gen2.
This patch ignores Gen1 case.
Kernel will be panic without this patch.
Special thanks to Simon

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 64eae986fc1e3a281b00f04b7c9c00b145ec8a57)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: uds: Fix scaling of alpha layer
Laurent Pinchart [Sat, 31 May 2014 00:45:48 +0000 (21:45 -0300)]
v4l: vsp1: uds: Fix scaling of alpha layer

Pixel color components can be scaled using either bilinear interpolation
or a multitap filter. The multitap filter provides better results, but
can't be selected when the alpha layer need to be scaled down by more
than 1/2.

Disable alpha scaling when the input has a fixed alpha value, and
program the UDS to output a fixed alpha value in that case. This ensures
the multitap filter will be used whenever possible.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit bdc2df62ae38bbab044078f4d25a7a3d9e2379c9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: bru: Make the background color configurable
Laurent Pinchart [Wed, 28 May 2014 01:46:30 +0000 (22:46 -0300)]
v4l: vsp1: bru: Make the background color configurable

Expose the background color to userspace through the V4L2_CID_BG_COLOR
control.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit a16e2794592b733d47f372f0cadcd9ff0f349ca9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: bru: Support non-premultiplied colors at the BRU output
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
v4l: vsp1: bru: Support non-premultiplied colors at the BRU output

The BRU outputs premultiplied colors, enable color data normalization
when the format configured at the output of the pipeline isn't
premultiplied.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 9aca813e1401dcafe1c0a9d3b03795e254571504)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: bru: Support premultiplied alpha at the BRU inputs
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
v4l: vsp1: bru: Support premultiplied alpha at the BRU inputs

Adjust the BRU blending formula to avoid the multiplication by alpha
when the corresponding input format is premultiplied. As this requires
access to the RPFs connected to the BRU inputs from the BRU module,
store pointers to the RPFs in the BRU structure when validating the
pipeline.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 6418b4d6e1f1d70199a93eeeed948be2229b9c1a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control support
Laurent Pinchart [Wed, 21 May 2014 22:00:05 +0000 (19:00 -0300)]
v4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control support

The control is used to configure the fixed alpha channel value, when
reading from memory in the RPF or writing to memory in the WPF.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 7578c204620c8e25ec6e4849cd12098f831a14d0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Add alpha channel support to the memory ports
Laurent Pinchart [Mon, 26 May 2014 23:12:53 +0000 (20:12 -0300)]
v4l: vsp1: Add alpha channel support to the memory ports

Support ARGB formats on the RPF side by reading the alpha component from
memory and on the WPF side by writing it to memory.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 7a52b6dea8e9559428149fbed0cddd587004006e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Switch to XRGB formats
Laurent Pinchart [Mon, 26 May 2014 22:57:21 +0000 (19:57 -0300)]
v4l: vsp1: Switch to XRGB formats

The driver ignores the alpha component on output video nodes and
hardcodes the alpha component to 0 on capture video nodes. Make this
explicit by exposing XRGB formats.

Compatibility with existing userspace applications is handled by
selecting the XRGB format corresponding to the requested old RGB format.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 56bfef3e72cf4a98d0e8f56129673146733c1366)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: wpf: Clear RPF to WPF association at stream off time
Laurent Pinchart [Wed, 28 May 2014 16:10:33 +0000 (13:10 -0300)]
v4l: vsp1: wpf: Clear RPF to WPF association at stream off time

The VSP1 stores the video pipelines' input (RPF) to output (WPF)
mappings in a WPF register. An RPF must never be associated with
multiple WPFs, even if all of those WPFs but one are unused, otherwise
the hardware won't function properly.

The driver doesn't ensure this correctly as it never clears the
mappings. An RPF used with one WPF and later with a different WPF will
lead to malfunction, as it will be associated with two WPFs. Clear the
mappings at stream off time to fix this.

Reported-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit d6c71e8ceb9fe79aaf9c2f73af5cb2ef93526b0d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: wpf: Simplify cast to pipeline structure
Laurent Pinchart [Tue, 27 May 2014 23:35:36 +0000 (20:35 -0300)]
v4l: vsp1: wpf: Simplify cast to pipeline structure

Use the subdev pointer directly to_vsp1_pipeline() macro instead of
casting from the subdev to the wpf object and back to the subdev.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 5aeb01adbea81e858318072097d98fc44578c7be)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: sru: Make the intensity controllable during streaming
Laurent Pinchart [Sat, 31 May 2014 23:30:11 +0000 (20:30 -0300)]
v4l: vsp1: sru: Make the intensity controllable during streaming

The control value is currently stored in the SRU structure by the
control set handler and written to the hardware at stream on time,
making control set during streaming ineffective. Fix it by writing to
the registers from within the control set handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 58f896d859ce555dd3684f439f8a65bfda437533)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: sru: Fix the intensity control default value
Laurent Pinchart [Wed, 21 May 2014 22:00:05 +0000 (19:00 -0300)]
v4l: vsp1: sru: Fix the intensity control default value

The default value isn't set and defaults to 0, which isn't in the 1-6
min-max range. Fix it by setting the default value to 1.

This shoud have been caught when checking the control handler error
field at initialization time, but the check was missing. Add it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit a1606102dafe6942905e97a88ceea9a60e1a2c7d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Setup control handler automatically at stream on time
Laurent Pinchart [Sat, 31 May 2014 13:40:51 +0000 (10:40 -0300)]
v4l: vsp1: Setup control handler automatically at stream on time

When setting a control directly on a subdev node the VSP1 driver doesn't
guarantee that the device is powered on. This leads to crashes when the
control handlers writes to hardware registers. One easy way to fix this
is to ensure that the device gets powered on when a subdev node is
opened. However, this consumes power unnecessarily, as there's no need
to power the device on when setting formats on the pipeline.
Furthermore, control handler setup at entity init time suffers from the
same problem as the device isn't powered on easier.

Fix this by extend the entity base object to setup the control handler
automatically when starting the stream. Entities must then skip writing
to registers in the set control handler when not streaming, which can be
tested with the new vsp1_entity_is_streaming() helper function.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 960de2cff49a4e5f45e6a60175f4298cc34dc526)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Propagate vsp1_device_get errors to the callers
Laurent Pinchart [Sat, 31 May 2014 11:50:32 +0000 (08:50 -0300)]
v4l: vsp1: Propagate vsp1_device_get errors to the callers

Modify the vsp1_device_get() function to return an error code instead of
a pointer to the VSP1 device, and use the return value in the callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 4c16d6a079a4c9a64d664cc9c30ebae5f0bd0c64)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Cleanup video nodes at removal time
Laurent Pinchart [Wed, 28 May 2014 15:49:13 +0000 (12:49 -0300)]
v4l: vsp1: Cleanup video nodes at removal time

Video nodes created and initialized in the RPF and WPF init code paths
are never unregistered, and the related resources (videobuf alloc
context and media entity) never released.

Fix this by storing a pointer to the vsp1_video object in vsp1_entity
and calling vsp1_video_cleanup() from vsp1_entity_destroy(). This also
allows simplifying the init error code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 1499be67a545fb6f41acb5614b8e4732147cec50)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Fix typos
Laurent Pinchart [Tue, 27 May 2014 15:59:39 +0000 (12:59 -0300)]
v4l: vsp1: Fix typos

Several macros were mistakenly prefixed with VPS1 instead of VSP1. Fix
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 7005a81705d032887b9f4f808e6dce8e57b8980a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Fix pipeline stop timeout
Laurent Pinchart [Mon, 23 Jun 2014 20:15:02 +0000 (17:15 -0300)]
v4l: vsp1: Fix pipeline stop timeout

If the pipeline was already stopped when stopping the stream, no
frame end interrupt will be generated and the driver will time out
waiting for the pipeline to stop.

Fix this by setting the pipeline state to STOPPED when the pipeline is
idle waiting for frames to process, and to STOPPING at stream stop time
only when the pipeline is currently RUNNING.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 9b3e6e2abd7568f9458e927fc4e5eca1b3cde521)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Release buffers at stream stop
Laurent Pinchart [Mon, 23 Jun 2014 19:57:22 +0000 (16:57 -0300)]
v4l: vsp1: Release buffers at stream stop

videobuf2 expects no buffer to be owned by the driver when the
stop_stream queue operation returns. As the vsp1 driver fails to do so,
a warning is generated at stream top time.

Fix this by releasing all buffers queued on the IRQ queue in the
stop_stream operation handler and marking them as erroneous.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 9df04e9d9ac6982d16a8a042c8274410ed29fb0e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Fix routing cleanup when stopping the stream
Laurent Pinchart [Mon, 23 Jun 2014 21:40:49 +0000 (18:40 -0300)]
v4l: vsp1: Fix routing cleanup when stopping the stream

Commit d9b45ed3d8b75e8cf38c8cd1563c29217eecba27 ("v4l: vsp1: Support
multi-input entities") reworked pipeline routing configuration and
introduced a bug by writing to the entities routing registers without
first checking whether the entity had a routing register. This results
in overwriting the value at offset 0 of the device register space when
stopping the stream.

Fix this by skipping routing register write for entities without a
routing register.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit aaa48cbb098e13cf9c22066b8c65958a7243fb95)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agorcar_vin: add devicetree support
Ben Dooks [Sat, 5 Jul 2014 22:26:22 +0000 (19:26 -0300)]
rcar_vin: add devicetree support

Add support for devicetree probe for the rcar-vin
driver.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
[g.liakhovetski@gmx.de fix a typo, sort headers alphabetically]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 47c71bd61b772cd72159dff4aae43734257a485a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agorcar_vin: copy flags from pdata
Ben Dooks [Mon, 14 Apr 2014 10:36:40 +0000 (07:36 -0300)]
rcar_vin: copy flags from pdata

The platform data is a single word, so simply copy
it into the device's private data structure than
keeping a copy of the pointer.

This will make changing to device-tree binding
easier as it is one allocation instead of two.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 25dfa02ce21981ef08d375be987862f96676d8ab)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof: move graph helpers from drivers/media/v4l2-core to drivers/of
Philipp Zabel [Mon, 10 Feb 2014 21:01:48 +0000 (22:01 +0100)]
of: move graph helpers from drivers/media/v4l2-core to drivers/of

This patch moves the parsing helpers used to parse connected graphs
in the device tree, like the video interface bindings documented in
Documentation/devicetree/bindings/media/video-interfaces.txt, from
drivers/media/v4l2-core/v4l2-of.c into drivers/of/base.c.

This allows to reuse the same parser code from outside the V4L2
framework, most importantly from display drivers.
The functions v4l2_of_get_next_endpoint, v4l2_of_get_remote_port,
and v4l2_of_get_remote_port_parent are moved. They are renamed to
of_graph_get_next_endpoint, of_graph_get_remote_port, and
of_graph_get_remote_port_parent, respectively.
Since there are not that many current users yet, switch all of
them to the new functions right away.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
(cherry picked from commit fd9fdb78a9bf85b94fb2190c82ff280c8f8375cc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoi2c: i2c-rcar: Drop class based scanning to improve bootup time
Wolfram Sang [Thu, 10 Jul 2014 11:46:31 +0000 (13:46 +0200)]
i2c: i2c-rcar: Drop class based scanning to improve bootup time

This driver has been flagged to drop class based instantiation. The removal
improves boot-up time and is unneeded for embedded controllers. Users have been
warned to switch for some time now, so we can actually do the removal. Keep the
DEPRECATED flag, so the core can inform users that the behaviour finally
changed now. After another transition period, this flag can go, too.
While we are here, remove the indentation for the array setup because
such things always break after some time.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 929e3aba5114235388793443cbc05882904577b9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPCI: rcar: Fix GPL v2 license string typo
Bjorn Helgaas [Tue, 15 Jul 2014 21:06:12 +0000 (15:06 -0600)]
PCI: rcar: Fix GPL v2 license string typo

Per license_is_gpl_compatible(), the MODULE_LICENSE() string for GPL v2 is
"GPL v2", not "GPLv2".  Use "GPL v2" so this module doesn't taint the
kernel.

Based-on-work-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 68947eb17503ce2009c603d0d0bb9feb139fb8b8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodrm/rcar-du: Fix maximum frame buffer pitch computation
Laurent Pinchart [Mon, 28 Jul 2014 18:18:36 +0000 (20:18 +0200)]
drm/rcar-du: Fix maximum frame buffer pitch computation

The maximum pitch constraint for the hardware is expressed in pixels.
Convert it to bytes to validate frame buffer creation, as frame buffer
pitches are expressed in bytes.

Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 8bed5cc765ffdd61b59f8405d38b377f5a7f0920)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodrm: rcar-du: fix warnings
Russell King [Sun, 13 Jul 2014 11:18:58 +0000 (12:18 +0100)]
drm: rcar-du: fix warnings

drivers/gpu/drm/rcar-du/rcar_du_drv.c:190:5: warning: "CONFIG_PM_SLEEP" is not defined [-Wundef]

Always use #ifdef with CONFIG symbols, never just bare #if

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 396d7a24a9b3ddbce3335c57a234227eb7762d14)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agothermal: rcar: Document SoC-specific bindings
Geert Uytterhoeven [Wed, 9 Jul 2014 12:23:35 +0000 (14:23 +0200)]
thermal: rcar: Document SoC-specific bindings

The documentation only mentioned the generic fallback compatible property.
Add the missing SoC-specific compatible properties, some of which are
already in use.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
Cc: linux-pm@vger.kernel.org
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit fa313103c953fd832b7c4e431c74be55c20b1ce1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Fix leaking of unused DMA descriptors
Geert Uytterhoeven [Wed, 6 Aug 2014 12:58:58 +0000 (14:58 +0200)]
spi: rspi: Fix leaking of unused DMA descriptors

If dmaengine_prep_slave_sg() or dmaengine_submit() fail, we may leak
unused DMA descriptors.

As per Documentation/dmaengine.txt, once a DMA descriptor has been
obtained, it must be submitted. Hence:
  - First prepare and submit all DMA descriptors,
  - Prepare the SPI controller for DMA,
  - Start DMA by calling dma_async_issue_pending(),
  - Make sure to call dmaengine_terminate_all() on all descriptors that
    haven't completed.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3819bc8752367eae0d72fa1c473dc88ea45631a7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Handle dmaengine_prep_slave_sg() failures gracefully
Geert Uytterhoeven [Wed, 9 Jul 2014 10:26:22 +0000 (12:26 +0200)]
spi: rspi: Handle dmaengine_prep_slave_sg() failures gracefully

As typically a shmobile SoC has less DMA channels than devices that can use
DMA, we may want to prioritize access to the DMA channels in the future.
This means that dmaengine_prep_slave_sg() may start failing arbitrarily.

Handle dmaengine_prep_slave_sg() failures gracefully by falling back to
PIO.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 85912a88c1ebcad04a5cfec971771195ce8d6691)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh: intc: Confine SH_INTC to platforms that need it
Geert Uytterhoeven [Wed, 20 Aug 2014 13:39:22 +0000 (15:39 +0200)]
sh: intc: Confine SH_INTC to platforms that need it

Currently the sh-intc driver is compiled on all SuperH and
non-multiplatform SH-Mobile platforms, while it's only used on a limited
number of platforms:
  - SuperH: SH2(A), SH3(A), SH4(A)(L) (all but SH5)
  - ARM: sh7372, sh73a0

Drop the "default y" on SH_INTC, make all CPU platforms that use it
select it, and protect all sub-options by "if SH_INTC" to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 049d28048be595e0a10a58fe1c104b153c386633)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
arch/arm/mach-shmobile/Kconfig
arch/sh/Kconfig

9 years agonet: sh_eth: Add r8a7794 support
Hisashi Nakamura [Fri, 1 Aug 2014 15:03:00 +0000 (17:03 +0200)]
net: sh_eth: Add r8a7794 support

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
[uli: added bindings documentation]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0f76b9d83b2b010b63a094024b3cfd82e20af28d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh_mmcif: Configure DMA slave bus width
Laurent Pinchart [Tue, 15 Jul 2014 22:45:13 +0000 (00:45 +0200)]
mmc: sh_mmcif: Configure DMA slave bus width

The data register is 4 bytes wide, hardcode the DMA transfer size to
4 bytes in both directions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit e36152aa84cf68bd7f09acffd480cd2b6aa5480d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh_mmcif: Fix DMA slave address configuration
Laurent Pinchart [Tue, 15 Jul 2014 22:45:12 +0000 (00:45 +0200)]
mmc: sh_mmcif: Fix DMA slave address configuration

Commit e5a233cb647d749de2f188477c9a54b94d90477f ("mmc: sh_mmcif:
Factorize DMA channel request and configuration code") incorrectly
set the destination address for both slave channels instead of setting
the source address for the receive channel. Fix that.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit d25006e7e5045e76575e9f58903efc1a860a3ff1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: tmio: Configure DMA slave bus width
Laurent Pinchart [Tue, 15 Jul 2014 22:45:14 +0000 (00:45 +0200)]
mmc: tmio: Configure DMA slave bus width

Even though some implementations support 4-bytes data register access,
the tmio driver never configures the hardware in such a way and always
performs 2-bytes accesses. Hardcode the DMA transfer size to 2 bytes.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 39ab196243e8732ad68928be97129305b29afbbd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Fix transmit-only DMA transfers
Geert Uytterhoeven [Thu, 7 Aug 2014 12:07:43 +0000 (14:07 +0200)]
spi: sh-msiof: Fix transmit-only DMA transfers

Fix tx/rx mixup, which broke transmit-only transfers.

Introduced by commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
("spi: sh-msiof: Fix leaking of unused DMA descriptors").

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit cdcd565fa0925edf9b80c875fcc84a231c75bd1d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Fix leaking of unused DMA descriptors
Geert Uytterhoeven [Wed, 6 Aug 2014 12:59:03 +0000 (14:59 +0200)]
spi: sh-msiof: Fix leaking of unused DMA descriptors

If dmaengine_prep_slave_sg() or dmaengine_submit() fail, we may leak
unused DMA descriptors.

As per Documentation/dmaengine.txt, once a DMA descriptor has been
obtained, it must be submitted. Hence:
  - First prepare and submit all DMA descriptors,
  - Prepare the SPI controller for DMA,
  - Start DMA by calling dma_async_issue_pending(),
  - Make sure to call dmaengine_terminate_all() on all descriptors that
    haven't completed.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3e81b59208fa4697c6c3b6eefb92892b47f8b1e7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Use correct device for DMA mapping with IOMMU
Geert Uytterhoeven [Fri, 11 Jul 2014 15:56:22 +0000 (17:56 +0200)]
spi: sh-msiof: Use correct device for DMA mapping with IOMMU

To function correctly in the presence of an IOMMU, the DMA buffers must be
mapped using the DMA channel's device instead of the MSIOF platform
device's device.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5dabcf2f27ded864cf79204c4a3cca1516b66026)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Handle dmaengine_prep_slave_single() failures gracefully
Geert Uytterhoeven [Wed, 9 Jul 2014 10:26:23 +0000 (12:26 +0200)]
spi: sh-msiof: Handle dmaengine_prep_slave_single() failures gracefully

As typically a shmobile SoC has less DMA channels than devices that can use
DMA, we may want to prioritize access to the DMA channels in the future.
This means that dmaengine_prep_slave_single() may start failing
arbitrarily.

Handle dmaengine_prep_slave_single() failures gracefully by falling back to
PIO. This requires moving DMA-specific configuration of the MSIOF device
after the call(s) to dmaengine_prep_slave_single().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 279d2378c9c4f05bbe41b55625b4003871026266)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Add DMA support
Geert Uytterhoeven [Mon, 30 Jun 2014 10:10:24 +0000 (12:10 +0200)]
spi: sh-msiof: Add DMA support

Add DMA support to the MSIOF driver using platform data.

As MSIOF DMA is limited to 32-bit words (requiring byte/wordswapping for
smaller wordsizes), and the group length is limited to 256 words, DMA is
performed on two fixed pages, allocated and mapped at driver initialization
time.

Performance figures (in Mbps) on r8a7791/koelsch at different SPI clock
frequencies for 1024-byte and 4096-byte transfers:

                   1024 bytes           4096 bytes
  -  3.25 MHz: PIO  2.1, DMA  2.6 | PIO  2.8, DMA  3.1
  -  6.5  MHz: PIO  3.2, DMA  4.4 | PIO  5.0, DMA  5.9
  - 13    MHz: PIO  4.2, DMA  6.6 | PIO  8.2, DMA 10.7
  - 26    MHz: PIO  5.9, DMA 10.4 | PIO 12.4, DMA 18.4

Note that DMA is only faster than PIO for transfers that exceed the FIFO
size (typically 64 words / 256 bytes).

Also note that large transfers (larger than the group length for DMA, or
larger than the FIFO size for PIO), should use cs-gpio (with the
appropriate pinmux setup), as the hardware chipselect will be deasserted in
between chunks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b0d0ce8b6b91a0f6f99045b6019fc4c824634fb4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Refactor sh_msiof_transfer_one()
Geert Uytterhoeven [Fri, 20 Jun 2014 10:16:19 +0000 (12:16 +0200)]
spi: sh-msiof: Refactor sh_msiof_transfer_one()

  - Move buffer pointer and length setup to the top,
  - Make unsigned values unsigned,
  - Loop over words and increment pointers instead of recalculating them,
    which allows to kill bytes_done.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 0312d59130693adad85c2acfbc0b92a669930a41)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Improve transfer error handling
Geert Uytterhoeven [Fri, 20 Jun 2014 10:16:18 +0000 (12:16 +0200)]
spi: sh-msiof: Improve transfer error handling

  - Add a timeout when waiting for the transfer complete interrupt,
  - If sh_msiof_spi_stop() fails, there's no need to clear IER, as the
    interrupt handler has already done that,
  - Propagate transfer failures in sh_msiof_transfer_one().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 75b82e23a4ea20a9e1a48695ff5e01761889dbb3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Extract sh_msiof_spi_{start,stop}() helpers
Geert Uytterhoeven [Fri, 20 Jun 2014 10:16:17 +0000 (12:16 +0200)]
spi: sh-msiof: Extract sh_msiof_spi_{start,stop}() helpers

Based on an old patch by Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 76c02e71612533206cb062b875c9609bce83d23a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: sh-msiof: Add more register documentation
Geert Uytterhoeven [Fri, 20 Jun 2014 10:16:16 +0000 (12:16 +0200)]
spi: sh-msiof: Add more register documentation

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2e2b36872d7b45b1f88a590283b14c67931b777f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh-pfc: r8a7791: fix CAN pin groups
Sergei Shtylyov [Mon, 28 Jul 2014 22:12:55 +0000 (02:12 +0400)]
sh-pfc: r8a7791: fix CAN pin groups

I had made last-minute changes before submitting the patch "sh-pfc: r8a7791:
add CAN pin groups"; now I'm seeing that they weren't complete: I had missed
update to the pin group names in pin[01]_groups[]. Drop the "_a" suffixes there.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 302fb1781783ded370f515e8e649b8285ee29cdc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Add calculation recive margin for HSCIF
Nobuhiro Iwamatsu [Mon, 14 Jul 2014 07:10:00 +0000 (16:10 +0900)]
serial: sh-sci: Add calculation recive margin for HSCIF

When the error of the same bit rate is detected, we will need to select
the recive margin is large. Current code holds the minimum error, it does
not have to check the recive margin. This adds this calculation.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 730c4e782c039caf40b467c35f595c005e94220c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Fix range check of bit-rate for HSCIF
Nobuhiro Iwamatsu [Mon, 14 Jul 2014 07:09:59 +0000 (16:09 +0900)]
serial: sh-sci: Fix range check of bit-rate for HSCIF

If bit-rate calculation result of HSCIF is expect 255 from 0,
driver does not calculate error bit. However, we need to round
the value to calculate error bit in the case of negative value.
This rounds the value of bit-rate using clamp(), and bit-rate is the
case of negative value, it enables the calculation of the error bit.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit bcb9973a6097652a12660958449301aada41de9c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Updated calculation of bit error rate and bit rate
Nobuhiro Iwamatsu [Mon, 14 Jul 2014 07:09:58 +0000 (16:09 +0900)]
serial: sh-sci: Updated calculation of bit error rate and bit rate

Currently, the decimal point is discarded calculation of BRR.
Therefore, it can not calculate a value close to the correct value.
This patch fixes this problem by using DIV_ROUND_CLOSEST.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b7d66397f4d282ddf2a2fe516fc9329c5a063459)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodmaengine: sh: Rework Kconfig and Makefile
Laurent Pinchart [Thu, 31 Jul 2014 00:34:04 +0000 (09:34 +0900)]
dmaengine: sh: Rework Kconfig and Makefile

Separate helpers and drivers in the Kconfig and Makefile to improve
readability and move the CONFIG_OF dependency from the Makefile to
Kconfig.

[pebolle@tiscali.nl: reported need to rename SHDMA_R8A73A4 instances]
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au: squashed rename of SHDMA_R8A73A4 instances]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit 9f2c2bb31258e11b1ebaf73bdf2a88f8afaa2dd2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodmaengine: shdma: Use defines instead of hardcoded numbers
Geert Uytterhoeven [Fri, 20 Jun 2014 12:37:41 +0000 (14:37 +0200)]
dmaengine: shdma: Use defines instead of hardcoded numbers

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 0cdbee33ea42bfd5f61f824e258a1a0944dd2a27)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodmaengine: shdma: Add more register documentation
Geert Uytterhoeven [Fri, 20 Jun 2014 12:37:38 +0000 (14:37 +0200)]
dmaengine: shdma: Add more register documentation

Also add a few definitions that were missing.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6b32fafee2bb5fcf0b3d3d04a9762d3a0212089e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: add R-Car Gen. 2 init and power control
Ulrich Hecht [Thu, 10 Jul 2014 07:53:59 +0000 (09:53 +0200)]
usb: renesas_usbhs: add R-Car Gen. 2 init and power control

In preparation for DT conversion to reduce reliance on platform device
callbacks.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 8ecef00fe1f33658ee36e902dba6850b51312073)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: gadget: fix re-enabling pipe without re-connecting
Yoshihiro Shimoda [Wed, 9 Jul 2014 11:30:13 +0000 (20:30 +0900)]
usb: renesas_usbhs: gadget: fix re-enabling pipe without re-connecting

This patch fixes an issue that the renesas_usbhs driver in gadget mode
cannot work correctly even if I disabled DMAC of the driver when I used
the g_zero driver and the testusb tool.

When a usb cable is re-connected, the renesas_usbhs driver calls the
usbhsp_flags_init() (via usbhs_hotplug() --> usbhs_mod_call(start) -->
usbhsg_try_start() --> usbhs_pipe_init()). However, the driver doesn't
call the usbhsp_flags_init() when usbhsg_ep_disable() is called.
So, if a gadget driver calls usb_ep_enable() and usb_ep_disable() again
and again, the renesas_usbhs driver will output the following log:

  renesas_usbhs renesas_usbhs: can't get pipe (BULK)
  renesas_usbhs renesas_usbhs: wrong recip request

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit dfb87b8bfe09f933abaf387693992089f6f9053e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: fix usbhs_pipe_malloc() to re-enable a pipe.
Yoshihiro Shimoda [Wed, 9 Jul 2014 11:30:03 +0000 (20:30 +0900)]
usb: renesas_usbhs: fix usbhs_pipe_malloc() to re-enable a pipe.

This patch fixes an issue that the driver cannot push a new data when
a pipe is re-enabled after the pipe is queued.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 6a0541599f54b556442d6130e4f9faaad91bf3a2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agogpio: rcar: clamp returned value to [0,1]
Jürg Billeter [Tue, 24 Jun 2014 02:19:50 +0000 (04:19 +0200)]
gpio: rcar: clamp returned value to [0,1]

While it will be clamped to bool by gpiolib, let's make this sane
in the driver as well.

Signed-off-by: Jürg Billeter <j@bitron.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 7cb5409b10d9f8316ca2539591acb6a5f7fd4139)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_tmu: Add DT support
Laurent Pinchart [Fri, 11 Apr 2014 14:23:40 +0000 (16:23 +0200)]
clocksource: sh_tmu: Add DT support

Document DT bindings and parse them in the TMU driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3e29b5543f9250bb358169cff0594f58284ece74)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_tmu: Replace global spinlock with a per-device spinlock
Laurent Pinchart [Mon, 17 Feb 2014 15:49:05 +0000 (16:49 +0100)]
clocksource: sh_tmu: Replace global spinlock with a per-device spinlock

The global spinlock is used to protect the shared start/stop register.
Now that all TMU channels are handled by a single device instance, use a
per-device spinlock.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2b027f1f0f887097b4140a71b5c1e878da1e2fd9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_tmu: Drop support for legacy platform data
Laurent Pinchart [Tue, 28 Jan 2014 14:52:46 +0000 (15:52 +0100)]
clocksource: sh_tmu: Drop support for legacy platform data

Now that all platforms have switched to the new-style platform data,
drop support for the legacy version.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 681b9e852cf2d48ebd63954028814c7cece71945)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_mtu2: Add DT support
Laurent Pinchart [Tue, 4 Mar 2014 17:28:26 +0000 (18:28 +0100)]
clocksource: sh_mtu2: Add DT support

Document DT bindings and parse them in the MTU2 driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
(cherry picked from commit cca8d0596c4c7acb371ea1bc5eee9b404b30516a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_mtu2: Replace global spinlock with a per-device spinlock
Laurent Pinchart [Tue, 4 Mar 2014 14:25:56 +0000 (15:25 +0100)]
clocksource: sh_mtu2: Replace global spinlock with a per-device spinlock

The global spinlock is used to protect the shared start/stop register.
Now that all MTU2 channels are handled by a single device instance, use
a per-device spinlock.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
(cherry picked from commit 8b2463d8cae2dda0c98ab5a15f25a0350a0e998d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_mtu2: Drop support for legacy platform data
Laurent Pinchart [Tue, 4 Mar 2014 17:13:57 +0000 (18:13 +0100)]
clocksource: sh_mtu2: Drop support for legacy platform data

Now that all platforms have switched to the new-style platform data,
drop support for the legacy version.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
(cherry picked from commit 1a5da0e43be0c07462e445549dbdd4a1731a3e11)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_cmt: Add DT support
Laurent Pinchart [Wed, 12 Feb 2014 16:12:40 +0000 (17:12 +0100)]
clocksource: sh_cmt: Add DT support

Document DT bindings and parse them in the CMT driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1768aa2f4c1248051013282c6cf63b368016cb53)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: shmobile: Remove unused sh_timer_config members
Laurent Pinchart [Tue, 4 Mar 2014 17:50:53 +0000 (18:50 +0100)]
clocksource: shmobile: Remove unused sh_timer_config members

The name, channel_offset, timer_bit, clockevent_rating and
clocksource_rating members are unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 628627bfd943c077c65489acd8b23c7bb14eb0e2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_cmt: Replace global spinlock with a per-device spinlock
Laurent Pinchart [Mon, 17 Feb 2014 15:49:05 +0000 (16:49 +0100)]
clocksource: sh_cmt: Replace global spinlock with a per-device spinlock

The global spinlock is used to protect the shared start/stop register.
Now that all CMT channels are handled by a single device instance, use a
per-device spinlock.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit de599c8843ebbdfc29a119c94af481b1de76700e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: sh_cmt: Drop support for legacy platform data
Laurent Pinchart [Tue, 28 Jan 2014 14:52:46 +0000 (15:52 +0100)]
clocksource: sh_cmt: Drop support for legacy platform data

Now that all platforms have switched to the new-style platform data,
drop support for the legacy version.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 31e912f598371bcfdffc990289029e1110f8b3f9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh: Switch to new style MTU2 device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:21 +0000 (13:15 +0200)]
sh: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 5204601c0877b3ffc90e417bf30fccc9bdf47962)
Signed-off-by: Simon Horman <horms@verge.net.au>
9 years agosh: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:15 +0000 (13:15 +0200)]
sh: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1399c195ef5009bf44a41649da4718f6e67c0bff)
Signed-off-by: Simon Horman <horms@verge.net.au>
9 years agosh: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:08 +0000 (13:15 +0200)]
sh: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 9b17e48cd4df4e129976c37660cf9ec644c66059)
Signed-off-by: Simon Horman <horms@verge.net.au>
9 years agosh-pfc: sh73a0: Introduce the use of devm_regulator_register
Himangi Saraogi [Mon, 7 Jul 2014 16:09:16 +0000 (21:39 +0530)]
sh-pfc: sh73a0: Introduce the use of devm_regulator_register

This patch moves data allocated using regulator_register to
devm_regulator_register and does away the calls to regulator_unregister.
The sh73a0_pinmux_soc_exit function is no longer needed and is removed.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 01a7d13a8cfa6424a9568f3c7e925ace57cd3fc8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh-pfc: Add renesas,pfc-r8a7791 to binding documentation
Geert Uytterhoeven [Wed, 9 Jul 2014 12:23:36 +0000 (14:23 +0200)]
sh-pfc: Add renesas,pfc-r8a7791 to binding documentation

The driver already supports the r8a7791 SoC, and "renesas,pfc-r8a7791"
is already in use.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 590b4ceab95761c45dfc5d9afbbc6810c1fd64a7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh-pfc: r8a7791: add CAN pin groups
Sergei Shtylyov [Tue, 1 Jul 2014 20:58:16 +0000 (00:58 +0400)]
sh-pfc: r8a7791: add CAN pin groups

Add CAN0/1 data/clock pin groups to R8A7791 PFC driver.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit b067580f07b0ae5c323a1d5cd0caa629050406e3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: tmio-mmc: Add renesas, sdhi-r8a7791 to binding documentation
Geert Uytterhoeven [Wed, 9 Jul 2014 12:23:34 +0000 (14:23 +0200)]
mmc: tmio-mmc: Add renesas, sdhi-r8a7791 to binding documentation

The driver already supports the r8a7791 SoC, and "renesas,sdhi-r8a7791"
is already in use.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Ian Molton <ian.molton@codethink.co.uk>
Cc: Chris Ball <chris@printf.net>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit bf7978483c0c119e0d650710ee713f0ed95939ca)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: remove checks around dev_kfree_skb() calls
Sergei Shtylyov [Sat, 28 Jun 2014 00:10:00 +0000 (04:10 +0400)]
sh_eth: remove checks around dev_kfree_skb() calls

Since consume_skb() (and hence dev_kfree_skb() macro) checks the passed pointer
for NULL, there's no need to check for NULL before invoking dev_kfree_skb().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 179d80aff82bf8dff9db30589fe5a2297c454d35)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Pass spi_master pointer to rspi_release_dma()
Geert Uytterhoeven [Fri, 6 Jun 2014 11:38:43 +0000 (13:38 +0200)]
spi: rspi: Pass spi_master pointer to rspi_release_dma()

rspi_release_dma() doesn't need access to any fields in the driver private
data, except for the pointer to the SPI master object. Hence just pass the
needed pointer.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit afcc98dec91b7754e754670bdec0290aa07c3565)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Remove unused variable in rspi_rz_transfer_one()
Geert Uytterhoeven [Fri, 6 Jun 2014 11:38:42 +0000 (13:38 +0200)]
spi: rspi: Remove unused variable in rspi_rz_transfer_one()

Introduced by commit 8b983e90ea1a3dd82070f96c062ad521a06b7cc0 ("spi: rspi:
Extract rspi_common_transfer()"), which removed its users.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 95029a00886f0c8d79e700cb8983b881c75af0f1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPCI: rcar: Remove rcar_pcie_setup_window() resource argument
Phil Edworthy [Mon, 30 Jun 2014 08:37:01 +0000 (09:37 +0100)]
PCI: rcar: Remove rcar_pcie_setup_window() resource argument

rcar_pcie_setup_window() took both the window number and the resource,
which was redundant because we can look up the resource from the window
number.

Remove the "res" argument.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 0549252a1da98c5c39610e1700a9a1755acd0a70)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPCI: rcar: Cleanup style and formatting
Phil Edworthy [Mon, 30 Jun 2014 07:54:23 +0000 (08:54 +0100)]
PCI: rcar: Cleanup style and formatting

This patch just makes symbol and function name changes to avoid potential
conflicts, along with minor formatting changes.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b77188495de64abb5393cb96ac5ec518cf386310)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPCI: rcar: Use correct initial HW settings
Phil Edworthy [Mon, 30 Jun 2014 07:54:22 +0000 (08:54 +0100)]
PCI: rcar: Use correct initial HW settings

Although the R-Car PCIe driver works as it is, there are a number of
incorrect settings that this patch corrects. It corrects:
 - enabling the PCI Express Extended Cap ID.
 - setting Data Link Layer Link Active Reporting Capable.
 - terminating list of capabilities.

It also removes enabling the MAC data scrambling as this is the default HW
setting, and removes incorrect code to enable slave bus mastering as this
is done by the PCI core.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2c3fd4c935880d756cb57f4bcdb35bb4b8348ec8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPCI: rcar: Remove redundant config accessor register number checks
Sergei Shtylyov [Fri, 27 Jun 2014 14:59:13 +0000 (18:59 +0400)]
PCI: rcar: Remove redundant config accessor register number checks

The PCI core will have already checked the configuration register address
before calling the {read|write}() methods; so don't check it again in these
methods.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 8eb12c3b420fb5243ce9b4a8878f3b88a3c91e33)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vb2: Fix stream start and buffer completion race
Laurent Pinchart [Mon, 23 Jun 2014 21:00:22 +0000 (23:00 +0200)]
v4l: vb2: Fix stream start and buffer completion race

videobuf2 stores the driver streaming state internally in the queue in
the start_streaming_called variable. The state is set right after the
driver start_stream operation returns, and checked in the
vb2_buffer_done() function, typically called from the frame completion
interrupt handler. A race condition exists if the hardware finishes
processing the first frame before the start_stream operation returns.

Fix this by setting start_streaming_called to 1 before calling the
start_stream operation, and resetting it to 0 if the operation fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit 752bfe5395aa0609def7292c97a37c314ace5837)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
drivers/media/v4l2-core/videobuf2-core.c

9 years agov4l: Add premultiplied alpha flag for pixel formats
Laurent Pinchart [Tue, 27 May 2014 13:12:43 +0000 (15:12 +0200)]
v4l: Add premultiplied alpha flag for pixel formats

When set, the new V4L2_PIX_FMT_FLAG_PREMUL_ALPHA flag indicates that the
pixel values are premultiplied by the alpha channel value.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit e6619dfbf287a75082ec04bc2a8d2df6e3a16299)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
Documentation/DocBook/media/v4l/v4l2.xml

9 years agov4l: Support extending the v4l2_pix_format structure
Laurent Pinchart [Tue, 27 May 2014 12:41:05 +0000 (14:41 +0200)]
v4l: Support extending the v4l2_pix_format structure

The v4l2_pix_format structure has no reserved field. It is embedded in
the v4l2_framebuffer structure which has no reserved fields either, and
in the v4l2_format structure which has reserved fields that were not
previously required to be zeroed out by applications.

To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer
structure, and use the priv field as a magic value to indicate that the
application has set all v4l2_pix_format extended fields and zeroed all
reserved fields following the v4l2_pix_format field in the v4l2_format
structure.

The availability of this API extension is reported to userspace through
the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the
priv field is still set to the magic value at [GS]_FMT return wouldn't
be enough, as older kernels don't zero the priv field on return.

To simplify the internal API towards drivers zero the extended fields
and set the priv field to the magic value for applications not aware of
the extensions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit af7553db487e1dbcd069d1bb9426fc8c591ea1f4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
Documentation/DocBook/media/v4l/v4l2.xml
Documentation/DocBook/media/v4l/vidioc-querycap.xml
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/mem2mem_testdev.c
include/uapi/linux/videodev2.h

9 years agoDocBook: media: Document ALPHA_COMPONENT control usage on output devices
Laurent Pinchart [Wed, 21 May 2014 22:16:01 +0000 (00:16 +0200)]
DocBook: media: Document ALPHA_COMPONENT control usage on output devices

Extend the V4L2_CID_ALPHA_COMPONENT control for use on output devices,
to set the alpha component value when the output format doesn't have an
alpha channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit e632d2f4e25c574a29b269f9f4b0cef2995e402d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: Add ARGB and XRGB pixel formats
Laurent Pinchart [Thu, 22 May 2014 01:07:55 +0000 (03:07 +0200)]
v4l: Add ARGB and XRGB pixel formats

The existing RGB pixel formats are ill-defined in respect to their alpha
bits and their meaning is driver dependent. Create new standard ARGB and
XRGB variants with clearly defined meanings and make the existing
variants deprecated.

The new pixel formats 4CC values have been selected to match the DRM
4CCs for the same in-memory formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit 3ddcdb02a95582bf472a89c934bca6e56f07a2db)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml

9 years agovb2: only call start_streaming if sufficient buffers are queued
Hans Verkuil [Mon, 24 Feb 2014 16:51:03 +0000 (13:51 -0300)]
vb2: only call start_streaming if sufficient buffers are queued

In commit 02f142ecd24aaf891324ffba8527284c1731b561 support was added to
start_streaming to return -ENOBUFS if insufficient buffers were queued
for the DMA engine to start. The vb2 core would attempt calling
start_streaming again if another buffer would be queued up.

Later analysis uncovered problems with the queue management if start_streaming
would return an error: the buffers are enqueued to the driver before the
start_streaming op is called, so after an error they are never returned to
the vb2 core. The solution for this is to let the driver return them to
the vb2 core in case of an error while starting the DMA engine. However,
in the case of -ENOBUFS that would be weird: it is not a real error, it
just says that more buffers are needed. Requiring start_streaming to give
them back only to have them requeued again the next time the application
calls QBUF is inefficient.

This patch changes this mechanism: it adds a 'min_buffers_needed' field
to vb2_queue that drivers can set with the minimum number of buffers
required to start the DMA engine. The start_streaming op is only called
if enough buffers are queued. The -ENOBUFS handling has been dropped in
favor of this new method.

Drivers are expected to return buffers back to vb2 core with state QUEUED
if start_streaming would return an error. The vb2 core checks for this
and produces a warning if that didn't happen and it will forcefully
reclaim such buffers to ensure that the internal vb2 core state remains
consistent and all buffer-related resources have been correctly freed
and all op calls have been balanced.

__reqbufs() has been updated to check that at least min_buffers_needed
buffers could be allocated. If fewer buffers were allocated then __reqbufs
will free what was allocated and return -ENOMEM. Based on a suggestion from
Pawel Osciak.

__create_bufs() doesn't do that check, since the use of __create_bufs
assumes some advance scenario where the user might want more control.
Instead streamon will check if enough buffers were allocated to prevent
streaming with fewer than the minimum required number of buffers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit b3379c6201bb3555298cdbf0aa004af260f2a6a4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/v4l2-core/videobuf2-core.c

9 years agovb2: rename queued_count to owned_by_drv_count
Hans Verkuil [Thu, 6 Feb 2014 08:46:11 +0000 (05:46 -0300)]
vb2: rename queued_count to owned_by_drv_count

'queued_count' is a bit vague since it is not clear to which queue it
refers to: the vb2 internal list of buffers or the driver-owned list
of buffers.

Rename to make it explicit.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 6ea3b980f058d9dbc79ba88c652d581fa2d00792)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
drivers/media/v4l2-core/videobuf2-core.c

9 years agovb2: Check if there are buffers before streamon
Ricardo Ribalda Delgado [Wed, 8 Jan 2014 08:01:33 +0000 (05:01 -0300)]
vb2: Check if there are buffers before streamon

This patch adds a test preventing streamon() if there is no buffer
ready.

Without this patch, a user could call streamon() before
preparing any buffer. This leads to a situation where if he calls
close() before calling streamoff() the device is kept streaming.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 249f5a58bc844506fef2e9d5d55a88fbc708c5fa)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7791: Add HSCIF pin support
Nobuhiro Iwamatsu [Tue, 10 Jun 2014 02:37:15 +0000 (11:37 +0900)]
pinctrl: sh-pfc: r8a7791: Add HSCIF pin support

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 92b14d56d3edf68eff258bc69a62e295dbfb4780)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: final error path cleanup
Ben Dooks [Wed, 4 Jun 2014 11:42:13 +0000 (12:42 +0100)]
mmc: sh-mmcif: final error path cleanup

Remove the error path items that are no longer needed. The mmc card-detect
code cleans up after itself (and registers with devm) and the host error
is the same as the clock disable.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 39792eaab1561e145b07cc36025c23b175b26a1e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: no need to call pm_runtime_suspend on error
Ben Dooks [Wed, 4 Jun 2014 11:42:12 +0000 (12:42 +0100)]
mmc: sh-mmcif: no need to call pm_runtime_suspend on error

The pm_runtime call should implicitly disable the device once the
probe is over if there is no explicit reference gained. There is no
need to call pm_runtime_suspend() before the pm_runtime_disable()
call.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 17ec61c8e8dd656647b50b1db1e223c02fb051a6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: use devm_ for irq management
Ben Dooks [Wed, 4 Jun 2014 11:42:11 +0000 (12:42 +0100)]
mmc: sh-mmcif: use devm_ for irq management

Use devm_request_threaded_irq() for the host interrupt handlers so we
do not have to worry about freeing them on exit or error. Tidies up the
exit path code for the driver.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 75bed8a19d15f94bf712bf610ad4e3425c035ebc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: use devm_ for clock management
Ben Dooks [Wed, 4 Jun 2014 11:42:10 +0000 (12:42 +0100)]
mmc: sh-mmcif: use devm_ for clock management

Use the devm_clk_get() code to get the clock and allow it to be freed
automatically on release.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 5337a334e4f4f1e9384054e34e08ffab9be93c81)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: use devm_ for ioremap
Ben Dooks [Wed, 4 Jun 2014 11:42:09 +0000 (12:42 +0100)]
mmc: sh-mmcif: use devm_ for ioremap

Start tidying the probe/release code by using devm_ioremap_resource() to
map the IO registers.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 402de61c9ef9aff9990f6629cc7527827db331e0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh-mmcif: update to print version and bus clock rate on probe
Ben Dooks [Wed, 4 Jun 2014 11:42:08 +0000 (12:42 +0100)]
mmc: sh-mmcif: update to print version and bus clock rate on probe

Change the initial print to show chip version and the bus rate it is
working at instead of the driver version. This is more useful information
as we already know which driver version from the kernel it is in.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit ba09ab6ba9d2ec27cd68e8cf655ac163cd4d5f6a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoDocumentation: dt-bindings: update xhci-platform DT binding for R-Car H2 and M2
Yoshihiro Shimoda [Wed, 28 May 2014 11:23:26 +0000 (20:23 +0900)]
Documentation: dt-bindings: update xhci-platform DT binding for R-Car H2 and M2

This commit extends the compatible string list of the xhci-platform
binding with the new "renesas,xhci-r8a7790" and "renesas,xhci-r8a7791"
compatible strings. It is used to describe the xHCI controller which
is available in the R-Car H2 and M2 SoCs.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c7c1ce8061c0dc5b848e5df0ba459dbbf78057d7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoDocumentation: dt-bindings: update xhci-platform DT binding
Gregory CLEMENT [Thu, 15 May 2014 10:17:34 +0000 (12:17 +0200)]
Documentation: dt-bindings: update xhci-platform DT binding

This commit extends the compatible string list of the xhci-platform
binding with the new "armada-375-xhci" and "armada-380-xhci"
compatible strings. It is used to describe the XHCI controller which
is available in the Armada 375 and 38x SoCs.

It also indicates that an optional 'clocks' property is now supported.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 023bfe83e278dca17abc491f8e1182211edb0559)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: fixup index of src/dst mod when capture
Kuninori Morimoto [Wed, 11 Jun 2014 06:41:03 +0000 (23:41 -0700)]
ASoC: rsnd: fixup index of src/dst mod when capture

Index of dma name should use -1, not +1 when capture case.
Thank you Dan.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4cf612780cec81317a0278b28679a8b69ea8f09c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr
Kuninori Morimoto [Fri, 23 May 2014 06:25:54 +0000 (23:25 -0700)]
ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr

The DMAC src/dst addr needs to be set from driver when DT case.
(It was set from SoC/DMAEngine code when non-DT case)
This patch adds rsnd_gen_dma_addr() to set DMAC src/dst addr.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ad32d0c7b0e993433df152ae747652647eb65a27)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: care DMA slave channel name for DT
Kuninori Morimoto [Fri, 23 May 2014 06:25:49 +0000 (23:25 -0700)]
ASoC: rsnd: care DMA slave channel name for DT

Renesas sound driver is supporting to use DMAEngine.
But, DMA slave channel name "tx", "rx" is not enough
in DT case.
Becuase, it has many ports and path combination.

This patch adds rsnd_dma_of_name() to find
DMA channel name, for example
memory to SSI0 is "mem_ssi0",
SSI0 to memory is "ssi0_mem",
SSI0 to SRC0   is "ssi0_src0",
SRC0 to SSI0   is "src0_ssi0",
SRC0 to DVC0   is "src0_dvc0"...

Renesas sound want to use PIO transfer mode for some reasons.
It will be PIO tranfer mode if device node doesn't have
DMA settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 199e7688bdf7d188d70c3432c96ec13d8a14b341)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: module name is unified
Kuninori Morimoto [Fri, 23 May 2014 06:25:43 +0000 (23:25 -0700)]
ASoC: rsnd: module name is unified

Renesas sound driver uses many modules (= SSI/SRC/DVC),
and each module had own name.
But, each module name can be used as several purpose,
like clock name, DMA name etc...
This patch uses common name for each module.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8aefda5046f417c551e3acdeb2cf37949a4b75e9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>