diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-01-26 20:48:39 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2011-01-26 20:48:39 +0000 |
commit | f38367fcb4fe2102c45f21101aac986efa7736c7 (patch) | |
tree | f2dd06831148032a42481d533acdcf594a2fd98a /target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c | |
parent | b0ffa7024830f9aba9e0f71708d596b6a4b43d08 (diff) | |
download | mtk-20170518-f38367fcb4fe2102c45f21101aac986efa7736c7.zip mtk-20170518-f38367fcb4fe2102c45f21101aac986efa7736c7.tar.gz mtk-20170518-f38367fcb4fe2102c45f21101aac986efa7736c7.tar.bz2 |
ramips: implement clock API for RT288x
SVN-Revision: 25125
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c')
-rw-r--r-- | target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c index 3b575f6..6a5cf39 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/devices.c @@ -1,7 +1,7 @@ /* * Ralink RT288x SoC platform device registration * - * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org> + * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org> * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> * * This program is free software; you can redistribute it and/or modify it @@ -14,6 +14,8 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/physmap.h> #include <linux/etherdevice.h> +#include <linux/err.h> +#include <linux/clk.h> #include <asm/addrspace.h> @@ -154,7 +156,13 @@ static struct platform_device rt288x_eth_device = { void __init rt288x_register_ethernet(void) { - rt288x_eth_data.sys_freq = rt288x_sys_freq; + struct clk *clk; + + clk = clk_get(NULL, "sys"); + if (IS_ERR(clk)) + panic("unable to get SYS clock, err=%ld", PTR_ERR(clk)); + + rt288x_eth_data.sys_freq = clk_get_rate(clk); rt288x_eth_data.reset_fe = rt288x_fe_reset; rt288x_eth_data.min_pkt_len = 64; |