aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/lib64
Commit message (Expand)AuthorAge
* sh64: Kill off special clear_page() implementation.Paul Mundt2009-08-04
* sh: Convert sh64 to use the generic checksum code.Paul Mundt2009-06-14
* sh: Provide an __sdivsi3_2 export for sh64.Paul Mundt2009-05-09
* sh: Move out cayman-specific panic handler code to its own file.Paul Mundt2009-05-08
* sh: Kill off unused sh64 debug code.Paul Mundt2009-05-08
* sh: Kill off sh64's hand-rolled syscall tracer.Paul Mundt2009-05-08
* sh: Provide sdivsi3/udivsi3/udivdi3 for sh64, kill off libgcc linking.Paul Mundt2008-12-22
* sh: Add SH-5 optimized memcpy()/memset()/strcpy()/strlen().Paul Mundt2008-12-22
* Fix incorrect use of loose in c-checksum.cNick Andrew2008-12-22
* sh: migrate to arch/sh/include/Paul Mundt2008-07-28
* sh64: Fix up compile warning in event tracer.Paul Mundt2008-05-08
* sh: Fix up the sh64 build.Paul Mundt2008-03-06
* sh: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-03-05
* sh: comment tidying for sh64->sh migration.Paul Mundt2008-01-27
* sh: clear/copy_page renames in lib and lib64.Paul Mundt2008-01-27
* sh: Tidy up various clear_page()/copy_page() definitions.Paul Mundt2008-01-27
* sh: Tidy up lib64 udelay impl.Paul Mundt2008-01-27
* sh: Fix up header reference for arch/sh/lib64/panic.c.Paul Mundt2008-01-27
* sh: Kill off lib64 version of iomap wrappers.Paul Mundt2008-01-27
* sh: Kill off lib64 version of io.c.Paul Mundt2008-01-27
* sh: Move arch/sh64/lib to arch/sh/lib64.Paul Mundt2008-01-27
nux/kernel.h> #include <linux/list.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/device.h> #include <linux/sysdev.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/mutex.h> #include <linux/clk.h> #include <linux/io.h> #include <mach/hardware.h> #include <asm/atomic.h> #include <asm/irq.h> #include <mach/regs-clock.h> #include <plat/clock.h> #include <plat/cpu.h> /* S3C2440 extended clock support */ static unsigned long s3c2440_camif_upll_round(struct clk *clk, unsigned long rate) { unsigned long parent_rate = clk_get_rate(clk->parent); int div; if (rate > parent_rate) return parent_rate; /* note, we remove the +/- 1 calculations for the divisor */ div = (parent_rate / rate) / 2; if (div < 1) div = 1; else if (div > 16) div = 16; return parent_rate / (div * 2); } static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate) { unsigned long parent_rate = clk_get_rate(clk->parent); unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); rate = s3c2440_camif_upll_round(clk, rate); camdivn &= ~(S3C2440_CAMDIVN_CAMCLK_SEL | S3C2440_CAMDIVN_CAMCLK_MASK); if (rate != parent_rate) { camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL; camdivn |= (((parent_rate / rate) / 2) - 1); } __raw_writel(camdivn, S3C2440_CAMDIVN); return 0; } /* Extra S3C2440 clocks */ static struct clk s3c2440_clk_cam = { .name = "camif", .id = -1, .enable = s3c2410_clkcon_enable, .ctrlbit = S3C2440_CLKCON_CAMERA, }; static struct clk s3c2440_clk_cam_upll = { .name = "camif-upll", .id = -1, .ops = &(struct clk_ops) { .set_rate = s3c2440_camif_upll_setrate, .round_rate = s3c2440_camif_upll_round, }, }; static struct clk s3c2440_clk_ac97 = { .name = "ac97", .id = -1, .enable = s3c2410_clkcon_enable, .ctrlbit = S3C2440_CLKCON_CAMERA, }; static int s3c2440_clk_add(struct sys_device *sysdev) { struct clk *clock_upll; struct clk *clock_h; struct clk *clock_p; clock_p = clk_get(NULL, "pclk"); clock_h = clk_get(NULL, "hclk"); clock_upll = clk_get(NULL, "upll"); if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) { printk(KERN_ERR "S3C2440: Failed to get parent clocks\n"); return -EINVAL; } s3c2440_clk_cam.parent = clock_h; s3c2440_clk_ac97.parent = clock_p; s3c2440_clk_cam_upll.parent = clock_upll; s3c24xx_register_clock(&s3c2440_clk_ac97); s3c24xx_register_clock(&s3c2440_clk_cam); s3c24xx_register_clock(&s3c2440_clk_cam_upll); clk_disable(&s3c2440_clk_ac97); clk_disable(&s3c2440_clk_cam); return 0; } static struct sysdev_driver s3c2440_clk_driver = { .add = s3c2440_clk_add, }; static __init int s3c24xx_clk_driver(void) { return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver); } arch_initcall(s3c24xx_clk_driver);