summaryrefslogtreecommitdiffstats
path: root/drivers/sh
AgeCommit message (Collapse)Author
2011-08-01Merge branch 'sh-latest' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x * 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: (39 commits) SH: static should be at beginning of declaration sh: move CLKDEV_xxx_ID macro to sh_clk.h sh: clock-shx3: add CLKDEV_ICK_ID for cleanup sh: clock-sh7786: add CLKDEV_ICK_ID for cleanup sh: clock-sh7785: add CLKDEV_ICK_ID for cleanup sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup sh: clock-sh7366: add CLKDEV_ICK_ID for cleanup sh: clock-sh7343: add CLKDEV_ICK_ID for cleanup sh: clock-sh7722: add CLKDEV_ICK_ID for cleanup sh: clock-sh7724: add CLKDEV_ICK_ID for cleanup sh: clock-sh7366: modify I2C clock settings sh: clock-sh7343: modify I2C clock settings sh: clock-sh7723: modify I2C clock settings sh: clock-sh7722: modify I2C clock settings sh: clock-sh7724: modify I2C clock settings serial: sh-sci: Fix up pretty name printing for port IRQs. serial: sh-sci: Kill off per-port enable/disable callbacks. serial: sh-sci: Add missing module description/author bits. serial: sh-sci: Regtype probing doesn't need to be fatal. sh: Tidy up pre-clkdev clk_get() error handling. ...
2011-07-20switch assorted clock drivers to debugfs_remove_recursive()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-06-24sh: clkfwk: Convert to IS_ERR_OR_NULL.Paul Mundt
Trivial cleanup. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-06-24drivers: sh: late disabling of clocks V2Magnus Damm
This V2 patch changes the clock disabling behavior during boot. Two different changes are made: 1) Delay disabling of clocks until late in the boot process. This fixes an existing issue where in-use clocks without software reference are disabled by mistake during boot. One example of this is the handling of the Mackerel serial console output that shares clock with the I2C controller. 2) Write out the "disabled" state to the hardware for clocks that not have been used by the kernel. In other words, make sure so far unused clocks actually get turned off. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-06-14drivers: sh: resume enabled clocks fixMagnus Damm
Extend the SH / SH-Mobile ARM clock framework to only resume clocks that have been enabled. Without this fix divide-by-zero is triggering on sh7372 FSIDIV during system wide resume of Suspend-to-RAM. Signed-off-by: Magnus Damm <damm@opensource.se> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-23Merge branch 'sh/genirq-threading' into sh-latestPaul Mundt
2011-04-27sh: intc: Set virtual IRQs as nothread.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-04-18sh: clkfwk: fixup clk_rate_table_build parameter in div6 clockKuninori Morimoto
div6 clock should not use arch_flags for clk_rate_table_build, because SH_CLK_DIV6_EXT doesn't care .arch_flags. clk->freq_table[] will be all CPUFREQ_ENTRY_INVALID without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: stable@kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-30sh: Fix irq cleanup falloutThomas Gleixner
I missed that coccinelle does not fix up header files by default. Reported-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Paul Mundt <lethal@linux-sh.org> Cc: <lethal@linux-sh.org>
2011-03-29sh: Convert to new function namesThomas Gleixner
Scripted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-29sh: Use the proper accessor functionsThomas Gleixner
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-23sh: Use struct syscore_ops instead of sysdevsRafael J. Wysocki
Convert the SuperH clocks framework and shared interrupt handling code to using struct syscore_ops instead of a sysdev classes and sysdevs for power managment. This reduces the code size significantly and simplifies it. The optimizations causing things not to be restored after creating a hibernation image are removed, but they might lead to undesirable effects during resume from hibernation (e.g. the clocks would be left as the boot kernel set them, which might be not the same way as the hibernated kernel had seen them before the hibernation). This also is necessary for removing sysdevs from the kernel entirely in the future. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-19sh: update INTC to clear IRQ sense valid flagMagnus Damm
Clear the valid flag is in the INTC code. Without this fix bit 7 of the sense register is mistakenly set. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-10headers: kobject.h reduxAlexey Dobriyan
Remove kobject.h from files which don't need it, notably, sched.h and fs.h. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-24sh: intc: Initialize radix tree gfp mask explicitly.Paul Mundt
Presently the root node is initialized by way of kzalloc on the parent data structure, which by chance happens to do the bulk of what an explicit initialization does with GFP_NOWAIT semantics. This however is more by luck than by design, and as we ideally want to permit radix node allocations access to the emergency pools anyways, add in the proper initializer with the desired mask. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-19Merge branch 'common/clkfwk' into sh-fixes-for-linusPaul Mundt
2010-11-19sh: clkfwk: Build fix for non-legacy CPG changes.Paul Mundt
The disabling of the init op for non-legacy clocks neglected to do the same in the core clock framework, resulting in a build failure. Fix it up. Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-16Merge branch 'common/clkfwk' into sh-fixes-for-linusPaul Mundt
2010-11-15sh: clkfwk: Kill off now unused algo_id in set_rate op.Paul Mundt
Now that clk_set_rate_ex() is gone, there is also no way to get at rate setting algo id, which is now also completely unused. Kill it off before new clock ops start using it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-15sh: clkfwk: Kill off unused clk_set_rate_ex().Paul Mundt
With the refactoring of the SH7722 clock framework some time ago this abstraction has become unecessary. Kill it off before anyone else gets the bright idea to start using it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-15sh: intc: Fix up build failure introduced by radix tree changes.Paul Mundt
The radix tree retry logic got a bit of an overhaul and subsequently broke the virtual IRQ subgroup build. Simply switch over to radix_tree_deref_retry() as per the filemap changes, which the virq lookup logic was modelled after in the first place. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10sh: clkfwk: fix up compiler warnings.Paul Mundt
CC drivers/sh/clk/core.o drivers/sh/clk/core.c: In function 'clk_round_parent': drivers/sh/clk/core.c:574: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' drivers/sh/clk/core.c:594: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-08Merge branches 'sh/pio-death', 'sh/nommu', 'sh/clkfwk', 'sh/core' and ↵Paul Mundt
'sh/intc-extension' into sh-fixes-for-linus
2010-11-08sh: clkfwk: Fix up checkpatch warnings.Paul Mundt
The clk_round_parent() change introduced various checkpatch warnings, tidy them up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-08sh: add clk_round_parent() to optimize parent clock rateGuennadi Liakhovetski
Sometimes it is possible and reasonable to adjust the parent clock rate to improve precision of the child clock, e.g., if the child clock has no siblings. clk_round_parent() is a new addition to the SH clock-framework API, that implements such an optimization for child clocks with divisors, taking all integer values in a range. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-01sh: intc: Update for single IRQ reservation helper.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-01sh: clkfwk: Fix up rate rounding error handling.Paul Mundt
According to the linux/clk.h definition we should be handing back an errno value or a valid rate. This fixes up the case where 0 can be returned for invalid frequencies or cases where rounding has no selectable candidate. Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-28sh: intc: switch irq_desc iteration to new active IRQ iterator.Paul Mundt
There's no need to iterative over every single irq_desc when we can already work out which IRQs have a backing descriptor via the shiny new for_each_active_irq(). Switch to that instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-27sh: intc: irq_data conversion.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-27sh: maple: ctrl_in/outX to __raw_read/writeX conversion.Paul Mundt
The ctrl_xxx routines are deprecated, switch over to the __raw_xxx versions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-26sh: Switch dynamic IRQ creation to generic irq allocator.Paul Mundt
Now that the genirq code provides an IRQ bitmap of its own and the necessary API to manipulate it, there's no need to keep our own version around anymore. In the process we kill off some unused IRQ reservation code, with future users now having to tie in to the genirq API as normal. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-26sh: Sanitize sparse irqThomas Gleixner
Switch over to the new allocator functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-18sh: clkfwk: Shuffle around to match the intc split up.Paul Mundt
This shuffles the clock framework code around to a drivers/sh/clk subdir, to follow the intc split up. This will make it easier to subsequently break things out as well as plug in different helpers for non-CPG users. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-18sh: clkfwk: modify for_each_frequency end conditionKuninori Morimoto
The end condition of for_each_frequency should care about both clk_rate_table_round and clk_rate_div_range_round, and using "correct max size" is a natural idea in later function. To avoid data over flow, this patch didn't modify clk_rate_div_range_round side as .max = div_max + 1. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-16sh: clkfwk: Fix fault in frequency iterator.Paul Mundt
When updating the iterator macro an old argument assignment was used on the initial assignment causing a fault on the table rounding. Fix it up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15sh: clkfwk: Add a helper for rate rounding by divisor ranges.Paul Mundt
This adds a new clk_rate_div_range_round() for implementing rate rounding by divisor ranges. This can be used trivially by clocks that support arbitrary ranged divisors without the need for rate table construction. This should only be used by clocks that both have large divisor ranges in addition to clocks that will never be arbitrarily scaled, as the lack of a backing frequency table will prevent cpufreq from being able to do much of anything with them. Primarily intended for use as a ->recalc helper. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15sh: clkfwk: Abstract rate rounding helper.Paul Mundt
Presently the only assisted rate rounding is frequency table backed, but there are cases where it's impractical to use a frequency table for certain clocks (such as the FSIDIV case, which supports 65535 divisors), and we wish to reuse the same rate rounding algorithm. This breaks out the core of the rate rounding logic in to its own helper routine and shuffles the frequency table logic around, switching to using an iterator for the generic helper routine. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15sh: clkfwk: support clock remapping.Paul Mundt
This implements support for ioremapping of register windows that encapsulate clock control registers used by a struct clk, with transparent sibling inheritance. Root clocks at the top of a given topology often encapsulate the entire register space of all of their sibling clocks, so this mapping can be done once and handed down. A given clock enable/disable case maps out to a single bit in a shared register, so this prevents creating multiple overlapping mappings. The mapping case breaks down in to a couple of different situations: - Sibling clocks without a specific mapping. - Root clocks without a specific mapping. - Any of sibling/root clocks with a specific mapping. Sibling clocks with no specified mapping will grovel up the clock chain and install the root clock mapping unconditionally at registration time. Root clocks without their own mappings have a dummy BSS-initialized mapping inserted that is handed down the chain just like any other mapping. This permits all of the sibling clock ops to read/write using the mapping offsets without any special configuration, enabling them to not care whether access ultimately goes through translatable or untranslatable memory. Any clock with its own mapping will have the window initialized at registration time and be ready for use by its clock ops. Failure to establish the mapping will prevent registration, so no additional sanity checks are needed. Sibling clocks that double as parents for the moment will not propagate their mapping down, but this is easily tunable if the need arises. All clock mappings are kref refcounted, with each instance of mapping inheritance incrementing the refcount. Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-13sh: use pr_fmt for clock framework, too.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-13sh: remove name and id from struct clkMagnus Damm
Remove "name" and "id" from drivers/sh/ struct clk. The struct clk members "name" and "id" are not used now when matching is done through clkdev. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-06sh: intc: Fix build with IRQ balancing disabled.Paul Mundt
The balancing stubs obviously need to be static inline.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-06sh: intc: Add missing files.Paul Mundt
The Kconfig and Makefile were overlooked, add those in now to improve odds of building. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-05sh: intc: Split up the INTC code.Paul Mundt
This splits up the sh intc core in to something more vaguely resembling a subsystem. Most of the functionality was alread fairly well compartmentalized, and there were only a handful of interdependencies that needed to be resolved in the process. This also serves as future-proofing for the genirq and sparseirq rework, which will make some of the split out functionality wholly generic, allowing things to be killed off in place with minimal migration pain. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-05sh: intc: Handle early lookups of subgroup IRQs.Paul Mundt
If lookups happen while the radix node still points to a subgroup mapping, an IRQ hasn't yet been made available for the specified id, so error out accordingly. Once the slot is replaced with an IRQ mapping and the tag is discarded, lookup can commence as normal. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-05sh: intc: Support virtual mappings for IRQ subgroups.Paul Mundt
Many interrupts that share a single mask source but are on different hardware vectors will have an associated register tied to an INTEVT that denotes the precise cause for the interrupt exception being triggered. This introduces the concept of IRQ subgroups in the intc core, where a virtual IRQ map is constructed for each of the pre-defined cause bits, and a higher level chained handler takes control of the parent INTEVT. This enables CPUs with heavily muxed IRQ vectors (especially across disjoint blocks) to break things out in to a series of managed chained handlers while being able to dynamically lookup and adopt the IRQs created for them. This is largely an opt-in interface, requiring CPUs to manually submit IRQs for subgroup splitting, in addition to providing identifiers in their enum maps that can be used for lazy lookup via the radix tree. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-05sh: intc: Implement reverse mapping for IRQs to per-controller IDs.Paul Mundt
This implements a scheme roughly analogous to the PowerPC virtual to hardware IRQ mapping, which we use for IRQ to per-controller ID mapping. This makes it possible for drivers to use the IDs directly for lookup instead of hardcoding the vector. The main motivation for this work is as a building block for dynamically allocating virtual IRQs for demuxing INTC events sharing a single INTEVT in addition to a common masking source. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-04sh: pfc: Fix up BUG() triggered by gpiolib debugfs lookups.Paul Mundt
The gpiolib debugfs entry takes a hammer approach and iterates over all of the potential GPIOs, regardless of their type. The SH PFC code on the other hand contains a variable mismash of input/output/function types spread out sparsely, leading to situations where the debug code can trigger an out of range enum for the type. Since we already have an error path for out of range enums, we can just hand that up to the higher level instead of the current BUG() behaviour. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-04sh: pfc: support pinmux deregistration.Paul Mundt
Presently the pinmux code is a one-way thing, but there's nothing preventing an unregistration if no one has grabbed any of the pins. This will permit us to save a bit of memory on systems that require pin demux for certain peripherals in the case where registration of those peripherals fails, or they are otherwise not attached to the system. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-02sh: Support early IRQ vector map reservation for delayed controllers.Paul Mundt
Some controllers will need to be initialized lazily due to pinmux constraints, while others may simply have no need to be brought online if there are no backing devices for them attached. In this case it's still necessary to be able to reserve their hardware vector map before dynamic IRQs get a hold of them. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-02sh: Support IRQ balancing for SH-X3 proto cores, too.Paul Mundt
This adds in hardware IRQ auto-distribution support for SH-X3 proto CPUs, following the SH7786 support. Signed-off-by: Paul Mundt <lethal@linux-sh.org>