diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-12 18:26:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-12 18:26:48 -0500 |
commit | 26ceb127f7bcf473db926c6a026b18ddd6f274e8 (patch) | |
tree | a8944a9c0730c409b0cfb17c541085face068556 /drivers/video | |
parent | 8d14066755592a2906b4f2378aeb5471b602d3cb (diff) | |
parent | e9f2d6d66037cdf97487491e04053f411abc5d16 (diff) |
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King:
"The major updates included in this update are:
- Clang compatible stack pointer accesses by Behan Webster.
- SA11x0 updates from Dmitry Eremin-Solenikov.
- kgdb handling of breakpoints with read-only text/modules
- Support for Privileged-no-execute feature on ARMv7 to prevent
userspace code execution by the kernel.
- AMBA primecell bus handling of irq-safe runtime PM
- Unwinding support for memset/memzero/memmove/memcpy functions
- VFP fixes for Krait CPUs and improvements in detecting the VFP
architecture
- A number of code cleanups (using pr_*, removing or reducing the
severity of a couple of kernel messages, splitting ftrace asm code
out to a separate file, etc.)
- Add machine name to stack dump output"
* 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (62 commits)
ARM: 8247/2: pcmcia: sa1100: make use of device clock
ARM: 8246/2: pcmcia: sa1111: provide device clock
ARM: 8245/1: pcmcia: soc-common: enable/disable socket clocks
ARM: 8244/1: fbdev: sa1100fb: make use of device clock
ARM: 8243/1: sa1100: add a clock alias for sa1111 pcmcia device
ARM: 8242/1: sa1100: add cpu clock
ARM: 8221/1: PJ4: allow building in Thumb-2 mode
ARM: 8234/1: sa1100: reorder IRQ handling code
ARM: 8233/1: sa1100: switch to hwirq usage
ARM: 8232/1: sa1100: merge GPIO multiplexer IRQ to "normal" irq domain
ARM: 8231/1: sa1100: introduce irqdomains support
ARM: 8230/1: sa1100: shift IRQs by one
ARM: 8229/1: sa1100: replace irq numbers with names in irq driver
ARM: 8228/1: sa1100: drop entry-macro.S
ARM: 8227/1: sa1100: switch to MULTI_IRQ_HANDLER
ARM: 8241/1: Update processor_modes for hyp and monitor mode
ARM: 8240/1: MCPM: document mcpm_sync_init()
ARM: 8239/1: Introduce {set,clear}_pte_bit
ARM: 8238/1: mm: Refine set_memory_* functions
ARM: 8237/1: fix flush_pfn_alias
...
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/sa1100fb.c | 30 | ||||
-rw-r--r-- | drivers/video/fbdev/sa1100fb.h | 1 |
2 files changed, 24 insertions, 7 deletions
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 9690216d38ff..c0abe276ee55 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c | |||
@@ -178,6 +178,7 @@ | |||
178 | #include <linux/dma-mapping.h> | 178 | #include <linux/dma-mapping.h> |
179 | #include <linux/mutex.h> | 179 | #include <linux/mutex.h> |
180 | #include <linux/io.h> | 180 | #include <linux/io.h> |
181 | #include <linux/clk.h> | ||
181 | 182 | ||
182 | #include <video/sa1100fb.h> | 183 | #include <video/sa1100fb.h> |
183 | 184 | ||
@@ -416,9 +417,9 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
416 | var->transp.offset); | 417 | var->transp.offset); |
417 | 418 | ||
418 | #ifdef CONFIG_CPU_FREQ | 419 | #ifdef CONFIG_CPU_FREQ |
419 | dev_dbg(fbi->dev, "dma period = %d ps, clock = %d kHz\n", | 420 | dev_dbg(fbi->dev, "dma period = %d ps, clock = %ld kHz\n", |
420 | sa1100fb_display_dma_period(var), | 421 | sa1100fb_display_dma_period(var), |
421 | cpufreq_get(smp_processor_id())); | 422 | clk_get_rate(fbi->clk) / 1000); |
422 | #endif | 423 | #endif |
423 | 424 | ||
424 | return 0; | 425 | return 0; |
@@ -592,9 +593,10 @@ static struct fb_ops sa1100fb_ops = { | |||
592 | * Calculate the PCD value from the clock rate (in picoseconds). | 593 | * Calculate the PCD value from the clock rate (in picoseconds). |
593 | * We take account of the PPCR clock setting. | 594 | * We take account of the PPCR clock setting. |
594 | */ | 595 | */ |
595 | static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) | 596 | static inline unsigned int get_pcd(struct sa1100fb_info *fbi, |
597 | unsigned int pixclock) | ||
596 | { | 598 | { |
597 | unsigned int pcd = cpuclock / 100; | 599 | unsigned int pcd = clk_get_rate(fbi->clk) / 100 / 1000; |
598 | 600 | ||
599 | pcd *= pixclock; | 601 | pcd *= pixclock; |
600 | pcd /= 10000000; | 602 | pcd /= 10000000; |
@@ -673,7 +675,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ | |||
673 | LCCR2_BegFrmDel(var->upper_margin) + | 675 | LCCR2_BegFrmDel(var->upper_margin) + |
674 | LCCR2_EndFrmDel(var->lower_margin); | 676 | LCCR2_EndFrmDel(var->lower_margin); |
675 | 677 | ||
676 | pcd = get_pcd(var->pixclock, cpufreq_get(0)); | 678 | pcd = get_pcd(fbi, var->pixclock); |
677 | new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi->inf->lccr3 | | 679 | new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi->inf->lccr3 | |
678 | (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | | 680 | (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | |
679 | (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); | 681 | (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); |
@@ -787,6 +789,9 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi) | |||
787 | fbi->palette_cpu[0] &= 0xcfff; | 789 | fbi->palette_cpu[0] &= 0xcfff; |
788 | fbi->palette_cpu[0] |= palette_pbs(&fbi->fb.var); | 790 | fbi->palette_cpu[0] |= palette_pbs(&fbi->fb.var); |
789 | 791 | ||
792 | /* enable LCD controller clock */ | ||
793 | clk_prepare_enable(fbi->clk); | ||
794 | |||
790 | /* Sequence from 11.7.10 */ | 795 | /* Sequence from 11.7.10 */ |
791 | writel_relaxed(fbi->reg_lccr3, fbi->base + LCCR3); | 796 | writel_relaxed(fbi->reg_lccr3, fbi->base + LCCR3); |
792 | writel_relaxed(fbi->reg_lccr2, fbi->base + LCCR2); | 797 | writel_relaxed(fbi->reg_lccr2, fbi->base + LCCR2); |
@@ -831,6 +836,9 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi) | |||
831 | 836 | ||
832 | schedule_timeout(20 * HZ / 1000); | 837 | schedule_timeout(20 * HZ / 1000); |
833 | remove_wait_queue(&fbi->ctrlr_wait, &wait); | 838 | remove_wait_queue(&fbi->ctrlr_wait, &wait); |
839 | |||
840 | /* disable LCD controller clock */ | ||
841 | clk_disable_unprepare(fbi->clk); | ||
834 | } | 842 | } |
835 | 843 | ||
836 | /* | 844 | /* |
@@ -1009,7 +1017,6 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, | |||
1009 | void *data) | 1017 | void *data) |
1010 | { | 1018 | { |
1011 | struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); | 1019 | struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); |
1012 | struct cpufreq_freqs *f = data; | ||
1013 | u_int pcd; | 1020 | u_int pcd; |
1014 | 1021 | ||
1015 | switch (val) { | 1022 | switch (val) { |
@@ -1018,7 +1025,7 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, | |||
1018 | break; | 1025 | break; |
1019 | 1026 | ||
1020 | case CPUFREQ_POSTCHANGE: | 1027 | case CPUFREQ_POSTCHANGE: |
1021 | pcd = get_pcd(fbi->fb.var.pixclock, f->new); | 1028 | pcd = get_pcd(fbi, fbi->fb.var.pixclock); |
1022 | fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd); | 1029 | fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd); |
1023 | set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); | 1030 | set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); |
1024 | break; | 1031 | break; |
@@ -1225,6 +1232,13 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
1225 | if (!fbi) | 1232 | if (!fbi) |
1226 | goto failed; | 1233 | goto failed; |
1227 | 1234 | ||
1235 | fbi->clk = clk_get(&pdev->dev, NULL); | ||
1236 | if (IS_ERR(fbi->clk)) { | ||
1237 | ret = PTR_ERR(fbi->clk); | ||
1238 | fbi->clk = NULL; | ||
1239 | goto failed; | ||
1240 | } | ||
1241 | |||
1228 | fbi->base = ioremap(res->start, resource_size(res)); | 1242 | fbi->base = ioremap(res->start, resource_size(res)); |
1229 | if (!fbi->base) | 1243 | if (!fbi->base) |
1230 | goto failed; | 1244 | goto failed; |
@@ -1277,6 +1291,8 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
1277 | failed: | 1291 | failed: |
1278 | if (fbi) | 1292 | if (fbi) |
1279 | iounmap(fbi->base); | 1293 | iounmap(fbi->base); |
1294 | if (fbi->clk) | ||
1295 | clk_put(fbi->clk); | ||
1280 | kfree(fbi); | 1296 | kfree(fbi); |
1281 | release_mem_region(res->start, resource_size(res)); | 1297 | release_mem_region(res->start, resource_size(res)); |
1282 | return ret; | 1298 | return ret; |
diff --git a/drivers/video/fbdev/sa1100fb.h b/drivers/video/fbdev/sa1100fb.h index fc5d4292fad6..0139d13377a5 100644 --- a/drivers/video/fbdev/sa1100fb.h +++ b/drivers/video/fbdev/sa1100fb.h | |||
@@ -68,6 +68,7 @@ struct sa1100fb_info { | |||
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | const struct sa1100fb_mach_info *inf; | 70 | const struct sa1100fb_mach_info *inf; |
71 | struct clk *clk; | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) | 74 | #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) |