aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-12 18:26:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-12 18:26:48 -0500
commit26ceb127f7bcf473db926c6a026b18ddd6f274e8 (patch)
treea8944a9c0730c409b0cfb17c541085face068556 /drivers/pcmcia
parent8d14066755592a2906b4f2378aeb5471b602d3cb (diff)
parente9f2d6d66037cdf97487491e04053f411abc5d16 (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/pcmcia')
-rw-r--r--drivers/pcmcia/sa1100_generic.c1
-rw-r--r--drivers/pcmcia/sa1111_generic.c7
-rw-r--r--drivers/pcmcia/sa11xx_base.c14
-rw-r--r--drivers/pcmcia/soc_common.c4
4 files changed, 24 insertions, 2 deletions
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index ff8a027a4afb..d2ab06048169 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -93,6 +93,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
93 for (i = 0; i < sinfo->nskt; i++) 93 for (i = 0; i < sinfo->nskt; i++)
94 soc_pcmcia_remove_one(&sinfo->skt[i]); 94 soc_pcmcia_remove_one(&sinfo->skt[i]);
95 95
96 clk_put(sinfo->clk);
96 kfree(sinfo); 97 kfree(sinfo);
97 return 0; 98 return 0;
98} 99}
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 65b02c3e14ce..7bae7e549d8b 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -145,6 +145,12 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
145 return -ENOMEM; 145 return -ENOMEM;
146 146
147 s->soc.nr = ops->first + i; 147 s->soc.nr = ops->first + i;
148 s->soc.clk = clk_get(&dev->dev, NULL);
149 if (IS_ERR(s->soc.clk)) {
150 ret = PTR_ERR(s->soc.clk);
151 kfree(s);
152 return ret;
153 }
148 soc_pcmcia_init_one(&s->soc, ops, &dev->dev); 154 soc_pcmcia_init_one(&s->soc, ops, &dev->dev);
149 s->dev = dev; 155 s->dev = dev;
150 if (s->soc.nr) { 156 if (s->soc.nr) {
@@ -220,6 +226,7 @@ static int pcmcia_remove(struct sa1111_dev *dev)
220 for (; s; s = next) { 226 for (; s; s = next) {
221 next = s->next; 227 next = s->next;
222 soc_pcmcia_remove_one(&s->soc); 228 soc_pcmcia_remove_one(&s->soc);
229 clk_put(s->soc.clk);
223 kfree(s); 230 kfree(s);
224 } 231 }
225 232
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index 54d3089d157b..cf6de2c2b329 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -135,14 +135,16 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
135static int 135static int
136sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) 136sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
137{ 137{
138 return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); 138 unsigned long clk = clk_get_rate(skt->clk);
139
140 return sa1100_pcmcia_set_mecr(skt, clk / 1000);
139} 141}
140 142
141static int 143static int
142sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) 144sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf)
143{ 145{
144 struct soc_pcmcia_timing timing; 146 struct soc_pcmcia_timing timing;
145 unsigned int clock = cpufreq_get(0); 147 unsigned int clock = clk_get_rate(skt->clk);
146 unsigned long mecr = MECR; 148 unsigned long mecr = MECR;
147 char *p = buf; 149 char *p = buf;
148 150
@@ -218,6 +220,11 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
218 struct skt_dev_info *sinfo; 220 struct skt_dev_info *sinfo;
219 struct soc_pcmcia_socket *skt; 221 struct soc_pcmcia_socket *skt;
220 int i, ret = 0; 222 int i, ret = 0;
223 struct clk *clk;
224
225 clk = clk_get(dev, NULL);
226 if (IS_ERR(clk))
227 return PTR_ERR(clk);
221 228
222 sa11xx_drv_pcmcia_ops(ops); 229 sa11xx_drv_pcmcia_ops(ops);
223 230
@@ -226,12 +233,14 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
226 return -ENOMEM; 233 return -ENOMEM;
227 234
228 sinfo->nskt = nr; 235 sinfo->nskt = nr;
236 sinfo->clk = clk;
229 237
230 /* Initialize processor specific parameters */ 238 /* Initialize processor specific parameters */
231 for (i = 0; i < nr; i++) { 239 for (i = 0; i < nr; i++) {
232 skt = &sinfo->skt[i]; 240 skt = &sinfo->skt[i];
233 241
234 skt->nr = first + i; 242 skt->nr = first + i;
243 skt->clk = clk;
235 soc_pcmcia_init_one(skt, ops, dev); 244 soc_pcmcia_init_one(skt, ops, dev);
236 245
237 ret = sa11xx_drv_pcmcia_add_one(skt); 246 ret = sa11xx_drv_pcmcia_add_one(skt);
@@ -242,6 +251,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
242 if (ret) { 251 if (ret) {
243 while (--i >= 0) 252 while (--i >= 0)
244 soc_pcmcia_remove_one(&sinfo->skt[i]); 253 soc_pcmcia_remove_one(&sinfo->skt[i]);
254 clk_put(clk);
245 kfree(sinfo); 255 kfree(sinfo);
246 } else { 256 } else {
247 dev_set_drvdata(dev, sinfo); 257 dev_set_drvdata(dev, sinfo);
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index a2bc6ee1702e..933f4657515b 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -120,6 +120,8 @@ static void __soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt,
120 120
121 if (skt->ops->hw_shutdown) 121 if (skt->ops->hw_shutdown)
122 skt->ops->hw_shutdown(skt); 122 skt->ops->hw_shutdown(skt);
123
124 clk_disable_unprepare(skt->clk);
123} 125}
124 126
125static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 127static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
@@ -131,6 +133,8 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
131{ 133{
132 int ret = 0, i; 134 int ret = 0, i;
133 135
136 clk_prepare_enable(skt->clk);
137
134 if (skt->ops->hw_init) { 138 if (skt->ops->hw_init) {
135 ret = skt->ops->hw_init(skt); 139 ret = skt->ops->hw_init(skt);
136 if (ret) 140 if (ret)