forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…
…ream-linus Pull MIPS updates from Ralf Baechle: "The lion share of this pull request are fixes for clk-related breakage caused by other changes during this merge window. For some platforms the fix was as simple as selecting HAVE_CLK, for others like the Loongson 2 significant restructuring was required. The remainder are changes required to get the Lantiq code to work again." * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Loongson 2: Sort out clock managment. MIPS: Loongson 1: more clk support and add select HAVE_CLK MIPS: txx9: Fix redefinition of clk_* by adding select HAVE_CLK MIPS: BCM63xx: Fix redefinition of clk_* by adding select HAVE_CLK MIPS: AR7: Fix redefinition of clk_* by adding select HAVE_CLK MIPS: Lantiq: Platform specific CLK fixup MIPS: Lantiq: Add device_tree_init function MIPS: Lantiq: Fix interface clock and PCI control register offset
- Loading branch information
Showing
14 changed files
with
108 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,17 @@ | |
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/clk.h> | ||
#include <linux/cpufreq.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/errno.h> | ||
#include <linux/export.h> | ||
#include <linux/init.h> | ||
#include <linux/list.h> | ||
#include <linux/mutex.h> | ||
#include <linux/spinlock.h> | ||
|
||
#include <asm/clock.h> | ||
|
||
#include <loongson.h> | ||
#include <asm/mach-loongson/loongson.h> | ||
|
||
static LIST_HEAD(clock_list); | ||
static DEFINE_SPINLOCK(clock_lock); | ||
|
@@ -88,12 +91,6 @@ void clk_put(struct clk *clk) | |
EXPORT_SYMBOL(clk_put); | ||
|
||
int clk_set_rate(struct clk *clk, unsigned long rate) | ||
{ | ||
return clk_set_rate_ex(clk, rate, 0); | ||
} | ||
EXPORT_SYMBOL_GPL(clk_set_rate); | ||
|
||
int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | ||
{ | ||
int ret = 0; | ||
int regval; | ||
|
@@ -103,7 +100,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | |
unsigned long flags; | ||
|
||
spin_lock_irqsave(&clock_lock, flags); | ||
ret = clk->ops->set_rate(clk, rate, algo_id); | ||
ret = clk->ops->set_rate(clk, rate, 0); | ||
spin_unlock_irqrestore(&clock_lock, flags); | ||
} | ||
|
||
|
@@ -129,7 +126,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | |
|
||
return ret; | ||
} | ||
EXPORT_SYMBOL_GPL(clk_set_rate_ex); | ||
EXPORT_SYMBOL_GPL(clk_set_rate); | ||
|
||
long clk_round_rate(struct clk *clk, unsigned long rate) | ||
{ | ||
|
@@ -146,26 +143,3 @@ long clk_round_rate(struct clk *clk, unsigned long rate) | |
return rate; | ||
} | ||
EXPORT_SYMBOL_GPL(clk_round_rate); | ||
|
||
/* | ||
* This is the simple version of Loongson-2 wait, Maybe we need do this in | ||
* interrupt disabled content | ||
*/ | ||
|
||
DEFINE_SPINLOCK(loongson2_wait_lock); | ||
void loongson2_cpu_wait(void) | ||
{ | ||
u32 cpu_freq; | ||
unsigned long flags; | ||
|
||
spin_lock_irqsave(&loongson2_wait_lock, flags); | ||
cpu_freq = LOONGSON_CHIPCFG0; | ||
LOONGSON_CHIPCFG0 &= ~0x7; /* Put CPU into wait mode */ | ||
LOONGSON_CHIPCFG0 = cpu_freq; /* Restore CPU state */ | ||
spin_unlock_irqrestore(&loongson2_wait_lock, flags); | ||
} | ||
EXPORT_SYMBOL_GPL(loongson2_cpu_wait); | ||
|
||
MODULE_AUTHOR("Yanhua <[email protected]>"); | ||
MODULE_DESCRIPTION("cpufreq driver for Loongson 2F"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters