]> Pileus Git - ~andy/linux/log
~andy/linux
12 years agoMerge branch 'spear/dt' into spear/clock
Arnd Bergmann [Mon, 14 May 2012 15:31:45 +0000 (17:31 +0200)]
Merge branch 'spear/dt' into spear/clock

Conflicts:
arch/arm/mach-spear3xx/clock.c
arch/arm/mach-spear3xx/include/mach/generic.h
arch/arm/mach-spear3xx/include/mach/misc_regs.h
arch/arm/mach-spear3xx/spear320.c
arch/arm/mach-spear6xx/clock.c
arch/arm/mach-spear6xx/include/mach/misc_regs.h

Resolve even more merge conflicts.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoMerge branch 'spear/pinctrl' into spear/clock
Arnd Bergmann [Mon, 14 May 2012 13:33:42 +0000 (15:33 +0200)]
Merge branch 'spear/pinctrl' into spear/clock

Conflicts:
arch/arm/mach-spear3xx/Makefile
arch/arm/mach-spear3xx/clock.c
arch/arm/mach-spear3xx/include/mach/generic.h
arch/arm/mach-spear6xx/clock.c
arch/arm/plat-spear/Makefile
drivers/pinctrl/core.c

This resolves some annoying merge conflicts.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoSPEAr: Update defconfigs
Viresh Kumar [Tue, 1 May 2012 12:46:50 +0000 (18:16 +0530)]
SPEAr: Update defconfigs

This patch updates following configuration:
- Update MTD specific configurations
- Enables JFFS2 FS support
- Updates 6xx defconfig, with recent changes done by Arnd in 6xx Kconfig

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stefan Roese <sr@denx.de>
12 years agoSPEAr: Add SMI NOR partition info in dts files
Viresh Kumar [Tue, 1 May 2012 12:39:22 +0000 (18:09 +0530)]
SPEAr: Add SMI NOR partition info in dts files

This patch adds NOR partitions in all SPEAr boards dts files.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoSPEAr: Switch to common clock framework
Viresh Kumar [Tue, 10 Apr 2012 03:32:35 +0000 (09:02 +0530)]
SPEAr: Switch to common clock framework

SPEAr SoCs used its own clock framework since now. From now on they will move to
use common clock framework.

This patch updates existing SPEAr machine support to adapt for common clock
framework.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agoSPEAr: Call clk_prepare() before calling clk_enable
Viresh Kumar [Mon, 16 Apr 2012 08:26:18 +0000 (13:56 +0530)]
SPEAr: Call clk_prepare() before calling clk_enable

With common clock framework, it is must to call clk_{un}prepare() before/after
clk_{dis}enable. This patch fixes this for SPEAr timer.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
12 years agoSPEAr: clk: Add General Purpose Timer Synthesizer clock
Viresh Kumar [Wed, 11 Apr 2012 12:34:23 +0000 (18:04 +0530)]
SPEAr: clk: Add General Purpose Timer Synthesizer clock

All SPEAr SoC's contain GPT Synthesizers. Their Fout is derived from
following equations:

Fout= Fin/((2 ^ (N+1)) * (M+1))

This patch adds in support for this type of clock.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
12 years agoSPEAr: clk: Add Fractional Synthesizer clock
Viresh Kumar [Wed, 11 Apr 2012 12:34:23 +0000 (18:04 +0530)]
SPEAr: clk: Add Fractional Synthesizer clock

All SPEAr SoC's contain Fractional Synthesizers. Their Fout is derived from
following equations:

Fout = Fin / (2 * div) (division factor)
div is 17 bits:-
     0-13 (fractional part)
     14-16 (integer part)
     div is (16-14 bits).(13-0 bits) (in binary)

     Fout = Fin/(2 * div)
     Fout = ((Fin / 10000)/(2 * div)) * 10000
     Fout = (2^14 * (Fin / 10000)/(2^14 * (2 * div))) * 10000
     Fout = (((Fin / 10000) << 14)/(2 * (div << 14))) * 10000

div << 14 is simply 17 bit value written at register.

This patch adds in support for this type of clock.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
12 years agoSPEAr: clk: Add Auxiliary Synthesizer clock
Viresh Kumar [Wed, 11 Apr 2012 12:34:23 +0000 (18:04 +0530)]
SPEAr: clk: Add Auxiliary Synthesizer clock

All SPEAr SoC's contain Auxiliary Synthesizers. Their Fout is derived based on
values of eq, x and y.

Fout from synthesizer can be given from two equations:
Fout1 = (Fin * X/Y)/2 EQ1
Fout2 = Fin * X/Y EQ2

This patch adds in support for this type of clock.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
12 years agoSPEAr: clk: Add VCO-PLL Synthesizer clock
Viresh Kumar [Tue, 10 Apr 2012 03:32:35 +0000 (09:02 +0530)]
SPEAr: clk: Add VCO-PLL Synthesizer clock

All SPEAr SoC's contain PLLs. Their Fout is derived based on following equations

- In normal mode
  vco = (2 * M[15:8] * Fin)/N

- In Dithered mode
  vco = (2 * M[15:0] * Fin)/(256 * N)

pll_rate = vco/2^p

vco and pll are very closely bound to each other,
"vco needs to program: mode, m & n" and "pll needs to program p",
both share common enable/disable logic and registers.

This patch adds in support for this type of clock.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
12 years agoSPEAr: Add DT bindings for SPEAr's timer
Viresh Kumar [Sat, 21 Apr 2012 07:45:37 +0000 (13:15 +0530)]
SPEAr: Add DT bindings for SPEAr's timer

All SPEAr SoC's use ST's Timer module. This patch adds device tree probing
capability for that.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoMerge branches 'depends/pinctrl/devel' and 'depends/rmk/clkdev' into spear/pinctrl
Arnd Bergmann [Sat, 12 May 2012 18:38:42 +0000 (20:38 +0200)]
Merge branches 'depends/pinctrl/devel' and 'depends/rmk/clkdev' into spear/pinctrl

The spear/pinctrl branch has hard dependencies on both the
pinctrl branch and the clkdev branch. We merge those here
to fix it up without having to rebase a branch that has
been pulled into other stable branches already.

Conflicts:
Documentation/driver-model/devres.txt

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoMerge branch 'depends/rmk/clkdev' into next/clock
Arnd Bergmann [Fri, 11 May 2012 15:13:00 +0000 (17:13 +0200)]
Merge branch 'depends/rmk/clkdev' into next/clock

* depends/rmk/clkdev:
  CLKDEV: provide helpers for common clock framework
  ARM: 7392/1: CLKDEV: Optimize clk_find()
  ARM: 7376/1: clkdev: Implement managed clk_get()

12 years agoMerge branch 'depends/clk/clk-next' into next/clock
Arnd Bergmann [Fri, 11 May 2012 14:34:55 +0000 (16:34 +0200)]
Merge branch 'depends/clk/clk-next' into next/clock

Mike Turquette <mturquette@ti.com> has asked me to take the clock
changes through the arm-soc tree while there are still so many
inderdependencies, so this is the entire branch.

* depends/clk/clk-next: (30 commits)
  clk: add a fixed factor clock
  clk: mux: assign init data
  clk: remove COMMON_CLK_DISABLE_UNUSED
  clk: prevent spurious parent rate propagation
  MAINTAINERS: add entry for common clk framework
  clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled
  clk: Use a separate struct for holding init data.
  clk: constify parent name arrays in macros
  clk: remove trailing whitespace from clk.h
  clk: select CLKDEV_LOOKUP for COMMON_CLK
  clk: Don't set clk->new_rate twice
  clk: clk-private: Add DEFINE_CLK macro
  clk: clk-gate: Create clk_gate_endisable()
  clk: Fix typo in comment
  clk: propagate round_rate for CLK_SET_RATE_PARENT case
  clk: pass parent_rate into .set_rate
  clk: always pass parent_rate into .round_rate
  clk: basic: improve parent_names & return errors
  clk: core: copy parent_names & return error codes
  clk: Constify parent name arrays
  ...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agopinctrl: (cosmetic) fix two entries in DocBook comments
Guennadi Liakhovetski [Wed, 9 May 2012 07:22:40 +0000 (09:22 +0200)]
pinctrl: (cosmetic) fix two entries in DocBook comments

This removes a repeated word and a repeated and incomplete line from two
pinctrl headers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoclk: add a fixed factor clock
Sascha Hauer [Thu, 3 May 2012 10:06:14 +0000 (15:36 +0530)]
clk: add a fixed factor clock

Having fixed factors/dividers in hardware is a common pattern, so
add a basic clock type doing this. It basically describes a fixed
factor clock using a nominator and a denominator.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Viresh Kumar <viresh.kumar@st.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
[mturquette@linaro.org: constify parent_names in static init macro]
[mturquette@linaro.org: copy/paste bug from mux in static init macro]
[mturquette@linaro.org: fix error handling in clk_register_fixed_factor]
[mturquette@linaro.org: improve division accuracy; thanks to Saravana]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: mux: assign init data
Mike Turquette [Mon, 7 May 2012 01:48:11 +0000 (18:48 -0700)]
clk: mux: assign init data

The original conversion to struct clk_hw_init failed to add the pointer
assignment in clk_register_mux.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
12 years agoclk: remove COMMON_CLK_DISABLE_UNUSED
Mike Turquette [Wed, 2 May 2012 22:45:32 +0000 (15:45 -0700)]
clk: remove COMMON_CLK_DISABLE_UNUSED

Exposing this option generates confusion and incorrect behavior for
single-image builds across platforms.  Enable this behavior permanently.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Saravana Kannan <skannan@codeaurora.org>
12 years agoclk: prevent spurious parent rate propagation
Mike Turquette [Wed, 2 May 2012 23:23:43 +0000 (16:23 -0700)]
clk: prevent spurious parent rate propagation

Patch 'clk: always pass parent_rate into .round_rate' made a subtle
change to the semantics of .round_rate.  It is now expected for the
parent's rate to always be passed in, simplifying the implemenation of
various .round_rate callback definitions.

However the patch also introduced a bug in clk_calc_new_rates whereby a
clock without the CLK_SET_RATE_PARENT flag set could still propagate a
rate change up to a parent clock if the the .round_rate callback
modified the &best_parent_rate value in any way.

This patch fixes the issue at the framework level (in
clk_calc_new_rates) by specifically handling the case where the
CLK_SET_RATE_PARENT flag is not set.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
12 years agopinctrl: add more info to error msgs in pin_request
Stephen Warren [Tue, 1 May 2012 17:14:15 +0000 (11:14 -0600)]
pinctrl: add more info to error msgs in pin_request

Additionally print which pin the request failed for, which entity already
claimed it, and what entity was trying to claim it.

Remove duplicate device name from a debug message.

Clean up some indentation.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoMAINTAINERS: add entry for common clk framework
Mike Turquette [Thu, 3 May 2012 01:37:45 +0000 (18:37 -0700)]
MAINTAINERS: add entry for common clk framework

Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoCLKDEV: provide helpers for common clock framework
Russell King [Wed, 2 May 2012 08:30:32 +0000 (09:30 +0100)]
CLKDEV: provide helpers for common clock framework

The common clock framework allocates clocks dynamically.  Provide a
set of helpers to streamline the clkdev registration of the clock
lookups to avoid repetitive code sequences.

Reviewed-by: Viresh Kumar <viresh.kumar@st.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoclk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled
Viresh Kumar [Wed, 11 Apr 2012 10:33:42 +0000 (16:03 +0530)]
clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is enabled

This is well documented but isn't implemented. clk_set_rate() must check if
flags have CLK_SET_RATE_GATE bit set and is enabled too.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: Use a separate struct for holding init data.
Saravana Kannan [Thu, 26 Apr 2012 05:58:56 +0000 (22:58 -0700)]
clk: Use a separate struct for holding init data.

Create a struct clk_init_data to hold all data that needs to be passed from
the platfrom specific driver to the common clock framework during clock
registration. Add a pointer to this struct inside clk_hw.

This has several advantages:
* Completely hides struct clk from many clock platform drivers and static
  clock initialization code that don't care for static initialization of
  the struct clks.
* For platforms that want to do complete static initialization, it removed
  the need to directly mess with the struct clk's fields while still
  allowing to statically allocate struct clk. This keeps the code more
  future proof even if they include clk-private.h.
* Simplifies the generic clk_register() function and allows adding optional
  fields in the future without modifying the function signature.
* Simplifies the static initialization of clocks on all platforms by
  removing the need for forward delcarations or convoluted macros.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[mturquette@linaro.org: kept DEFINE_CLK_* macros and __clk_init]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergman <arnd.bergmann@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Richard Zhao <richard.zhao@linaro.org>
Cc: Saravana Kannan <skannan@codeaurora.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Deepak Saxena <dsaxena@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
12 years agoclk: constify parent name arrays in macros
Rajendra Nayak [Fri, 27 Apr 2012 12:28:13 +0000 (17:58 +0530)]
clk: constify parent name arrays in macros

parent name array is now expected to be const char *, make
the relevent changes in the clk macros which define
default clock types.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agopinctrl: add pinctrl-mxs support
Shawn Guo [Sat, 28 Apr 2012 05:00:50 +0000 (13:00 +0800)]
pinctrl: add pinctrl-mxs support

Add pinctrl support for Freescale MXS SoCs, i.MX23 and i.MX28.
The driver supports device tree probe only.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: pinctrl-imx: add imx6q pinctrl driver
Dong Aisheng [Fri, 27 Apr 2012 12:26:17 +0000 (20:26 +0800)]
pinctrl: pinctrl-imx: add imx6q pinctrl driver

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: pinctrl-imx: add imx pinctrl core driver
Dong Aisheng [Fri, 27 Apr 2012 12:26:16 +0000 (20:26 +0800)]
pinctrl: pinctrl-imx: add imx pinctrl core driver

The driver has mux and config support while the gpio is still
not supported.
For select input setting, the driver will handle it internally
and do not need user to take care of it.

The pinctrl-imx core driver will parse the dts file and dynamically
create the pinmux functions and groups.

Each IMX SoC pinctrl driver should register pins with a pin register map
including mux register and config register and select input map to core
for proper operations.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agodt: add of_get_child_count helper function
Dong Aisheng [Fri, 27 Apr 2012 03:36:20 +0000 (11:36 +0800)]
dt: add of_get_child_count helper function

Currently most code to get child count in kernel are almost same,
add a helper to implement this function for dt to use.

Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: support gpio request deferred probing
Dong Aisheng [Wed, 25 Apr 2012 11:38:13 +0000 (19:38 +0800)]
pinctrl: support gpio request deferred probing

As pinctrl handles, it may be possible the pinctrl gpio ranges
are still not got registered when user call pinctrl_gpio_request.
Thus, add defer support for it too.

Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoARM: SPEAr3xx: Correct keyboard data passed from DT
Viresh Kumar [Tue, 24 Apr 2012 05:45:39 +0000 (11:15 +0530)]
ARM: SPEAr3xx: Correct keyboard data passed from DT

keyboard data passed via DT is in wrong format. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agopinctrl: add pinctrl_provide_dummies interface for platforms to use
Dong Aisheng [Thu, 26 Apr 2012 08:15:50 +0000 (16:15 +0800)]
pinctrl: add pinctrl_provide_dummies interface for platforms to use

Add a interface pinctrl_provide_dummies for platform to indicate
whether it needs use pinctrl dummy state.

ChangeLog v3->v4:
* remove dummy gpio support in pinctrl subsystem.
  Let gpio driver decide whether it wants to use pinctrl gpio mux
  function.
ChangeLog v2->v3:
* Also changed the missed pinctrl gpio APIs in v1.
ChangeLog v1->v2:
* Based on sascha's suggestion, drop using kconfig since it will hide
  pinctrl errors on all other boards.
  See: https://lkml.org/lkml/2012/4/18/282
  It seemed both Linus and Stephen agreed with this way, so i'm ok
  with it too.
* Add dummy gpio support.
  pinctrl gpio in the same situation as state.
* Patch name changed.
  Original is pinctrl: handle dummy state in core.
* Split removing old dt dummy interface into a separate patch

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: enhance reporting of errors when loading from DT
John Crispin [Thu, 26 Apr 2012 14:47:11 +0000 (16:47 +0200)]
pinctrl: enhance reporting of errors when loading from DT

There are a few places in the api where the code simply returns -EINVAL when
it finds an error. An example is pinmux_map_to_setting() which now reports an
error if we try to match a group with a function that it does not support.

The reporting of errors in pinconf_check_ops and pinmux_check_ops now has the
same style and is located inside the according functions and not the calling
code.

When the map is found in the DT but the default state can not be selected we
get an error to know that the code at least tried.

The patch also removes a stray word from one comment and a "->" from another
for the sake of consistency.

Finally we replace a few pr_err/debug() calls with dev_err/dbg().

Thanks go to Stephen Warren for reviewing the patch and enhancing the reporting
inside pinmux_map_to_setting().

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: add kerneldoc for pinctrl_ops device tree functions
Stephen Warren [Thu, 26 Apr 2012 16:18:52 +0000 (10:18 -0600)]
pinctrl: add kerneldoc for pinctrl_ops device tree functions

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: propagate map validation errors
Stephen Warren [Wed, 25 Apr 2012 16:32:16 +0000 (10:32 -0600)]
pinctrl: propagate map validation errors

pinctrl_register_map() was returning early if pinmux_validate_map() or
pinconf_validate_map() failed, but was not actually returning the error
code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agopinctrl: fix dangling comment
Linus Walleij [Tue, 24 Apr 2012 13:20:02 +0000 (15:20 +0200)]
pinctrl: fix dangling comment

This comment was referring to an older PINMUX define, it should
be PINCTRL now.

Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoclk: remove trailing whitespace from clk.h
Rob Herring [Mon, 9 Apr 2012 20:24:59 +0000 (15:24 -0500)]
clk: remove trailing whitespace from clk.h

Remove trailing whitespace from 2 lines.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agoclk: select CLKDEV_LOOKUP for COMMON_CLK
Rob Herring [Mon, 9 Apr 2012 20:24:58 +0000 (15:24 -0500)]
clk: select CLKDEV_LOOKUP for COMMON_CLK

Using the common clock infrastructure without the common clkdev code makes
little sense, so select CLKDEV_LOOKUP for COMMON_CLK.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agoclk: Don't set clk->new_rate twice
Viresh Kumar [Tue, 17 Apr 2012 11:15:38 +0000 (16:45 +0530)]
clk: Don't set clk->new_rate twice

if (!clk->ops->round_rate && (clk->flags & CLK_SET_RATE_PARENT)) is true, then
we don't need to set clk->new_rate here, as we will call clk_calc_subtree()
afterwards and it also sets clk->new_rate.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: clk-private: Add DEFINE_CLK macro
Viresh Kumar [Tue, 17 Apr 2012 11:15:36 +0000 (16:45 +0530)]
clk: clk-private: Add DEFINE_CLK macro

All macros used for creating different kind of clocks have similar code for
initializing struct clk. This patch removes those redundant lines and create
another macro DEFINE_CLK.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: clk-gate: Create clk_gate_endisable()
Viresh Kumar [Tue, 17 Apr 2012 11:15:37 +0000 (16:45 +0530)]
clk: clk-gate: Create clk_gate_endisable()

This patch tries to remove duplicate code for clk_gate clocks. This creates
another routine clk_gate_endisable() which will take care of enable/disable
clock with knowledge of CLK_GATE_SET_TO_DISABLE flag.

It works on following logic:

For enabling clock, enable = 1
set2dis = 1 -> clear bit -> set = 0
set2dis = 0 -> set bit -> set = 1

For disabling clock, enable = 0
set2dis = 1 -> set bit -> set = 1
set2dis = 0 -> clear bit -> set = 0

So, result is always: enable xor set2dis.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: Fix typo in comment
Viresh Kumar [Tue, 17 Apr 2012 11:15:35 +0000 (16:45 +0530)]
clk: Fix typo in comment

CLK_MUX_INDEX_BIT is mistakenly written as CLK_MUX_INDEX_BITWISE in comment. Fix
it.

CLK_GATE_SET_TO_DISABLE is mistakenly written as CLK_GATE_SET_DISABLE in
comment. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: propagate round_rate for CLK_SET_RATE_PARENT case
Shawn Guo [Thu, 12 Apr 2012 12:50:19 +0000 (20:50 +0800)]
clk: propagate round_rate for CLK_SET_RATE_PARENT case

Need to propagate round_rate call for the clk that has no .round_rate
operation but with flag CLK_SET_RATE_PARENT set.

For example, clk_mux is a clk with no .round_rate operation.  However,
it could likely be in a clk_set_rate propagation path, saying it has
parent clk who has .round_rate and .set_rate operations.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: pass parent_rate into .set_rate
Shawn Guo [Thu, 12 Apr 2012 12:50:18 +0000 (20:50 +0800)]
clk: pass parent_rate into .set_rate

For most of .set_rate implementation, parent_rate will be used, so just
like passing parent_rate into .recalc_rate, let's pass parent_rate into
.set_rate too.

It also updates the kernel doc for .set_rate ops.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: always pass parent_rate into .round_rate
Shawn Guo [Thu, 12 Apr 2012 12:50:17 +0000 (20:50 +0800)]
clk: always pass parent_rate into .round_rate

The parent_rate will likely be used by most .round_rate implementation
no matter whether flag CLK_SET_RATE_PARENT is set or not, so let's
always pass parent_rate into .round_rate.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: basic: improve parent_names & return errors
Mike Turquette [Tue, 27 Mar 2012 00:51:03 +0000 (17:51 -0700)]
clk: basic: improve parent_names & return errors

This patch is the basic clk version of 'clk: core: copy parent_names &
return error codes'.

The registration functions are changed to allow the core code to copy
the array of strings and allow platforms to declare those arrays as
__initdata.

This patch also converts all of the basic clk registration functions to
return error codes which better aligns them with the existing clk.h api.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: core: copy parent_names & return error codes
Mike Turquette [Thu, 29 Mar 2012 21:30:40 +0000 (14:30 -0700)]
clk: core: copy parent_names & return error codes

This patch cleans up clk_register and solves a few bugs by teaching
clk_register and __clk_init to return error codes (instead of just NULL)
to better align with the existing clk.h api.

Along with that change this patch also introduces a new behavior whereby
clk_register copies the parent_names array, thus allowing platforms to
declare their parent_names arrays as __initdata.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: Constify parent name arrays
Mark Brown [Wed, 21 Mar 2012 20:01:20 +0000 (20:01 +0000)]
clk: Constify parent name arrays

Drivers should be able to declare their arrays of parent names as const
so the APIs need to accept const arguments.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[mturquette@linaro.org: constified gate]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: Remove comment for end of CONFIG_COMMON_CLK section
Mark Brown [Sun, 1 Apr 2012 14:31:23 +0000 (15:31 +0100)]
clk: Remove comment for end of CONFIG_COMMON_CLK section

The comment is inaccurate (it actually ends the CONFIG_COMMON_CLK
section, there's no else) and given that we've just got a single level
of ifdef isn't really needed anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: Make clk_get_rate() return 0 on error
Rajendra Nayak [Mon, 26 Mar 2012 13:31:48 +0000 (19:01 +0530)]
clk: Make clk_get_rate() return 0 on error

Most users of clk_get_rate() actually assume a non zero
return value as a valid rate returned. Returing -EINVAL
might confuse such users, so make it instead return zero
on error.

Besides the return value of clk_get_rate seems to be
'unsigned long'.

Signed-off-by: Rajendra nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: declare clk_ops of basic clks in clk-provider.h
Shawn Guo [Tue, 27 Mar 2012 07:23:23 +0000 (15:23 +0800)]
clk: declare clk_ops of basic clks in clk-provider.h

Besides the static initialization, the clk_ops of basic clks could
also be used by particular clk type being subclass of the basic clks.

For example, clk_busy_divider has the same clk_ops as clk_divider,
except it has to wait for a busy bit before return success with
.set_rate.  clk_busy_divider will somehow reuse clk_ops of clk_divider.

Since clk-provider.h is included by clk-private.h, it's safe to move
those clk_ops declaration of basic clks form  clk-private.h into
clk-provider.h, so that implementation of clks like clk_busy_divider
above do not need to include clk-private.h to access those clk_ops.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: add "const" for clk_ops of basic clks
Shawn Guo [Tue, 27 Mar 2012 07:23:22 +0000 (15:23 +0800)]
clk: add "const" for clk_ops of basic clks

The clk_ops of basic clks should have "const" to match the definition
in "struct clk" and clk_register prototype.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: remove unnecessary EXPORT_SYMBOL_GPL
Shawn Guo [Tue, 27 Mar 2012 07:23:21 +0000 (15:23 +0800)]
clk: remove unnecessary EXPORT_SYMBOL_GPL

It makes no sense to have EXPORT_SYMBOL_GPL on static functions.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: use kzalloc in clk_register_mux
Shawn Guo [Tue, 27 Mar 2012 07:23:20 +0000 (15:23 +0800)]
clk: use kzalloc in clk_register_mux

Change clk_register_mux to use kzalloc, just like what all other basic
clk registration functions do.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: core: enforce clk_ops consistency
Mike Turquette [Mon, 26 Mar 2012 23:15:52 +0000 (16:15 -0700)]
clk: core: enforce clk_ops consistency

Documentation/clk.txt has some handsome ASCII art outlining which
clk_ops are mandatory for a given clock, given the capability of the
hardware.  Enforce those mandates with sanity checks in __clk_init.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: core: clk_calc_new_rates handles NULL parents
Mike Turquette [Mon, 26 Mar 2012 21:45:36 +0000 (14:45 -0700)]
clk: core: clk_calc_new_rates handles NULL parents

It is possible to call clk_set_rate on a clock with a NULL parent.  One
such example is an adjustable-rate root clock.  Ensure that
clk_calc_new_rates does not dereference parent without checking first
and also handle the corner cases gracefully.

Reported-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: core: remove dead code paths
Mike Turquette [Mon, 26 Mar 2012 18:53:47 +0000 (11:53 -0700)]
clk: core: remove dead code paths

Some static inline dummy functions were left over from before the clock
core was consolidated from several C files down to one.  Remove them.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agoclk: core: correct clk_set_rate kerneldoc
Mike Turquette [Mon, 26 Mar 2012 18:51:34 +0000 (11:51 -0700)]
clk: core: correct clk_set_rate kerneldoc

Remove old and misleading documentation from the previous clk_set_rate
implementaion.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
12 years agopinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting
John Crispin [Mon, 23 Apr 2012 17:01:58 +0000 (19:01 +0200)]
pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting

pinmux_map_to_setting() uses setting->data.mux.func/group to store the return
code of pinmux_func_name_to_selector/pinctrl_get_group_selector(). However,
struct pinctrl_setting_mux defines these elements as unsigned, resulting in all
error codes getting lost. The conditionals following the assignments will always
evaluate to false thus breaking the error paths.

This bug can be triggered by loading a pinmux group map from the devicetree
with an invalid function/group string.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoSPEAr3xx: Add pinctrl support for boards
Viresh Kumar [Thu, 29 Mar 2012 03:00:19 +0000 (08:30 +0530)]
SPEAr3xx: Add pinctrl support for boards

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
12 years agoSPEAr: Remove existing padmux support for SPEAr
Viresh Kumar [Tue, 3 Apr 2012 11:57:10 +0000 (17:27 +0530)]
SPEAr: Remove existing padmux support for SPEAr

We must use pinctrl framework instead of defining per SoC pinmux drivers. This
patch removes existing padmux support present for SPEAr platform.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
12 years agopinctrl: Add SPEAr3xx pinctrl drivers
Viresh Kumar [Wed, 28 Mar 2012 16:57:07 +0000 (22:27 +0530)]
pinctrl: Add SPEAr3xx pinctrl drivers

This adds pinctrl driver for SPEAr3xx family. SPEAr3xx family supports three
families: SPEAr300, SPEAr310 and SPEAr320.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
12 years agopinctrl: Add SPEAr pinctrl drivers
Viresh Kumar [Wed, 28 Mar 2012 16:57:07 +0000 (22:27 +0530)]
pinctrl: Add SPEAr pinctrl drivers

This adds pinctrl driver for SPEAr platform. It also updates MAINTAINERS file
for SPEAr pinctrl drivers.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
12 years agoARM: spear: remove most mach/*.h header contents
Arnd Bergmann [Wed, 11 Apr 2012 17:30:11 +0000 (17:30 +0000)]
ARM: spear: remove most mach/*.h header contents

The register and irq definitions in mach/*.h for spear3xx and
spear6xx are now mostly obsolete, after the platforms have been
converted to device tree based probing and the data is now
part of the device tree files.

The misc_regs.h contents are moved into clock.c because that is
the only user, aside from the DMA_CHN_CFG that should eventually
get handled differently. Some of the contents of mach/spear.h
still remain, because they are used to set up the static map table,
timer, uart and auxdata tables, but almost everything got removed.
We might remove everything but the map table as the DT conversion
completes, but that is not a priority. I've also made sure to
make both copies of spear.h more or less identical so we can
eventually combine them.

The spear3?0.h files were only used by the spear3?0.c files, so I
merged the contents in there and removed the bits that were unused.
This is something that should still be looked at.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr: Update defconfigs
Viresh Kumar [Wed, 21 Mar 2012 03:48:03 +0000 (09:18 +0530)]
SPEAr: Update defconfigs

Recently device tree support is added for SPEAr3xx & SPEAr6xx and we must
upgrade defconfig for that to get compiled. This patches does it.

There are few more rearrangements done in defconfig automatically, when i run
make savedefconfig.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr: Add PL080 DMA support for 3xx and 6xx
Viresh Kumar [Mon, 26 Mar 2012 04:59:23 +0000 (10:29 +0530)]
SPEAr: Add PL080 DMA support for 3xx and 6xx

Both SPEAr3xx and SPEAr6xx families have one instance of ARM PL080 DMA
controller. This patch adds in support for that.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoARM: SPEAr3xx: Add device-tree support to SPEAr3xx architecture
Viresh Kumar [Thu, 22 Mar 2012 18:47:43 +0000 (00:17 +0530)]
ARM: SPEAr3xx: Add device-tree support to SPEAr3xx architecture

This patch adds a generic target for SPEAr3xx machines that can be configured
via the device-tree. Currently the following devices are supported via the
devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- PL110 CLCD
- SP805 WDT
- Synopsys DW I2C
- Synopsys DW ethernet
- ST FSMC-NAND
- ST SPEAR-SMI
- ST SPEAR-KEYBOARD
- ST SPEAR-RTC
- ARASAN SDHCI-SPEAR
- SPEAR-EHCI
- SPEAR-OHCI

Other peripheral devices will follow in later patches.

This also removes IO_ADDRESS macro and creates 16 MB static mappings instead of
4K for individual peripherals. This is done to have efficient TLB lookup for any
I/O windows that are located closely together. ioremap() on this range will
return this mapping only instead of creating another.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr3xx: Replace printk() with pr_*()
Viresh Kumar [Mon, 26 Mar 2012 05:09:43 +0000 (10:39 +0530)]
SPEAr3xx: Replace printk() with pr_*()

For better print logs/messages, it is advisable to use pr_*() routines instead
of directly calling printks. This patch removes direct calling of printks for
spear3xx.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr6xx: Add compilation support for dtbs using 'make dtbs'
Viresh Kumar [Mon, 26 Mar 2012 04:36:57 +0000 (10:06 +0530)]
SPEAr6xx: Add compilation support for dtbs using 'make dtbs'

'make dtbs' compiles all dtbs for a family. For this we need to add entries for
all board dtb's in Makefile.boot file. This patch does it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr3xx: Add clock instance of usb hosts - ehci and ohci 0 and 1
Viresh Kumar [Wed, 28 Mar 2012 09:15:30 +0000 (14:45 +0530)]
SPEAr3xx: Add clock instance of usb hosts - ehci and ohci 0 and 1

This patch adds following clocks: "usbh.0_clk" and "usbh.1_clk". They are used
by ehci and ohci drivers for SPEAr3xx usb host devices.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoSPEAr: Use CLKDEV_INIT for defining clk_lookups
Viresh Kumar [Wed, 21 Mar 2012 15:12:51 +0000 (20:42 +0530)]
SPEAr: Use CLKDEV_INIT for defining clk_lookups

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
12 years agoARM: SPEAr600: Change FSMC and SMI clock names
Stefan Roese [Thu, 22 Mar 2012 12:41:13 +0000 (20:41 +0800)]
ARM: SPEAr600: Change FSMC and SMI clock names

Change FSMC and SMI clock names to match the ones needed for DT based
probing.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Viresh Kumar <viresh.kumar@st.com>
12 years agoLinux 3.4-rc4 v3.4-rc4
Linus Torvalds [Sat, 21 Apr 2012 21:47:52 +0000 (14:47 -0700)]
Linux 3.4-rc4

12 years agosparc32,leon: add notify_cpu_starting()
Yong Zhang [Thu, 19 Apr 2012 20:28:32 +0000 (20:28 +0000)]
sparc32,leon: add notify_cpu_starting()

Otherwise cpu_active_mask will not set, which lead to other issue.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sat, 21 Apr 2012 19:45:52 +0000 (12:45 -0700)]
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull "ARM: SoC fixes" from Olof Johansson:
 * at91, ux500, imx, omap and bcmring:
  - at91 fixes for =m driver build issues, irqdomain fixes and config
    dependency fixes
  - ux500 kconfig dependency fixes and a  smp wakeup bugfix
  - imx idle bugfix and build fix due to irq domain changes
  - omap uart pinmux fixes, softreset regression revert and misc fixes
  - bcmring build error regression fix

 * ux500 and imx had some small defconfig updates in this branch

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits)
  ARM: bcmring: fix UART declarations
  ARM: imx: Fix imx5 idle logic bug
  ARM: imx27-dt: Fix build due to removal of irq_domain_add_simple()
  ARM: imx_v4_v5_defconfig: Add support for CONFIG_REGULATOR_FIXED_VOLTAGE
  ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  ARM: OMAP: serial: Fix the ocp smart idlemode handling bug
  ARM: OMAP2+: UART: Fix incorrect population of default uart pads
  ARM: OMAP: sram: fix BUG in dpll code for !PM case
  dmaengine: Kconfig: fix Atmel at_hdmac entry
  USB: gadget/at91_udc: add gpio_to_irq() function to vbus interrupt
  USB: ohci-at91: change annotations for probe/remove functions
  leds-atmel-pwm.c: Make pwmled_probe() __devinit
  ARM: at91: fix at91sam9261ek Ethernet dm9000 irq
  ARM: at91: fix rm9200ek flash size
  ARM: at91: remove empty at91_init_serial function
  ARM: at91: fix typo in at91_pmc_base assembly declaration
  ARM: at91: Export at91_matrix_base
  ARM: at91: Export at91_pmc_base
  ARM: at91: Export at91_ramc_base
  ARM: at91: Export at91_st_base
  ...

12 years agoMerge tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 21 Apr 2012 19:44:37 +0000 (12:44 -0700)]
Merge tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:
 - Build fix for omap_hsmmc with OF against 3.4-rc1.
 - Fix CONFIG_MMC_UNSAFE_RESUME semantics regression against 3.3, which
   broke hotplug card detection when UNSAFE_RESUME is set.
 - Fix a race condition in omap_hsmmc with runtime PM.
 - Fix two libertas SDIO-powered-resume regressions.
 - Small fixes for discard/sanitize, dw_mmc, cd-gpio and esdhc-imx.

* tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: core: Do not pre-claim host in suspend
  mmc: dw_mmc: prevent NULL dereference for dma_ops
  mmc: unbreak sdhci-esdhc-imx on i.MX25
  mmc: cd-gpio: Include header to pickup exported symbol prototypes
  mmc: sdhci: refine non-removable card checking for card detection
  mmc: dw_mmc: Fix switch from DMA to PIO
  mmc: remove MMC bus legacy suspend/resume method
  mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
  mmc: omap_hsmmc: build fix for CONFIG_OF=y and CONFIG_MMC_OMAP_HS=m
  mmc: fixes for eMMC v4.5 sanitize operation
  mmc: fixes for eMMC v4.5 discard operation

12 years agoMerge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Sat, 21 Apr 2012 19:43:23 +0000 (12:43 -0700)]
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 - Fixes a regression at DVB core when switching from DVB-S2 to DVB-S on
   Kaffeine (Fedora 16 Bugzilla #812895);
 - Fixes a mutex unlock at an error condition at drx-k;
 - Fix winbond-cir set mode;
 - mt9m032: Fix a compilation breakage with some random Kconfig;
 - mt9m032: fix two dead locks;
 - xc5000: don't require an special firmware (that won't be provided by
   the vendor) just because the xtal frequency is different;
 - V4L DocBook: fix some typos at multi-plane formats description.

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmware
  [media] V4L: mt9m032: fix compilation breakage
  [media] V4L: DocBook: Fix typos in the multi-plane formats description
  [media] V4L: mt9m032: fix two dead-locks
  [media] rc-core: set mode for winbond-cir
  [media] drxk: Does not unlock mutex if sanity check failed in scu_command()
  [media] dvb_frontend: Fix a regression when switching back to DVB-S

12 years agoMerge tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
Linus Torvalds [Sat, 21 Apr 2012 19:42:12 +0000 (12:42 -0700)]
Merge tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD fixes from Samuel Ortiz:
 "We have 3 build fixes, a OMAP USB host PHY reset fix and the twl6040
  conversion to an i2c driver.  The latter may not sound like a fix but
  the twl6040 MFD driver won't probe without it, triggering an OMAP4
  audio regression."

* tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Fix modular builds of rc5t583 regulator support
  mfd: Fix asic3_gpio_to_irq
  ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue
  mfd: Convert twl6040 to i2c driver, and separate it from twl core
  mfd : Fix dbx500 compilation error

12 years agokill mm argument of vm_munmap()
Al Viro [Sat, 21 Apr 2012 01:57:04 +0000 (21:57 -0400)]
kill mm argument of vm_munmap()

it's always current->mm

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoperfmon: kill some helpers and arguments
Al Viro [Sat, 21 Apr 2012 01:53:35 +0000 (21:53 -0400)]
perfmon: kill some helpers and arguments

pfm_vm_munmap() is simply vm_munmap() and pfm_remove_smpl_mapping()
always get current as the first argument.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoaio: don't bother with unmapping when aio_free_ring() is coming from exit_aio()
Al Viro [Sat, 21 Apr 2012 01:49:41 +0000 (21:49 -0400)]
aio: don't bother with unmapping when aio_free_ring() is coming from exit_aio()

... since exit_mmap() is coming and it will munmap() everything anyway.
In all other cases aio_free_ring() has ctx->mm == current->mm; moreover,
all other callers of vm_munmap() have mm == current->mm, so this will
allow us to get rid of mm argument of vm_munmap().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agommc: core: Do not pre-claim host in suspend
Ulf Hansson [Thu, 19 Apr 2012 09:55:25 +0000 (11:55 +0200)]
mmc: core: Do not pre-claim host in suspend

Since SDIO drivers may want to do some SDIO operations in their suspend
callback functions, we must not keep the host claimed when calling them.

Daniel Drake reported that libertas_sdio encountered a deadlock in its
suspend function.

Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Tested-by: Daniel Drake <dsd@laptop.org>
[stable@: please apply to 3.2-stable and 3.3-stable]
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: dw_mmc: prevent NULL dereference for dma_ops
Jaehoon Chung [Wed, 18 Apr 2012 06:42:31 +0000 (15:42 +0900)]
mmc: dw_mmc: prevent NULL dereference for dma_ops

Now, dma_ops is assumed that use the IDMAC.  But if dma_ops is assigned
the pdata->dma_ops, we didn't ensure that callback function is defined.

If the callback isn't defined, then we should run in PIO mode.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: unbreak sdhci-esdhc-imx on i.MX25
Eric Bénard [Wed, 18 Apr 2012 00:30:20 +0000 (02:30 +0200)]
mmc: unbreak sdhci-esdhc-imx on i.MX25

This was broken by me in 37865fe91582582a6f6c00652f6a2b1ff71f8a78
("mmc: sdhci-esdhc-imx: fix timeout on i.MX's sdhci") where more
extensive tests would have shown that read or write of data to the
card were failing (even if the partition table was correctly read).

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: cd-gpio: Include header to pickup exported symbol prototypes
H Hartley Sweeten [Tue, 17 Apr 2012 20:03:38 +0000 (13:03 -0700)]
mmc: cd-gpio: Include header to pickup exported symbol prototypes

Include the linux/mmc/cd-gpio.h header to pickup the prototypes
for the two exported symbols.

This quiets the sparse warnings:

warning: symbol 'mmc_cd_gpio_request' was not declared. Should it be static?
warning: symbol 'mmc_cd_gpio_free' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci: refine non-removable card checking for card detection
Daniel Drake [Mon, 9 Apr 2012 23:14:20 +0000 (00:14 +0100)]
mmc: sdhci: refine non-removable card checking for card detection

Commit c79396c191bc19 ("mmc: sdhci: prevent card detection activity
for non-removable cards") disables card detection where the cards
are marked as non-removable.

This makes sense, but the implementation detail of calling
mmc_card_is_removable() causes some problems, because
mmc_card_is_removable() is overloaded with CONFIG_MMC_UNSAFE_RESUME
semantics.

In the OLPC XO case, we need CONFIG_MMC_UNSAFE_RESUME because our root
filesystem is stored on SD, but we also have external SD card slots
where we want automatic card detection.

Refine the check to only apply to hosts marked as MMC_CAP_NONREMOVABLE,
which is defined to mean that the card is *really* nonremovable. This
could be revisited in future if we find a way to improve
CONFIG_MMC_UNSAFE_RESUME semantics.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
[stable@: please apply to 3.3-stable]
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: dw_mmc: Fix switch from DMA to PIO
Seungwon Jeon [Tue, 10 Apr 2012 00:53:32 +0000 (09:53 +0900)]
mmc: dw_mmc: Fix switch from DMA to PIO

When dw_mci_pre_dma_transfer returns failure in some reasons,
dw_mci_submit_data will prepare to switch the PIO mode from DMA.
After switching to PIO mode, DMA(IDMAC in particular) is still
enabled. This makes the corruption in handling interrupt and
the driver lock-up.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: remove MMC bus legacy suspend/resume method
Chuanxiao Dong [Wed, 11 Apr 2012 11:54:38 +0000 (19:54 +0800)]
mmc: remove MMC bus legacy suspend/resume method

MMC bus is using legacy suspend/resume method, which is not compatible if
runtime pm callbacks are used. In this scenario, MMC bus suspend/resume
callbacks cannot be called when system entering S3. So change to use the
new defined dev_pm_ops for system sleeping mode.

Tested on AM335x Platform. Solves major issue/crash reported at
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg65425.html

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Tested-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoVM: add "vm_mmap()" helper function
Linus Torvalds [Sat, 21 Apr 2012 00:13:58 +0000 (17:13 -0700)]
VM: add "vm_mmap()" helper function

This continues the theme started with vm_brk() and vm_munmap():
vm_mmap() does the same thing as do_mmap(), but additionally does the
required VM locking.

This uninlines (and rewrites it to be clearer) do_mmap(), which sadly
duplicates it in mm/mmap.c and mm/nommu.c.  But that way we don't have
to export our internal do_mmap_pgoff() function.

Some day we hopefully don't have to export do_mmap() either, if all
modular users can become the simpler vm_mmap() instead.  We're actually
very close to that already, with the notable exception of the (broken)
use in i810, and a couple of stragglers in binfmt_elf.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoVM: add "vm_munmap()" helper function
Linus Torvalds [Fri, 20 Apr 2012 23:20:01 +0000 (16:20 -0700)]
VM: add "vm_munmap()" helper function

Like the vm_brk() function, this is the same as "do_munmap()", except it
does the VM locking for the caller.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agommc: omap_hsmmc: Get rid of of_have_populated_dt() usage
Rajendra Nayak [Wed, 11 Apr 2012 10:03:13 +0000 (15:33 +0530)]
mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage

of_have_populated_dt() is not expected to be used in drivers but
instead only in early platform init code.
Drivers on the other hand should rely on dev->of_node or of_match_device().
Besides usage of of_have_populated_dt() also throws up build error as below
which was reported by Balaji TK, when omap_hsmmc is built as a module.

ERROR: "allnodes" [drivers/mmc/host/omap_hsmmc.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

So get rid of all of_have_populated_dt() usage in omap_hsmmc driver and
instead use dev->of_node to make the same dicisions as earlier.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reported-by: Benoit Cousson <b-cousson@ti.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: omap_hsmmc: build fix for CONFIG_OF=y and CONFIG_MMC_OMAP_HS=m
Chris Ball [Tue, 10 Apr 2012 13:57:36 +0000 (09:57 -0400)]
mmc: omap_hsmmc: build fix for CONFIG_OF=y and CONFIG_MMC_OMAP_HS=m

Commit 46856a68dc ("mmc: omap_hsmmc: Convert hsmmc driver to use device tree")
introduced in 3.4-rc1 has a missing semi-colon, causing:

drivers/mmc/host/omap_hsmmc.c:1745: error: expected ',' or ';' before 'extern'

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: fixes for eMMC v4.5 sanitize operation
Adrian Hunter [Thu, 5 Apr 2012 11:45:48 +0000 (14:45 +0300)]
mmc: fixes for eMMC v4.5 sanitize operation

eMMC v4.5 sanitize operation erases all copies of unmapped
data.  However trim or erase operations must be used first
to unmap the required sectors.  That was not being done.

Fixes apply to linux 3.2 on.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: <stable@vger.kernel.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: fixes for eMMC v4.5 discard operation
Adrian Hunter [Thu, 5 Apr 2012 11:45:47 +0000 (14:45 +0300)]
mmc: fixes for eMMC v4.5 discard operation

eMMC v4.5 discard operation is significantly different from the
existing trim operation because it is not guaranteed to work with
the new sanitize operation.  Consequently mmc_can_trim() is
separated from mmc_can_discard().

Also the new discard operation does not result in the sectors being
set to all-zeros, so discard_zeroes_data must not be set.

In addition, the new discard has the same timeout as trim, but from
v4.5 trim is defined to use the hc timeout.  The timeout calculation
is adjusted accordingly.

Fixes apply to linux 3.2 on.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: <stable@vger.kernel.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoVM: add "vm_brk()" helper function
Linus Torvalds [Fri, 20 Apr 2012 22:35:40 +0000 (15:35 -0700)]
VM: add "vm_brk()" helper function

It does the same thing as "do_brk()", except it handles the VM locking
too.

It turns out that all external callers want that anyway, so we can make
do_brk() static to just mm/mmap.c while at it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge tag 'for-torvalds-20120418' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 20 Apr 2012 19:28:06 +0000 (12:28 -0700)]
Merge tag 'for-torvalds-20120418' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
 - Fixed compilation errors and warnings
 - Stricter checks on the ops vtable

* tag 'for-torvalds-20120418' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: implement pinctrl_check_ops
  pinctrl: include <linux/bug.h> to prevent compile errors
  pinctrl: fix compile error if not select PINMUX support

12 years agoMerge tag 'tty-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Fri, 20 Apr 2012 18:40:43 +0000 (11:40 -0700)]
Merge tag 'tty-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull 3 tiny tty bugfixes from Greg Kroah-Hartman.

* tag 'tty-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  drivers/tty/amiserial.c: add missing tty_unlock
  pch_uart: Fix dma channel unallocated issue
  ARM: clps711x: serial driver hungs are a result of call disable_irq within ISR

12 years agoMerge tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Fri, 20 Apr 2012 18:38:02 +0000 (11:38 -0700)]
Merge tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are a number of tiny USB fixes for 3.4-rc4.

  Most of them are in the USB gadget area, but a few other minor USB
  driver and core fixes are here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'usb-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
  USB: serial: cp210x: Fixed usb_control_msg timeout values
  USB: ehci-tegra: don't call set_irq_flags(IRQF_VALID)
  USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
  USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
  drivers/usb/misc/usbtest.c: add kfrees
  USB: ehci-fsl: Fix kernel crash on mpc5121e
  uwb: fix error handling
  uwb: fix use of del_timer_sync() in interrupt
  EHCI: always clear the STS_FLR status bit
  EHCI: fix criterion for resuming the root hub
  USB: sierra: avoid QMI/wwan interface on MC77xx
  usb: usbtest: avoid integer overflow in alloc_sglist()
  usb: usbtest: avoid integer overflow in test_ctrl_queue()
  USB: fix deadlock in bConfigurationValue attribute method
  usb: gadget: eliminate NULL pointer dereference (bugfix)
  usb: gadget: uvc: Remove non-required locking from 'uvc_queue_next_buffer' routine
  usb: gadget: rndis: fix Missing req->context assignment
  usb: musb: omap: fix the error check for pm_runtime_get_sync
  usb: gadget: udc-core: fix asymmetric calls in remove_driver
  usb: musb: omap: fix crash when musb glue (omap) gets initialized
  ...

12 years agoMerge tag 'stable/for-linus-3.4-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 20 Apr 2012 18:31:00 +0000 (11:31 -0700)]
Merge tag 'stable/for-linus-3.4-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull xen fixes from Konrad Rzeszutek Wilk:
 - mechanism to work with misconfigured backends (where they are
   advertised but in reality don't exist).
 - two tiny compile warning fixes.
 - proper error handling in gnttab_resume
 - Not using VM_PFNMAP anymore to allow backends in the same domain.

* tag 'stable/for-linus-3.4-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"
  xen/resume: Fix compile warnings.
  xen/xenbus: Add quirk to deal with misconfigured backends.
  xen/blkback: Fix warning error.
  xen/p2m: m2p_find_override: use list_for_each_entry_safe
  xen/gntdev: do not set VM_PFNMAP
  xen/grant-table: add error-handling code on failure of gnttab_resume

12 years agoRevert "ACPI: ignore FADT reset-reg-sup flag"
Linus Torvalds [Fri, 20 Apr 2012 18:19:35 +0000 (11:19 -0700)]
Revert "ACPI: ignore FADT reset-reg-sup flag"

This reverts commit cf450136bfde77c7f95065c91bffded4aa7fa731.

It breaks reboot on at least one Thinkpad T43, as reported by Jörg Otte:
 "On reboot it shuts down as normal.
  The last lines displayed are:

  >Unmounting temporary filesystems.. [OK]
  >Deactivating swap...               [OK]
  >Unmounting local filesystems...    [OK]
  >Will now restart
  >    Restarting system

  Then I hear it accessing the cd-drive, but then it's being stuck."

Jörg bisected the regression to this commit.

That commit fixes another machine (see

  https://bugzilla.kernel.org/show_bug.cgi?id=11533

for details) that has a BIOS bug and doesn't support ACPI reset.
However, at least one of those other reporters no longer even has the
machine in question, and had a different workaround to begin with.
Besides, it clearly was a buggy BIOS.  Let's not break the correct case
to fix that case.

Reported-and-bisected-by: Jörg Otte <jrg.otte@googlemail.com>
Cc: linux-acpi@vger.kernel.org
Cc: Len Brown <lenb@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>