platform/kernel/linux-stable.git
9 years agoASoC: simple-card: fix __asoc_simple_card_dai_init
Xiubo Li [Fri, 24 Jan 2014 07:43:00 +0000 (15:43 +0800)]
ASoC: simple-card: fix __asoc_simple_card_dai_init

If the CPU/CODEC DAI set_sysclk() is not support, the -ENOTSUPP will returnd.
Here do the check like set_fmt().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4763ebe226156db985fe75bfe930c4069d1f4207)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:52:00 +0000 (16:52 +0100)]
ASoC: simple-card: simplify code

Rename the pointer to the private data structure to 'priv' to avoid confusion with the platform data pointer.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b367a3252b365fd545fc589a40cad3976e73d7d7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:56 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

The platform data structure contains information which is used only by
the driver, and the driver allocates platform information fields which
are of no use.
Move the driver specific data to a new private structure and cleanup
the platform data structure.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 45fce59496cbabd46761e6980c05c82d94d08eaa)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:52 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

In the non-DT sequence, the platform data is copied as a whole to the
dynamic card info and the same pointer 'cinfo' is used to copy the
platform information to the card.

Use 'priv' as the pointer to the dynamic card info and copy only the
useful information from the platform data.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ca65b492c7a265b220f763fd68bf87391213248f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:48 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

The CPU and CODEC DAI names are still copied to the user info structure.
Put them directly in the DAI links.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 520084729267ac8df1651ad2f118a1d4a631a10a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:45 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

Have a cleaner code using a DAI link pointer.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5ca8ba4180a6f629d51dba699b4a6428cc5eeba7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:41 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

The OF pointers are put in the stack and then copied to the card
descriptor.
Put them directly at their right place.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 201a0eac7fe5e7a8fa33f0742304f885bc344d0d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:37 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

The DT values are copied to the non-DT structure before being moved to
the card structure.
Set directly the DT values in the card and move the non-DT copy to the
non-DT sequence.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2bee991460a838ee3c8064a6d880c4e7bc41717a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: simple-card: simplify code
Jean-Francois Moine [Wed, 15 Jan 2014 15:51:33 +0000 (16:51 +0100)]
ASoC: simple-card: simplify code

The check of the mandatory fields is done for DT in its specific sequence.
Move the global check to the non-DT sequence.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 7722f830a45f7fbb8f2f7b23265793980bdf3397)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio-regulator: fix forgotten gpios-states reading
Heiko Stuebner [Thu, 13 Feb 2014 15:34:32 +0000 (16:34 +0100)]
regulator: gpio-regulator: fix forgotten gpios-states reading

Commit 934624d6e9f0 ("regulator: gpio-regulator: do not open-code counting
and access of dt array elements") forgot to convert the recently added
gpios-states property using the same pattern.

Convert this instance to use the of-helpers too, resolving the build error.

Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 1f5a9623eb4300a722eab2f6c6a31a194c804cec)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio-regulator: do not open-code counting and access of dt array elements
Heiko Stuebner [Wed, 12 Feb 2014 00:01:08 +0000 (01:01 +0100)]
regulator: gpio-regulator: do not open-code counting and access of dt array elements

Open coding the counting of elements in a dt-property is abstracted by the newly
introduced of_property_count_uXX_elems functions. Additionally the raw iteration
over the states element exposes the endian conversion and dtb-format details,
which according to Mark Rutland "would be nice to limit [...] to of_ helper
functions".

Thus change gpio-regulator to use the helper for element counting and
of_property_read_u32_index for retrieval of individual values.

This makes it possible to remove the raw access to the states property entirely.

Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 934624d6e9f0b3d41557c4105c286e8daeaadb4e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio: explain detail of gpios-states
Kuninori Morimoto [Wed, 12 Feb 2014 01:27:27 +0000 (17:27 -0800)]
regulator: gpio: explain detail of gpios-states

gpios-states is array, and default is 0

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 907339818ecd66c20f57bbf53d1160c3dc9d34a8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio: print warning if gpios <-> gpios-states mismatch on DT
Kuninori Morimoto [Wed, 12 Feb 2014 01:27:08 +0000 (17:27 -0800)]
regulator: gpio: print warning if gpios <-> gpios-states mismatch on DT

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5676ddc5c62861467582b10b88aadb25ea9c3b52)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio: Document regulator-type property
Mark Brown [Thu, 5 Dec 2013 19:08:55 +0000 (19:08 +0000)]
regulator: gpio: Document regulator-type property

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 7f196ec938967af7c3aa2506b8edcd7da5f5ebc6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio: add gpios-status for DT
Kuninori Morimoto [Fri, 31 Jan 2014 05:25:14 +0000 (21:25 -0800)]
regulator: gpio: add gpios-status for DT

config->gpios[x].flags indicates initial pin status,
and it will be used for drvdata->state
on gpio_regulator_probe().
But, current of_get_gpio_regulator_config() doesn't care
about this flags.
This patch adds new gpios-status property in order to
care about initial pin status.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 0094050d783bbadffe83effef11a0bda901153ce)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: gpio-regulator: Remove unneeded OOM error message
Fabio Estevam [Fri, 24 Jan 2014 17:48:18 +0000 (15:48 -0200)]
regulator: gpio-regulator: Remove unneeded OOM error message

There is no need to print an OOM message after devm_kzalloc, since there is
a generic OOM message in place.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9c25960cbba1fb452adf6a7b9d740fc4358f7d92)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: CMT, MTU2, TMU and STI should depend on GENERIC_CLOCKEVENTS
Geert Uytterhoeven [Thu, 20 Mar 2014 14:05:50 +0000 (15:05 +0100)]
clocksource: CMT, MTU2, TMU and STI should depend on GENERIC_CLOCKEVENTS

If GENERIC_CLOCKEVENTS=n:

drivers/clocksource/sh_cmt.c:54:28: error: field 'ced' has incomplete type
drivers/clocksource/sh_cmt.c: In function 'sh_cmt_interrupt':
drivers/clocksource/sh_cmt.c:407:23: error: 'CLOCK_EVT_MODE_ONESHOT' undeclared (first use in this function)

drivers/clocksource/sh_mtu2.c:44:28: error: field 'ced' has incomplete type
drivers/clocksource/sh_mtu2.c: In function 'ced_to_sh_mtu2':
drivers/clocksource/sh_mtu2.c:184:70: warning: initialization from incompatible pointer type [enabled by default]
drivers/clocksource/sh_mtu2.c: At top level:
drivers/clocksource/sh_mtu2.c:188:16: warning: 'enum clock_event_mode' declared inside parameter list [enabled by default]

drivers/clocksource/sh_tmu.c:45:28: error: field 'ced' has incomplete type
drivers/clocksource/sh_tmu.c: In function 'sh_tmu_interrupt':
drivers/clocksource/sh_tmu.c:207:21: error: 'CLOCK_EVT_MODE_ONESHOT' undeclared (first use in this function)

drivers/clocksource/em_sti.c:44:28: error: field 'ced' has incomplete type
drivers/clocksource/em_sti.c: In function 'ced_to_em_sti':
drivers/clocksource/em_sti.c:251:69: warning: initialization from incompatible pointer type [enabled by default]
drivers/clocksource/em_sti.c: At top level:
drivers/clocksource/em_sti.c:255:16: warning: 'enum clock_event_mode' declared inside parameter list [enabled by default]

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <damm@opensource.se>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: http://lkml.kernel.org/r/1395324352-9146-1-git-send-email-geert@linux-m68k.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 87291a9267ecc0a8efceb4d9cbd4da870f958fc1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclocksource: Add Kconfig entries for CMT, MTU2, TMU and STI
Magnus Damm [Thu, 20 Feb 2014 11:54:45 +0000 (12:54 +0100)]
clocksource: Add Kconfig entries for CMT, MTU2, TMU and STI

Add Kconfig entries for CMT, MTU2, TMU and STI to
drivers/clocksource/Kconfig. This will allow us to
get rid of duplicated entires in architecture code
such as arch/sh and arch/arm/mach-shmobile.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit fd3f1270d237d1afb344ee6bfd0e50c488c29e34)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: core: add TDM slot parsing from DT supports
Xiubo Li [Fri, 14 Feb 2014 01:34:35 +0000 (09:34 +0800)]
ASoC: core: add TDM slot parsing from DT supports

For some CPU/CODEC DAI devices the TDM slot infomation maybe needed. This
patch adds the slot parsing from DT supports.

TDM slot properties:
    dai-tdm-slot-num : Number of slots in use.
    dai-tdm-slot-width :  Width in bits for each slot.

For instance:
    dai-tdm-slot-num = <2>;
    dai-tdm-slot-width = <8>;

And for each spcified driver, there could be one .of_xlate_tdm_slot_mask()
to specify a explicit mapping of the channels and the slots. If it's absent
the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the
tx and rx masks.

For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit
for an active slot as default, and the default active bits are at the LSB of
the masks.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 89c6785715592a6b082b3f9f28c27bb14b041c7d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: add snd_soc_of_parse_audio_simple_widgets for DT
Xiubo Li [Sat, 8 Feb 2014 07:59:52 +0000 (15:59 +0800)]
ASoC: add snd_soc_of_parse_audio_simple_widgets for DT

This patch adds snd_soc_of_parse_audio_simple_widgets() and supports
below style of widgets name on DT:

"template-wname", "user supplied wname"

For instance:
simple-audio-widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";

The "template-wname" currently includes: "Microphone", "Line", "Headphone"
and "Speaker".

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9a6d48605e632e84db2895cf752c65b3c908cd09)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof: add functions to count number of elements in a property
Heiko Stuebner [Wed, 12 Feb 2014 00:00:34 +0000 (01:00 +0100)]
of: add functions to count number of elements in a property

The need to know the number of array elements in a property is
a common pattern. To prevent duplication of open-coded implementations
add a helper static function that also centralises strict sanity
checking and DTB format details, as well as a set of wrapper functions
for u8, u16, u32 and u64.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ad54a0cfbeb4bd4033d09017557ccbc423f9d5ff)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoshdma: add R-Car Audio DMAC peri peri driver
Kuninori Morimoto [Tue, 11 Mar 2014 01:11:50 +0000 (18:11 -0700)]
shdma: add R-Car Audio DMAC peri peri driver

Add support Audio DMAC peri peri driver
for Renesas R-Car Gen2 SoC, using 'shdma-base'
DMA driver framework.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[fixed checkpatch error]
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit e43a34e3ec5d1b14a11c3220f5a12aa797d73cd1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoDMA: shdma: Fix warnings due to improper casts and printk formats
Laurent Pinchart [Wed, 11 Dec 2013 14:29:15 +0000 (15:29 +0100)]
DMA: shdma: Fix warnings due to improper casts and printk formats

Use the %zu and %pad printk specifiers to print size_t and dma_addr_t
variables, and cast pointers to uintptr_t instead of unsigned int where
applicable. This fixes warnings on platforms where pointers and/or
dma_addr_t have a different size than int

Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit 42e4a12a0d92d09de66d8b5b2c85855b8051c15e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: core: Allow regulator_set_voltage for fixed regulators
Bjorn Andersson [Wed, 5 Feb 2014 20:30:26 +0000 (12:30 -0800)]
regulator: core: Allow regulator_set_voltage for fixed regulators

Make it okay to call regulator_set_voltage on regulators with fixed
voltage if the requested range overlaps the current/configured voltage.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c00dc359e5e0b10de993651d8e73e60c41bf29cd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit d5c3595331d512c6af6b636cef687421c2ba11e3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: Make core DMA mapping functions generate scatterlists
Mark Brown [Sun, 2 Feb 2014 13:47:47 +0000 (13:47 +0000)]
spi: Make core DMA mapping functions generate scatterlists

We cannot unconditionally use dma_map_single() to map data for use with
SPI since transfers may exceed a page and virtual addresses may not be
provided with physically contiguous pages. Further, addresses allocated
using vmalloc() need to be mapped differently to other addresses.

Currently only the MXS driver handles all this, a few drivers do handle
the possibility that buffers may not be physically contiguous which is
the main potential problem but many don't even do that. Factoring this
out into the core will make it easier for drivers to do a good job so if
the driver is using the core DMA code then generate a scatterlist
instead of mapping to a single address so do that.

This code is mainly based on a combination of the existing code in the MXS
and PXA2xx drivers. In future we should be able to extend it to allow the
core to concatenate adjacent transfers if they are compatible, improving
performance.

Currently for simplicity clients are not allowed to use the scatterlist
when they do DMA mapping, in the future the existing single address
mappings will be replaced with use of the scatterlist most likely as
part of pre-verifying transfers.

This change makes it mandatory to use scatterlists when using the core DMA
mapping so update the s3c64xx driver to do this when used with dmaengine.
Doing so makes the code more ugly but it is expected that the old s3c-dma
code can be removed very soon.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6ad45a27cbe343ec8d7888e5edf6335499a4b555)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: core: Ignore unsupported spi-[tr]x-bus-width property values
Geert Uytterhoeven [Mon, 26 May 2014 12:05:25 +0000 (14:05 +0200)]
spi: core: Ignore unsupported spi-[tr]x-bus-width property values

Rejecting unsupported values of spi-tx-bus-width and spi-rx-bus-width
may break compatibility with future DTs. Just ignore them, falling back
to Single SPI Transfers.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 80874d8c9e9cbfa195572dfea46f2314098b3869)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: Provide core support for full duplex devices
Mark Brown [Tue, 28 Jan 2014 20:17:03 +0000 (20:17 +0000)]
spi: Provide core support for full duplex devices

It is fairly common for SPI devices to require that one or both transfer
directions is always active. Currently drivers open code this in various
ways with varying degrees of efficiency. Start factoring this out by
providing flags SPI_MASTER_MUST_TX and SPI_MASTER_MUST_RX. These will cause
the core to provide buffers for the requested direction if none are
specified in the underlying transfer.

Currently this is fairly inefficient since we actually allocate a data
buffer which may get large, support for mapping transfers using a
scatterlist will allow us to avoid this for DMA based transfers.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3a2eba9bd0a6447dfbc01635e4cd0689f5f2bdad)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: Provide core support for DMA mapping transfers
Mark Brown [Thu, 16 Jan 2014 12:22:43 +0000 (12:22 +0000)]
spi: Provide core support for DMA mapping transfers

The process of DMA mapping buffers for SPI transfers does not vary between
devices so in order to save duplication of code in drivers this can be
factored out into the core, allowing it to be integrated with the work that
is being done on factoring out the common elements from the data path
including more sharing of dmaengine code.

In order to use this masters need to provide a can_dma() operation and while
the hardware is prepared they should ensure that DMA channels are provided
in tx_dma and rx_dma. The core will then ensure that the buffers are mapped
for DMA prior to calling transfer_one_message().

Currently the cleanup on error is not complete, this needs to be improved.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 99adef310f682d6343cb40c1f6c9c25a4b3a450d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoregulator: da9210: Remove redundant error message
Sachin Kamat [Thu, 20 Feb 2014 08:53:02 +0000 (14:23 +0530)]
regulator: da9210: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6c48acfb2affa8b2aed810bb67888e0d1720a884)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoi2c: i2c-rcar: deprecate class based instantiation
Wolfram Sang [Mon, 10 Feb 2014 10:04:06 +0000 (11:04 +0100)]
i2c: i2c-rcar: deprecate class based instantiation

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 96c4b6bb5ddb03881dfc1c91410548432138d4ba)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoi2c: rcar: add compatible entry for r8a7791
Wolfram Sang [Thu, 20 Feb 2014 08:03:20 +0000 (09:03 +0100)]
i2c: rcar: add compatible entry for r8a7791

While we are here, also brush up the devicetree binding documentation.
The example was an inappropriate copy from the sh_mobile driver.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit e89364556824cc7a947f99173af842217074c099)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoi2c: add deprecation warning for class based instantiation
Wolfram Sang [Mon, 10 Feb 2014 10:03:56 +0000 (11:03 +0100)]
i2c: add deprecation warning for class based instantiation

Class based instantiation can cause noticeable delays when booting. This
mechanism is used when it is not possible to describe slaves on I2C
busses. As we do have other mechanisms, most embedded I2C will not need
classes and for embedded it is explicitly not recommended to use them. Add
a deprecation warning for drivers which want to disable class based
instantiation in the near future to gain boot-up time, so users relying
on this technique can switch to something better. They really should.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 0c176170089c3a7f2a891f9860f5cdc5f481ff78)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomedia: soc_camera: rcar_vin: Add support for 10-bit YUV cameras
Phil Edworthy [Tue, 25 Feb 2014 09:10:27 +0000 (06:10 -0300)]
media: soc_camera: rcar_vin: Add support for 10-bit YUV cameras

Add support for MBUS YUV10 BT656 and BT601 formats at rcar driver.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit cbe504d4d4d88375ef912975f816d1e3c3f14194)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agocpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE}
Viresh Kumar [Wed, 19 Mar 2014 05:54:58 +0000 (11:24 +0530)]
cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE}

Two cpufreq notifiers CPUFREQ_RESUMECHANGE and CPUFREQ_SUSPENDCHANGE have
not been used for some time, so remove them to clean up code a bit.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 0b443ead714f0cba797a7f2476dd756f22b5421e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Neaten dev_<level> uses
Joe Perches [Tue, 11 Mar 2014 17:10:46 +0000 (10:10 -0700)]
serial: sh-sci: Neaten dev_<level> uses

Add missing newlines and coalesce formats.
Realign arguments.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9b971cd206c019fc6aeeb7e04136a49f9312df4a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Replace hardcoded 3 by UART_PM_STATE_OFF
Geert Uytterhoeven [Tue, 11 Mar 2014 10:11:20 +0000 (11:11 +0100)]
serial: sh-sci: Replace hardcoded 3 by UART_PM_STATE_OFF

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Simon Horman <horms@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d3dfe5d9b4c8b3156b28f99f7a4a59ad8be09b15)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Add more register documentation
Geert Uytterhoeven [Tue, 11 Mar 2014 10:11:19 +0000 (11:11 +0100)]
serial: sh-sci: Add more register documentation

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Simon Horman <horms@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 26de4f1b2fb45e53a9e8f4f913b9cdf6c294070b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Remove useless casts
Geert Uytterhoeven [Tue, 11 Mar 2014 10:11:18 +0000 (11:11 +0100)]
serial: sh-sci: Remove useless casts

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Simon Horman <horms@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ff43da00e0d407cd8e7faaf2ac150001d29827e4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Replace printk() by pr_*()
Geert Uytterhoeven [Tue, 11 Mar 2014 10:11:17 +0000 (11:11 +0100)]
serial: sh-sci: Replace printk() by pr_*()

Make banner const while we're at it

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Simon Horman <horms@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6c13d5d27c5ecd7a2ce7c104c7726b0d7aa7d7b5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Add missing call to uart_remove_one_port() in failure path
Geert Uytterhoeven [Fri, 28 Feb 2014 13:21:33 +0000 (14:21 +0100)]
serial: sh-sci: Add missing call to uart_remove_one_port() in failure path

If cpufreq_register_notifier() fails, we have to remove the port added by
sci_probe_single(), which is not done by sci_cleanup_single().

Else the serial port stays active from the point of view of the serial
subsystem, and it may crash when userspace getty is started, or when the
loadable driver module is unloaded.

This was introduced by commit 6dae14216c85eea13db7b12c469475c5d30e5499
("serial: sh-sci: Fix probe error paths").

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit bf13c9a894162a91c8bb7d9555933e9fc3ff7d0e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Fix compatible string in DT bindings example
Laurent Pinchart [Thu, 6 Feb 2014 06:47:40 +0000 (15:47 +0900)]
serial: sh-sci: Fix compatible string in DT bindings example

Remove the -generic suffix from the compatible string in the serial port
DT bindings example.

Cc: devicetree@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 25eb50b97b61a237168137411550aa792bb27c00)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoserial: sh-sci: Fix cast warning
Jingoo Han [Wed, 5 Feb 2014 00:56:37 +0000 (09:56 +0900)]
serial: sh-sci: Fix cast warning

Fix the following compile warning about cast to pointer from
integer of different size.

drivers/tty/serial/sh-sci.c:2021:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3af4e960b8a12b3f07033f1c12504305e6d4df1a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh-pfc: r8a7791: Fix definition of MOD_SEL3
Phil Edworthy [Tue, 22 Apr 2014 16:38:05 +0000 (17:38 +0100)]
sh-pfc: r8a7791: Fix definition of MOD_SEL3

There is a missing 0 entry from the MOD_SEL3 table.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 0c66c5628bbb5e96360032440f53a6cb6f8973d0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh-pfc: r8a7790: Fix definition of IPSR5
Guido Piasenza [Tue, 22 Apr 2014 15:28:03 +0000 (16:28 +0100)]
sh-pfc: r8a7790: Fix definition of IPSR5

The extra entry in the table makes SCIFA0_B, and all
peripherals after it, fail.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 34ce57e9df7d14b52c7613bb2c190e411ca99186)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7791: Add alternative MSIOF pin groups
Geert Uytterhoeven [Wed, 26 Feb 2014 09:16:57 +0000 (10:16 +0100)]
pinctrl: sh-pfc: r8a7791: Add alternative MSIOF pin groups

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit e6fae2d03dc4f9172db88ad18a577c2a45b9e8ac)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7790: Add alternative MSIOF pin groups
Geert Uytterhoeven [Thu, 20 Feb 2014 19:53:40 +0000 (20:53 +0100)]
pinctrl: sh-pfc: r8a7790: Add alternative MSIOF pin groups

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 7033168da51e43ebba7870f089d275b4589df0c5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: pfc: r8a7791: add mux data for IIC(B) cores
Wolfram Sang [Sun, 23 Feb 2014 12:38:12 +0000 (13:38 +0100)]
pinctrl: pfc: r8a7791: add mux data for IIC(B) cores

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 6787141361dc77b5d55bf58760029f846244ba3a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7790: Add QSPI pin groups
Geert Uytterhoeven [Mon, 10 Feb 2014 13:00:57 +0000 (14:00 +0100)]
pinctrl: sh-pfc: r8a7790: Add QSPI pin groups

A QSPI function set consists of 3 groups:
  - qspi_ctrl (2 control wires)
  - qspi_data2 (2 data wires, for Single/Dual SPI)
  - qspi_data4 (4 data wires, for Quad SPI)

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 202909cdf117743bdbf8abc0f817950c8955c8cf)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7790: Break out USB0 OVC/VBUS
Magnus Damm [Wed, 29 Jan 2014 23:10:19 +0000 (08:10 +0900)]
pinctrl: sh-pfc: r8a7790: Break out USB0 OVC/VBUS

Create a new group for the USB0 OVC/VBUS pin by itself. This
allows us to monitor PWEN as GPIO on the Lager board.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 97e00faaf16a0642cac47937e26f437651a6b4a4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: sh-pfc: r8a7791: Add QSPI pin groups
Geert Uytterhoeven [Sun, 12 Jan 2014 11:00:30 +0000 (12:00 +0100)]
pinctrl: sh-pfc: r8a7791: Add QSPI pin groups

A QSPI function set consists of 3 groups:
  - qspi_ctrl (2 control wires)
  - qspi_data2 (2 data wires, for Single/Dual SPI)
  - qspi_data4 (4 data wires, for Quad SPI)

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
(cherry picked from commit 2d0c386f135e41865f15e467fa1c6c0ec93d4a60)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sdhi: update sh_mobile_sdhi_of_data for r8a7791
Kuninori Morimoto [Fri, 21 Feb 2014 00:55:40 +0000 (16:55 -0800)]
mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7791

This patch adds DT support for r8a7791.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 81918d25a7ae2a7eada4237d00b8d6dbecffda6c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sdhi: update sh_mobile_sdhi_of_data for r8a7790
Kuninori Morimoto [Fri, 21 Feb 2014 00:55:27 +0000 (16:55 -0800)]
mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7790

This patch updates r8a7790 DT data to have SoC specific settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 423f6c2e977de73b8723e73d8cc585de40893f5b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sdhi: update sh_mobile_sdhi_of_data for r8a7779
Kuninori Morimoto [Fri, 21 Feb 2014 00:55:12 +0000 (16:55 -0800)]
mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7779

This patch updates r8a7779 DT data to have SoC specific settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 81bbbc7278fa109fb691446a521dcfc18b87e57d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sdhi: update sh_mobile_sdhi_of_data for r8a7778
Kuninori Morimoto [Fri, 21 Feb 2014 00:54:58 +0000 (16:54 -0800)]
mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7778

This patch updates r8a7778 DT data to have SoC specific settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit b3a5d4ce65162d27a495b8fa3ac21dcdf58738b1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sdhi: tidyup sh_mobile_sdhi_of_match position
Kuninori Morimoto [Fri, 21 Feb 2014 00:54:44 +0000 (16:54 -0800)]
mmc: sdhi: tidyup sh_mobile_sdhi_of_match position

It is easier to read if sh_mobile_sdhi_of_cfg and
sh_mobile_sdhi_of_match are closer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 2772ef30eacd72fef013ac2fade2f384342ba6c7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: tmio: Adapt to proper PM configs for exported functions
Ulf Hansson [Wed, 23 Oct 2013 12:55:07 +0000 (14:55 +0200)]
mmc: tmio: Adapt to proper PM configs for exported functions

Since the users of the exported PM functions are now using the modern
PM ops macros, we can convert to the proper corresponding PM configs.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 710dec95d579bf59c157358cc9cf7b42907d1c0f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: tmio_mmc: Convert from legacy to modern PM ops
Ulf Hansson [Wed, 23 Oct 2013 12:57:50 +0000 (14:57 +0200)]
mmc: tmio_mmc: Convert from legacy to modern PM ops

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit c8964481d0273ef77a37ed2c627482fde3a1222c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agommc: sh_mobile_sdhi: Use modern PM macros to define pm callbacks
Ulf Hansson [Wed, 23 Oct 2013 12:51:31 +0000 (14:51 +0200)]
mmc: sh_mobile_sdhi: Use modern PM macros to define pm callbacks

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 4e262d7f6fd43d798175cf26223c5bd3ebfd7b13)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: ensure pm_runtime cannot suspend the device during init
Ben Dooks [Fri, 21 Mar 2014 11:09:14 +0000 (12:09 +0100)]
sh_eth: ensure pm_runtime cannot suspend the device during init

The pm_rumtime work queue is causing the device to be suspended during
initialisation, thus the initialisation may not be able to access registers
properly. As the code is called from a work queue, it is possible that this
is not seen from certain configurations/builds due to the asynchronos
nature of the code.

Another issue has also been found where the network device registration
calls back into the driver thus causing further pm_runtime calls that
also caused issues with the MDIO bus code. This has now been checked
and is the only place the MDIO can be called without the device open.

Use pm_runtime_get_sync() and pm_runtime_put() to ensure that the
pm system does not suspend it during the probe() call and remove the
now unnecessary pm_runtime_resume() call. Also add a call in the error
path to call pm_runtime_disable().

This fixes the external abort that can cause /sbin/init or other such
init processed to die.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b5893a08812602de164fa5ac6494f84df8d09a4f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: Remove goto statements that jump straight to a return
Laurent Pinchart [Thu, 20 Mar 2014 14:00:35 +0000 (15:00 +0100)]
sh_eth: Remove goto statements that jump straight to a return

"goto" is well accepted for error paths in the kernel but should not be
used unnecessarily. Return the correct value directly instead of using a
goto when possible.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f738a13d8365b0f824f3f20450b413f55374f175)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: Register MDIO bus before registering the network device
Laurent Pinchart [Thu, 20 Mar 2014 14:00:34 +0000 (15:00 +0100)]
sh_eth: Register MDIO bus before registering the network device

Network API functions that rely on the MDIO bus can be called as soon as
the driver calls register_netdev(). Register the MDIO bus before the
network device to avoid race conditions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit daacf03f0bbfefee3df107c3f7659d22e22538a7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: Simplify MDIO bus initialization and release
Laurent Pinchart [Thu, 20 Mar 2014 14:00:33 +0000 (15:00 +0100)]
sh_eth: Simplify MDIO bus initialization and release

The network device passed to the sh_mdio_init and sh_mdio_release
functions is only used to access the sh_eth_private instance. Pass it
directly to those functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bd920ff553ba17f19372501a14e432d9d92b102b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: Use the platform device as the MDIO bus parent
Laurent Pinchart [Thu, 20 Mar 2014 14:00:32 +0000 (15:00 +0100)]
sh_eth: Use the platform device as the MDIO bus parent

The MDIO bus parent is set to the network device. Beside not reflecting
the hardware topology, this prevents registering the MDIO bus before
initializing the network device. Fix it by setting the MDIO bus parent
to the platform device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a5bd60608936fbb84471a80592401ce29a68de71)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: Use the platform device for memory allocation
Laurent Pinchart [Thu, 20 Mar 2014 14:00:31 +0000 (15:00 +0100)]
sh_eth: Use the platform device for memory allocation

Memory allocated for the MDIO bus with the devm_kzalloc() API is
associated with the network device. While this will cause memory to be
freed at the right time, it doesn't allow allocating memory before the
network device is initialized.

Replace the network device with the parent platform device for memory
allocation to remove that dependency. This also improves consistency
with the other devm_* calls in the driver that all use the platform
device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aa8d422510969b705656e49fc0166d862aca9246)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: fold netif_msg_*() and netdev_*() calls into netif_*() invocations
Sergei Shtylyov [Sat, 15 Mar 2014 00:30:59 +0000 (03:30 +0300)]
sh_eth: fold netif_msg_*() and netdev_*() calls into netif_*() invocations

Now that we call netdev_*() under netif_msg_*() checks, we can fold these into
netif_*() macro invocations.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8d5009f6a9d9f4ef62a39bf68b53379b2b766c1c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: convert dev_*() to netdev_*() calls
Sergei Shtylyov [Sat, 15 Mar 2014 00:29:14 +0000 (03:29 +0300)]
sh_eth: convert dev_*() to netdev_*() calls

Convert dev_*(&ndev->dev, ...) to netdev_*(ndev, ...) calls since they are a bit
shorter and at the same time give more information on a device.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit da2468555643efbde3fb026cd46e5245800cc872)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: convert pr_*() to netdev_*() calls
Sergei Shtylyov [Sat, 15 Mar 2014 00:27:54 +0000 (03:27 +0300)]
sh_eth: convert pr_*() to netdev_*() calls

Convert pr_*() to netdev_*() calls as the latter provide info on a device.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f75f14ec2f7b552dc87b4b57b2a19e487378f774)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: exit probe with unknown register layout
Sergei Shtylyov [Sat, 15 Mar 2014 00:11:24 +0000 (03:11 +0300)]
sh_eth: exit probe with unknown register layout

Exit the driver's probe() method when the register layout is unknown as the
driver would cause kernel oops in this case anyway.

While at it, move the corresponding error message printout and convert it from
pr_err() to dev_err().

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 264be2f5a973cc85be3e31d6bf6234b55a256627)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: update OF PHY registeration
Ben Dooks [Wed, 12 Mar 2014 17:47:40 +0000 (17:47 +0000)]
sh_eth: update OF PHY registeration

If the sh_eth device is registered using OF, then the driver
should call of_mdiobus_register() to register the PHYs described
in the devicetree and then use of_phy_connect() to connect the
PHYs to the device.

This ensures that any PHYs registered in the device tree are
appropriately connected to the parent devices nodes so that
the PHY drivers can access their OF properties.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 702eca02b7c8574b42359512ebccfa777a71f66e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: add device tree support
Sergei Shtylyov [Tue, 18 Feb 2014 00:12:43 +0000 (03:12 +0300)]
sh_eth: add device tree support

Add support of the device tree probing for the Renesas SH-Mobile SoCs
documenting the device tree binding as necessary.

This work is loosely based on the original patch by Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj@renesas.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b356e978e92fccd17a3e4620a4821bdbfb706c1a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh_eth: use ETH_ZLEN instead of home-grown #define
Sergei Shtylyov [Fri, 14 Feb 2014 00:05:42 +0000 (03:05 +0300)]
sh_eth: use ETH_ZLEN instead of home-grown #define

The driver #define's and uses ETHERSMALL macro for the minimum Ethernet frame
size for which we have a standard macro ETH_ZLEN.  Use the latter  instead of
the home-grown one.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 730c8c69bc8d4640336885e20e719b0842d0fcb2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodrivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI
Geert Uytterhoeven [Tue, 6 May 2014 21:26:19 +0000 (23:26 +0200)]
drivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI

If the kernel is built to support multi-ARM configuration with shmobile
support built in, then drivers/sh is not built. This contains the PM
runtime code in drivers/sh/pm_runtime.c, which implicitly enables the
module clocks for all devices, and thus is quite essential.
Without this, the state of clocks depends on implicit reset state, or on
the bootloader.

If ARCH_SHMOBILE_MULTI then build the drivers/sh directory, but ensure that
bits that may conflict (drivers/sh/clk if the common clock framework is
enabled) or are not used (drivers/sh/intc), are not built.
Also, only enable the PM runtime code when actually running on a shmobile
SoCs that needs it.

ARCH_SHMOBILE_MULTI was added a while ago by commit
efacfce5f8a523457e9419a25d52fe39db00b26a ("ARM: shmobile: Introduce
ARCH_SHMOBILE_MULTI"), but drivers/sh was compiled for both
ARCH_SHMOBILE_LEGACY and ARCH_SHMOBILE_MULTI until commit
bf98c1eac1d4a6bcf00532e4fa41d8126cd6c187 ("ARM: Rename ARCH_SHMOBILE to
ARCH_SHMOBILE_LEGACY").

Inspired by a patch from Ben Dooks <ben.dooks@codethink.co.uk>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3c90c55dcde745bed81f6447f24ba96bda43d984)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agosh: intc: Enable driver compilation with COMPILE_TEST
Laurent Pinchart [Wed, 27 Nov 2013 01:18:37 +0000 (02:18 +0100)]
sh: intc: Enable driver compilation with COMPILE_TEST

This helps increasing build testing coverage.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4f3068f60503e08bc9e729528d9e54289980fa96)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add runtime PM support, using spi core auto_runtime_pm
Geert Uytterhoeven [Tue, 11 Mar 2014 09:59:12 +0000 (10:59 +0100)]
spi: rspi: Add runtime PM support, using spi core auto_runtime_pm

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 490c97747d5dc77dfb5826e2823b41d8b2ef7ecc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Fix loopback mode for Dual/Quad SPI Transfers
Geert Uytterhoeven [Fri, 21 Feb 2014 16:29:18 +0000 (17:29 +0100)]
spi: rspi: Fix loopback mode for Dual/Quad SPI Transfers

While normal Dual and Quad SPI Transfers are unidirectional, we must do
a bidirectional transfer if loopback mode is enabled, else rx_buf is not
filled.

With spidev it seemed to work, as spidev uses the same buffer for
tranmission and reception.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ba824d4971691a7f1f66429e378a08a95fbb5b79)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Remove empty rspi_cleanup()
Geert Uytterhoeven [Fri, 21 Feb 2014 16:29:17 +0000 (17:29 +0100)]
spi: rspi: Remove empty rspi_cleanup()

If spi_master.cleanup() is not needed, it can be left unimplemented.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ab98fcba962a57cee9fdb97aff2b25248c93cea5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Only enable interrupts when there's a need to wait
Geert Uytterhoeven [Tue, 4 Feb 2014 10:06:24 +0000 (11:06 +0100)]
spi: rspi: Only enable interrupts when there's a need to wait

rspi_wait_for_interrupt() unconditionally enables interrupts, even when the
wait condition is already satisfied. This causes a high interrupt load (2
interrupts/byte for full-duplex Single SPI transfers, 1 interrupt/byte for
RSPI with TX Only mode, or QSPI in unidirectional Dual or Quad Transfer
mode).

Change this to return immediately when the wait condition is satisfied.
This dramatically reduces the interrupt load, especially in high-speed
Quad Transfer mode, and increases transfer speed, as no interrupts need to
be handled when there's space available in the output FIFO, or data
available in the input FIFO.

Benchmark results for QSPI on r8a7791 while reading 1 MiB from 30 MHz SPI
FLASH on the Koelsch development board:

Before:
                        Single SPI      Dual SPI        Quad SPI
    Interrupts:         2096856         1048592         1048594
    Mbps:               0.9             1.6             1.6

After:

                        Single SPI      Dual SPI        Quad SPI
    Interrupts:         1048569         21295           8
    Mbps:               0.7             10.8            12.9

I don't know why Single SPI slowed down a bit.

I've also verified functionality for RSPI-RZ on r7s72100, but don't have
benchmark results as there's no SPI FLASH connected to RSPI on the Genmai
development board. Unlike RSPI and QSPI, RSPI-RZ has separate interrupts
for RX and TX, which shows that Single SPI transfers now generate (mostly)
RX interrupts, as expected.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5dd1ad23af689591d70be06ee6efcc57d1ec2d16)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: fix build error when CONFIG_OF is not set
Shimoda, Yoshihiro [Mon, 3 Feb 2014 01:43:46 +0000 (10:43 +0900)]
spi: rspi: fix build error when CONFIG_OF is not set

This patch fixes an issue that the following build error happens when
the CONFIG_OF is not set:

drivers/spi/spi-rspi.c: In function 'rspi_probe':
drivers/spi/spi-rspi.c:1203:26: error: 'rspi_of_match' undeclared (first use in this function)

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 64b67defe4eb4de2d2df8acd5584a9e28fa727d3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add support for Quad and Dual SPI Transfers on QSPI
Geert Uytterhoeven [Thu, 30 Jan 2014 08:43:50 +0000 (09:43 +0100)]
spi: rspi: Add support for Quad and Dual SPI Transfers on QSPI

Add support for Quad and Dual SPI Transfers on the Renesas Quad Serial
Peripheral Interface, as found in R-Car Gen2 SoCs like R-Car H2 (r8a7790)
and R-Car M2 (r8a7791):
  - Add unidirectional transfer methods for Quad/Dual SPI Transfers.
  - Program the sequencer to handle SPI messages with multiple transfer
    modes when Quad or Dual transfers are enabled for an SPI slave.
    Up to 4 transfer modes per SPI message are supported by the hardware.
  - Advertise the availability of Quad and Dual SPI modes on QSPI.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 880c6d114fd79a6973708744c78c7f55da6aea4c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add DT support
Geert Uytterhoeven [Tue, 28 Jan 2014 09:21:38 +0000 (10:21 +0100)]
spi: rspi: Add DT support

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 426ef76dd8a394a0e04d096941cd9acb49539a3e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Use NULL as the clock ID
Geert Uytterhoeven [Fri, 24 Jan 2014 08:44:02 +0000 (09:44 +0100)]
spi: rspi: Use NULL as the clock ID

There's only one RSPI/QSPI clock, so we can use NULL as the clock ID

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 29f397b739ceef90c8b848f6579cbacd088e896e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Convert to clk_prepare_enable/disable_unprepare
Geert Uytterhoeven [Fri, 24 Jan 2014 08:44:01 +0000 (09:44 +0100)]
spi: rspi: Convert to clk_prepare_enable/disable_unprepare

Get the driver ready for the migration to the common clock framework by
calling clk_prepare_enable() and clk_disable_unprepare().

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 17fe0d9a28fe742c467f800625459cf7bcb44b3b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add support for loopback mode
Geert Uytterhoeven [Fri, 24 Jan 2014 08:44:00 +0000 (09:44 +0100)]
spi: rspi: Add support for loopback mode

Add support for specifying loopback mode.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 06a7a3cff042a36fb7e6af71039a17c6d1a6d90f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add support for RSPI on RZ/A1H
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:59 +0000 (09:43 +0100)]
spi: rspi: Add support for RSPI on RZ/A1H

Add support for the RSPI variant in the RZ/A1H (r7s72100) SoC.

Main differences with RSPI on SH are:
  - Lack of TX only mode, hence we always have to use full duplex
    transfers,
  - The Data Register must be accessed used 8-bit operations.

RSPI on RZ is matched using the new "rspi-rz" platform device name.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 862d357f84f009fdcba22be8d6a2f82ff80ab740)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add support for more than one interrupt
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:58 +0000 (09:43 +0100)]
spi: rspi: Add support for more than one interrupt

Add support for multiple interrupts, based on the SDK reference code.
This is needed for RZ/A1H, which supports 3 interrupts.

When using multiple interrupts, they must be called "rx" (SPRI) and "tx"
(SPTI). The error interrupt (SPEI) is not used, as it matters for slave
mode only.

When using a single interrupt, it may be called "mux". If it cannot be
found, the first interrupt in the device's resources will be used.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9372220678cd4c62992f7637b2ee36b47fa58d37)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Merge qspi_send_pio() and qspi_receive_pio()
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:57 +0000 (09:43 +0100)]
spi: rspi: Merge qspi_send_pio() and qspi_receive_pio()

qspi_send_pio() and qspi_receive_pio() are very similar: they both send
and receive full duplex data to/from the hardware, but ignore the data
stream in the unused direction.
Merge them into qspi_transfer_out_in(), now supporting real full duplex.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 340a15e6f0d6cd436c55693f7328a1de02fcdb96)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Merge rspi_send_pio() and rspi_receive_pio()
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:56 +0000 (09:43 +0100)]
spi: rspi: Merge rspi_send_pio() and rspi_receive_pio()

rspi_send_pio() and rspi_receive_pio() are very similar:
  - the former only sends data, using TX Only Mode,
  - the latter sends and receives full duplex data to/from the hardware,
    but uses dummy transmit data.
Merge them into rspi_transfer_out_in(), now supporting full duplex if
needed.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8449fd76deb9ac67a15a6fb8ead7bb4595d019d2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Abstract transfer_one() for RSPI and QSPI
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:55 +0000 (09:43 +0100)]
spi: rspi: Abstract transfer_one() for RSPI and QSPI

Split off qspi_transfer_one() (which doesn't support DMA yet) from
rspi_transfer_one().
Replace the abstraction of send_pio()/receive_pio() by the abstracrion of
transfer_one().

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit eb557f75269e82dd26a79be536eca223ddc3eaf7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Add rspi_data_{out,in,out_in}() helpers
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:54 +0000 (09:43 +0100)]
spi: rspi: Add rspi_data_{out,in,out_in}() helpers

Add helpers rspi_data_{out,in,out_in}() to write, read, or write and
read data to/from the Data Register, taking care of waiting until data
or space is available in the buffers.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 35301c996046243ca6e41d490dea2823f045614c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Abstract 8/16-bit Data Register access
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:53 +0000 (09:43 +0100)]
spi: rspi: Abstract 8/16-bit Data Register access

Add rspi_{write,read}_data(), to abstract 8-bit (QSPI, and RSPI on RZ/A1H)
versus 16-bit (RSPI) Data Register access.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 74da76865d57161cadf8f324281f23ed3eb5db9c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Use core message handling
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:52 +0000 (09:43 +0100)]
spi: rspi: Use core message handling

Let the generic SPI core handle SPI messages, calling into our
rspi_transfer_one() method.

rspi_assert_ssl() and rspi_negate_ssl() are absorbed into
rspi_prepare_message() and rspi_unprepare_message(), as they actually
enable/disable the whole SPI function, instead of just (de)asserting the
chip select line.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 79d2349542f38663c3096f389115b1f131d6e564)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agospi: rspi: Remove unused mesg parameter from {send,receive}_pio()
Geert Uytterhoeven [Fri, 24 Jan 2014 08:43:51 +0000 (09:43 +0100)]
spi: rspi: Remove unused mesg parameter from {send,receive}_pio()

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 91949a2d4a96195ccd37322fafe8d16c68dda86e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agothermal: rcar-thermal: update thermal zone only when temperature changes
Patrick Titiano [Fri, 28 Feb 2014 13:10:04 +0000 (14:10 +0100)]
thermal: rcar-thermal: update thermal zone only when temperature changes

Avoid updating the thermal zone in case an IRQ was triggered but the
temperature didn't effectively change.
Note this is not a driver issue.
Below is a captured debug trace illustrating the purpose of this patch:
out of 8 thermal zone updates, only 2 are actually necessary.

[   41.120000] rcar_thermal_work(): cctemp=25000
[   41.120000] rcar_thermal_work(): nctemp=30000
[   41.120000] rcar_thermal_work(): temp is now 30000C, update thermal zone
[   58.990000] rcar_thermal_work(): cctemp=30000
[   58.990000] rcar_thermal_work(): nctemp=30000
[   58.990000] rcar_thermal_work(): same temp, do not update thermal zone
[   59.290000] rcar_thermal_work(): cctemp=30000
[   59.290000] rcar_thermal_work(): nctemp=30000
[   59.290000] rcar_thermal_work(): same temp, do not update thermal zone
[   59.590000] rcar_thermal_work(): cctemp=30000
[   59.590000] rcar_thermal_work(): nctemp=30000
[   59.590000] rcar_thermal_work(): same temp, do not update thermal zone
[   59.890000] rcar_thermal_work(): cctemp=30000
[   59.890000] rcar_thermal_work(): nctemp=30000
[   59.890000] rcar_thermal_work(): same temp, do not update thermal zone
[   60.190000] rcar_thermal_work(): cctemp=30000
[   60.190000] rcar_thermal_work(): nctemp=30000
[   60.190000] rcar_thermal_work(): same temp, do not update thermal zone
[   60.490000] rcar_thermal_work(): cctemp=30000
[   60.490000] rcar_thermal_work(): nctemp=30000
[   60.490000] rcar_thermal_work(): same temp, do not update thermal zone
[   60.790000] rcar_thermal_work(): cctemp=30000
[   60.790000] rcar_thermal_work(): nctemp=35000
[   60.790000] rcar_thermal_work(): temp is now 35000C, update thermal zone

I suspect this may be due to sensor sampling accuracy / fluctuation,
but no formal proof.

Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit 9477165ec525d47abb1cb6523698e0cd89d65ddb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agothermal: rcar-thermal: fix same mask applied twice
Patrick Titiano [Fri, 28 Feb 2014 13:10:03 +0000 (14:10 +0100)]
thermal: rcar-thermal: fix same mask applied twice

Mask is already applied preceding the if statement.
Remove the second mask.

Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit 206c0cba095acbb91d552d220207d690c9b29594)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: call rsnd_dai_pointer_update() from outside of lock
Kuninori Morimoto [Wed, 23 Apr 2014 05:59:12 +0000 (14:59 +0900)]
ASoC: rsnd: call rsnd_dai_pointer_update() from outside of lock

rsnd_soc_dai_trigger() will be called
after rsnd_dai_pointer_update() function
which is using rsnd_lock().
Thus, it should be called from outside of rsnd_lock().
Kernel will be hangup without this patch.
Special thanks to Kataoka-san

Reported-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 836b31fe1a9791d84ed95783ed42ebd5719f7918)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: fix clock prepare/unprepare
Ben Dooks [Fri, 11 Apr 2014 01:16:33 +0000 (18:16 -0700)]
ASoC: rsnd: fix clock prepare/unprepare

As with the previous commit, before a clock can be used it must be prepared
for use. Change from clk_enable() and clk_disable() to the versions of the
calls which also prepare and un-prepare the clocks.

Will fix warnings from the clock code when this is used.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 79861bbb759053a9b91026becc0915d0f1f8d37d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rcar: bugfix: it cares about the non-src case
Kuninori Morimoto [Mon, 24 Mar 2014 04:23:42 +0000 (21:23 -0700)]
ASoC: rcar: bugfix: it cares about the non-src case

src might not exist.
kernel will be hung-up without this patch in such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b1eac430b6a4bee6821273d9b41dd3593eb7830b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add DeviceTree support
Kuninori Morimoto [Tue, 18 Mar 2014 02:29:55 +0000 (19:29 -0700)]
ASoC: rsnd: add DeviceTree support

Support for loading the Renesas R-Car sound driver via DeviceTree.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 90e8e50fce3585d6f9902701de08389b027dadc6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rcar: fixup SND_SOC_DAIFMT_CBx_CFx flags
Kuninori Morimoto [Fri, 14 Mar 2014 00:56:43 +0000 (17:56 -0700)]
ASoC: rcar: fixup SND_SOC_DAIFMT_CBx_CFx flags

SND_SOC_DAIFMT_CBx_CFx means "codec" side master/slave mode.
Then, rcar will be master mode if it was SND_SOC_DAIFMT_CBS_CFS.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e1508289404ab6ca28e0dc931612600f0441c417)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: rename scu to src
Kuninori Morimoto [Tue, 4 Mar 2014 04:51:21 +0000 (20:51 -0800)]
ASoC: rsnd: rename scu to src

R-Car sound has SCU unit which has SRC/CTU/MIX/DVC,
and current rsnd driver has scu.c and scu module.
Current scu.c has SRC support only.
My first concept was control these feature on scu.c
but, it become difficult and un-understandable now.
This patch rename scu to src

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