aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/dmabounce.c22
-rw-r--r--arch/arm/common/locomo.c2
-rw-r--r--arch/arm/common/rtctime.c434
-rw-r--r--arch/arm/common/sa1111.c12
-rw-r--r--arch/arm/common/scoop.c2
-rw-r--r--arch/arm/common/sharpsl_pm.c3
7 files changed, 20 insertions, 456 deletions
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index 3d0b9fa42f84..325e4b6a6afb 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -2,7 +2,6 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y += rtctime.o
6obj-$(CONFIG_ARM_GIC) += gic.o 5obj-$(CONFIG_ARM_GIC) += gic.o
7obj-$(CONFIG_ARM_VIC) += vic.o 6obj-$(CONFIG_ARM_VIC) += vic.o
8obj-$(CONFIG_ICST525) += icst525.o 7obj-$(CONFIG_ICST525) += icst525.o
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 2744673314b4..dd2947342604 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
554 554
555 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC); 555 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
556 if (!device_info) { 556 if (!device_info) {
557 printk(KERN_ERR 557 dev_err(dev,
558 "Could not allocated dmabounce_device_info for %s", 558 "Could not allocated dmabounce_device_info\n");
559 dev->bus_id);
560 return -ENOMEM; 559 return -ENOMEM;
561 } 560 }
562 561
@@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
594 593
595 dev->archdata.dmabounce = device_info; 594 dev->archdata.dmabounce = device_info;
596 595
597 printk(KERN_INFO "dmabounce: registered device %s on %s bus\n", 596 dev_info(dev, "dmabounce: registered device\n");
598 dev->bus_id, dev->bus->name);
599 597
600 return 0; 598 return 0;
601 599
@@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev)
614 dev->archdata.dmabounce = NULL; 612 dev->archdata.dmabounce = NULL;
615 613
616 if (!device_info) { 614 if (!device_info) {
617 printk(KERN_WARNING 615 dev_warn(dev,
618 "%s: Never registered with dmabounce but attempting" \ 616 "Never registered with dmabounce but attempting"
619 "to unregister!\n", dev->bus_id); 617 "to unregister!\n");
620 return; 618 return;
621 } 619 }
622 620
623 if (!list_empty(&device_info->safe_buffers)) { 621 if (!list_empty(&device_info->safe_buffers)) {
624 printk(KERN_ERR 622 dev_err(dev,
625 "%s: Removing from dmabounce with pending buffers!\n", 623 "Removing from dmabounce with pending buffers!\n");
626 dev->bus_id);
627 BUG(); 624 BUG();
628 } 625 }
629 626
@@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev)
639 636
640 kfree(device_info); 637 kfree(device_info);
641 638
642 printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n", 639 dev_info(dev, "dmabounce: device unregistered\n");
643 dev->bus_id, dev->bus->name);
644} 640}
645 641
646 642
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index d973c986f721..c3c3a3339049 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -543,7 +543,6 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
543 goto out; 543 goto out;
544 } 544 }
545 545
546 strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
547 /* 546 /*
548 * If the parent device has a DMA mask associated with it, 547 * If the parent device has a DMA mask associated with it,
549 * propagate it down to the children. 548 * propagate it down to the children.
@@ -553,6 +552,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
553 dev->dev.dma_mask = &dev->dma_mask; 552 dev->dev.dma_mask = &dev->dma_mask;
554 } 553 }
555 554
555 dev_set_name(&dev->dev, "%s", info->name);
556 dev->devid = info->devid; 556 dev->devid = info->devid;
557 dev->dev.parent = lchip->dev; 557 dev->dev.parent = lchip->dev;
558 dev->dev.bus = &locomo_bus_type; 558 dev->dev.bus = &locomo_bus_type;
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
deleted file mode 100644
index aa8f7739c822..000000000000
--- a/arch/arm/common/rtctime.c
+++ /dev/null
@@ -1,434 +0,0 @@
1/*
2 * linux/arch/arm/common/rtctime.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd.
5 * Based on sa1100-rtc.c, Nils Faerber, CIH, Nicolas Pitre.
6 * Based on rtc.c by Paul Gortmaker
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/time.h>
15#include <linux/rtc.h>
16#include <linux/poll.h>
17#include <linux/proc_fs.h>
18#include <linux/miscdevice.h>
19#include <linux/spinlock.h>
20#include <linux/capability.h>
21#include <linux/device.h>
22#include <linux/mutex.h>
23
24#include <asm/rtc.h>
25
26static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
27static struct fasync_struct *rtc_async_queue;
28
29/*
30 * rtc_lock protects rtc_irq_data
31 */
32static DEFINE_SPINLOCK(rtc_lock);
33static unsigned long rtc_irq_data;
34
35/*
36 * rtc_sem protects rtc_inuse and rtc_ops
37 */
38static DEFINE_MUTEX(rtc_mutex);
39static unsigned long rtc_inuse;
40static struct rtc_ops *rtc_ops;
41
42#define rtc_epoch 1900UL
43
44/*
45 * Calculate the next alarm time given the requested alarm time mask
46 * and the current time.
47 */
48void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm)
49{
50 unsigned long next_time;
51 unsigned long now_time;
52
53 next->tm_year = now->tm_year;
54 next->tm_mon = now->tm_mon;
55 next->tm_mday = now->tm_mday;
56 next->tm_hour = alrm->tm_hour;
57 next->tm_min = alrm->tm_min;
58 next->tm_sec = alrm->tm_sec;
59
60 rtc_tm_to_time(now, &now_time);
61 rtc_tm_to_time(next, &next_time);
62
63 if (next_time < now_time) {
64 /* Advance one day */
65 next_time += 60 * 60 * 24;
66 rtc_time_to_tm(next_time, next);
67 }
68}
69EXPORT_SYMBOL(rtc_next_alarm_time);
70
71static inline int rtc_arm_read_time(struct rtc_ops *ops, struct rtc_time *tm)
72{
73 memset(tm, 0, sizeof(struct rtc_time));
74 return ops->read_time(tm);
75}
76
77static inline int rtc_arm_set_time(struct rtc_ops *ops, struct rtc_time *tm)
78{
79 int ret;
80
81 ret = rtc_valid_tm(tm);
82 if (ret == 0)
83 ret = ops->set_time(tm);
84
85 return ret;
86}
87
88static inline int rtc_arm_read_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
89{
90 int ret = -EINVAL;
91 if (ops->read_alarm) {
92 memset(alrm, 0, sizeof(struct rtc_wkalrm));
93 ret = ops->read_alarm(alrm);
94 }
95 return ret;
96}
97
98static inline int rtc_arm_set_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
99{
100 int ret = -EINVAL;
101 if (ops->set_alarm)
102 ret = ops->set_alarm(alrm);
103 return ret;
104}
105
106void rtc_update(unsigned long num, unsigned long events)
107{
108 spin_lock(&rtc_lock);
109 rtc_irq_data = (rtc_irq_data + (num << 8)) | events;
110 spin_unlock(&rtc_lock);
111
112 wake_up_interruptible(&rtc_wait);
113 kill_fasync(&rtc_async_queue, SIGIO, POLL_IN);
114}
115EXPORT_SYMBOL(rtc_update);
116
117
118static ssize_t
119rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
120{
121 DECLARE_WAITQUEUE(wait, current);
122 unsigned long data;
123 ssize_t ret;
124
125 if (count < sizeof(unsigned long))
126 return -EINVAL;
127
128 add_wait_queue(&rtc_wait, &wait);
129 do {
130 __set_current_state(TASK_INTERRUPTIBLE);
131
132 spin_lock_irq(&rtc_lock);
133 data = rtc_irq_data;
134 rtc_irq_data = 0;
135 spin_unlock_irq(&rtc_lock);
136
137 if (data != 0) {
138 ret = 0;
139 break;
140 }
141 if (file->f_flags & O_NONBLOCK) {
142 ret = -EAGAIN;
143 break;
144 }
145 if (signal_pending(current)) {
146 ret = -ERESTARTSYS;
147 break;
148 }
149 schedule();
150 } while (1);
151 set_current_state(TASK_RUNNING);
152 remove_wait_queue(&rtc_wait, &wait);
153
154 if (ret == 0) {
155 ret = put_user(data, (unsigned long __user *)buf);
156 if (ret == 0)
157 ret = sizeof(unsigned long);
158 }
159 return ret;
160}
161
162static unsigned int rtc_poll(struct file *file, poll_table *wait)
163{
164 unsigned long data;
165
166 poll_wait(file, &rtc_wait, wait);
167
168 spin_lock_irq(&rtc_lock);
169 data = rtc_irq_data;
170 spin_unlock_irq(&rtc_lock);
171
172 return data != 0 ? POLLIN | POLLRDNORM : 0;
173}
174
175static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
176 unsigned long arg)
177{
178 struct rtc_ops *ops = file->private_data;
179 struct rtc_time tm;
180 struct rtc_wkalrm alrm;
181 void __user *uarg = (void __user *)arg;
182 int ret = -EINVAL;
183
184 switch (cmd) {
185 case RTC_ALM_READ:
186 ret = rtc_arm_read_alarm(ops, &alrm);
187 if (ret)
188 break;
189 ret = copy_to_user(uarg, &alrm.time, sizeof(tm));
190 if (ret)
191 ret = -EFAULT;
192 break;
193
194 case RTC_ALM_SET:
195 ret = copy_from_user(&alrm.time, uarg, sizeof(tm));
196 if (ret) {
197 ret = -EFAULT;
198 break;
199 }
200 alrm.enabled = 0;
201 alrm.pending = 0;
202 alrm.time.tm_mday = -1;
203 alrm.time.tm_mon = -1;
204 alrm.time.tm_year = -1;
205 alrm.time.tm_wday = -1;
206 alrm.time.tm_yday = -1;
207 alrm.time.tm_isdst = -1;
208 ret = rtc_arm_set_alarm(ops, &alrm);
209 break;
210
211 case RTC_RD_TIME:
212 ret = rtc_arm_read_time(ops, &tm);
213 if (ret)
214 break;
215 ret = copy_to_user(uarg, &tm, sizeof(tm));
216 if (ret)
217 ret = -EFAULT;
218 break;
219
220 case RTC_SET_TIME:
221 if (!capable(CAP_SYS_TIME)) {
222 ret = -EACCES;
223 break;
224 }
225 ret = copy_from_user(&tm, uarg, sizeof(tm));
226 if (ret) {
227 ret = -EFAULT;
228 break;
229 }
230 ret = rtc_arm_set_time(ops, &tm);
231 break;
232
233 case RTC_EPOCH_SET:
234#ifndef rtc_epoch
235 /*
236 * There were no RTC clocks before 1900.
237 */
238 if (arg < 1900) {
239 ret = -EINVAL;
240 break;
241 }
242 if (!capable(CAP_SYS_TIME)) {
243 ret = -EACCES;
244 break;
245 }
246 rtc_epoch = arg;
247 ret = 0;
248#endif
249 break;
250
251 case RTC_EPOCH_READ:
252 ret = put_user(rtc_epoch, (unsigned long __user *)uarg);
253 break;
254
255 case RTC_WKALM_SET:
256 ret = copy_from_user(&alrm, uarg, sizeof(alrm));
257 if (ret) {
258 ret = -EFAULT;
259 break;
260 }
261 ret = rtc_arm_set_alarm(ops, &alrm);
262 break;
263
264 case RTC_WKALM_RD:
265 ret = rtc_arm_read_alarm(ops, &alrm);
266 if (ret)
267 break;
268 ret = copy_to_user(uarg, &alrm, sizeof(alrm));
269 if (ret)
270 ret = -EFAULT;
271 break;
272
273 default:
274 if (ops->ioctl)
275 ret = ops->ioctl(cmd, arg);
276 break;
277 }
278 return ret;
279}
280
281static int rtc_open(struct inode *inode, struct file *file)
282{
283 int ret;
284
285 mutex_lock(&rtc_mutex);
286
287 if (rtc_inuse) {
288 ret = -EBUSY;
289 } else if (!rtc_ops || !try_module_get(rtc_ops->owner)) {
290 ret = -ENODEV;
291 } else {
292 file->private_data = rtc_ops;
293
294 ret = rtc_ops->open ? rtc_ops->open() : 0;
295 if (ret == 0) {
296 spin_lock_irq(&rtc_lock);
297 rtc_irq_data = 0;
298 spin_unlock_irq(&rtc_lock);
299
300 rtc_inuse = 1;
301 }
302 }
303 mutex_unlock(&rtc_mutex);
304
305 return ret;
306}
307
308static int rtc_release(struct inode *inode, struct file *file)
309{
310 struct rtc_ops *ops = file->private_data;
311
312 if (ops->release)
313 ops->release();
314
315 spin_lock_irq(&rtc_lock);
316 rtc_irq_data = 0;
317 spin_unlock_irq(&rtc_lock);
318
319 module_put(rtc_ops->owner);
320 rtc_inuse = 0;
321
322 return 0;
323}
324
325static int rtc_fasync(int fd, struct file *file, int on)
326{
327 return fasync_helper(fd, file, on, &rtc_async_queue);
328}
329
330static const struct file_operations rtc_fops = {
331 .owner = THIS_MODULE,
332 .llseek = no_llseek,
333 .read = rtc_read,
334 .poll = rtc_poll,
335 .ioctl = rtc_ioctl,
336 .open = rtc_open,
337 .release = rtc_release,
338 .fasync = rtc_fasync,
339};
340
341static struct miscdevice rtc_miscdev = {
342 .minor = RTC_MINOR,
343 .name = "rtc",
344 .fops = &rtc_fops,
345};
346
347
348static int rtc_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data)
349{
350 struct rtc_ops *ops = data;
351 struct rtc_wkalrm alrm;
352 struct rtc_time tm;
353 char *p = page;
354
355 if (rtc_arm_read_time(ops, &tm) == 0) {
356 p += sprintf(p,
357 "rtc_time\t: %02d:%02d:%02d\n"
358 "rtc_date\t: %04d-%02d-%02d\n"
359 "rtc_epoch\t: %04lu\n",
360 tm.tm_hour, tm.tm_min, tm.tm_sec,
361 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
362 rtc_epoch);
363 }
364
365 if (rtc_arm_read_alarm(ops, &alrm) == 0) {
366 p += sprintf(p, "alrm_time\t: ");
367 if ((unsigned int)alrm.time.tm_hour <= 24)
368 p += sprintf(p, "%02d:", alrm.time.tm_hour);
369 else
370 p += sprintf(p, "**:");
371 if ((unsigned int)alrm.time.tm_min <= 59)
372 p += sprintf(p, "%02d:", alrm.time.tm_min);
373 else
374 p += sprintf(p, "**:");
375 if ((unsigned int)alrm.time.tm_sec <= 59)
376 p += sprintf(p, "%02d\n", alrm.time.tm_sec);
377 else
378 p += sprintf(p, "**\n");
379
380 p += sprintf(p, "alrm_date\t: ");
381 if ((unsigned int)alrm.time.tm_year <= 200)
382 p += sprintf(p, "%04d-", alrm.time.tm_year + 1900);
383 else
384 p += sprintf(p, "****-");
385 if ((unsigned int)alrm.time.tm_mon <= 11)
386 p += sprintf(p, "%02d-", alrm.time.tm_mon + 1);
387 else
388 p += sprintf(p, "**-");
389 if ((unsigned int)alrm.time.tm_mday <= 31)
390 p += sprintf(p, "%02d\n", alrm.time.tm_mday);
391 else
392 p += sprintf(p, "**\n");
393 p += sprintf(p, "alrm_wakeup\t: %s\n",
394 alrm.enabled ? "yes" : "no");
395 p += sprintf(p, "alrm_pending\t: %s\n",
396 alrm.pending ? "yes" : "no");
397 }
398
399 if (ops->proc)
400 p += ops->proc(p);
401
402 return p - page;
403}
404
405int register_rtc(struct rtc_ops *ops)
406{
407 int ret = -EBUSY;
408
409 mutex_lock(&rtc_mutex);
410 if (rtc_ops == NULL) {
411 rtc_ops = ops;
412
413 ret = misc_register(&rtc_miscdev);
414 if (ret == 0)
415 create_proc_read_entry("driver/rtc", 0, NULL,
416 rtc_read_proc, ops);
417 }
418 mutex_unlock(&rtc_mutex);
419
420 return ret;
421}
422EXPORT_SYMBOL(register_rtc);
423
424void unregister_rtc(struct rtc_ops *rtc)
425{
426 mutex_lock(&rtc_mutex);
427 if (rtc == rtc_ops) {
428 remove_proc_entry("driver/rtc", NULL);
429 misc_deregister(&rtc_miscdev);
430 rtc_ops = NULL;
431 }
432 mutex_unlock(&rtc_mutex);
433}
434EXPORT_SYMBOL(unregister_rtc);
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index eb06d0b2cb74..0a8e1ff2af8a 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -550,9 +550,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
550 goto out; 550 goto out;
551 } 551 }
552 552
553 snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), 553 dev_set_name(&dev->dev, "%4.4lx", info->offset);
554 "%4.4lx", info->offset);
555
556 dev->devid = info->devid; 554 dev->devid = info->devid;
557 dev->dev.parent = sachip->dev; 555 dev->dev.parent = sachip->dev;
558 dev->dev.bus = &sa1111_bus_type; 556 dev->dev.bus = &sa1111_bus_type;
@@ -560,7 +558,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
560 dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask; 558 dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
561 dev->res.start = sachip->phys + info->offset; 559 dev->res.start = sachip->phys + info->offset;
562 dev->res.end = dev->res.start + 511; 560 dev->res.end = dev->res.start + 511;
563 dev->res.name = dev->dev.bus_id; 561 dev->res.name = dev_name(&dev->dev);
564 dev->res.flags = IORESOURCE_MEM; 562 dev->res.flags = IORESOURCE_MEM;
565 dev->mapbase = sachip->base + info->offset; 563 dev->mapbase = sachip->base + info->offset;
566 dev->skpcr_mask = info->skpcr_mask; 564 dev->skpcr_mask = info->skpcr_mask;
@@ -570,6 +568,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
570 if (ret) { 568 if (ret) {
571 printk("SA1111: failed to allocate resource for %s\n", 569 printk("SA1111: failed to allocate resource for %s\n",
572 dev->res.name); 570 dev->res.name);
571 dev_set_name(&dev->dev, NULL);
573 kfree(dev); 572 kfree(dev);
574 goto out; 573 goto out;
575 } 574 }
@@ -593,7 +592,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
593 if (dev->dma_mask != 0xffffffffUL) { 592 if (dev->dma_mask != 0xffffffffUL) {
594 ret = dmabounce_register_dev(&dev->dev, 1024, 4096); 593 ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
595 if (ret) { 594 if (ret) {
596 printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id); 595 dev_err(&dev->dev, "SA1111: Failed to register"
596 " with dmabounce\n");
597 device_unregister(&dev->dev); 597 device_unregister(&dev->dev);
598 } 598 }
599 } 599 }
@@ -627,7 +627,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
627 if (!sachip) 627 if (!sachip)
628 return -ENOMEM; 628 return -ENOMEM;
629 629
630 sachip->clk = clk_get(me, "GPIO27_CLK"); 630 sachip->clk = clk_get(me, "SA1111_CLK");
631 if (!sachip->clk) { 631 if (!sachip->clk) {
632 ret = PTR_ERR(sachip->clk); 632 ret = PTR_ERR(sachip->clk);
633 goto err_free; 633 goto err_free;
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index bc299b07a6fa..ae39553589dd 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -247,7 +247,7 @@ static int __devinit scoop_probe(struct platform_device *pdev)
247 devptr->gpio.base = -1; 247 devptr->gpio.base = -1;
248 248
249 if (inf->gpio_base != 0) { 249 if (inf->gpio_base != 0) {
250 devptr->gpio.label = pdev->dev.bus_id; 250 devptr->gpio.label = dev_name(&pdev->dev);
251 devptr->gpio.base = inf->gpio_base; 251 devptr->gpio.base = inf->gpio_base;
252 devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */ 252 devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
253 devptr->gpio.set = scoop_gpio_set; 253 devptr->gpio.set = scoop_gpio_set;
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 5bba5255b119..8822b684d474 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -31,6 +31,7 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/arch/pm.h> 32#include <asm/arch/pm.h>
33#include <asm/arch/pxa-regs.h> 33#include <asm/arch/pxa-regs.h>
34#include <asm/arch/pxa2xx-regs.h>
34#include <asm/arch/sharpsl.h> 35#include <asm/arch/sharpsl.h>
35#include <asm/hardware/sharpsl_pm.h> 36#include <asm/hardware/sharpsl_pm.h>
36 37
@@ -157,6 +158,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
157 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage, 158 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
158 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); 159 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
159 160
161#ifdef CONFIG_BACKLIGHT_CORGI
160 /* If battery is low. limit backlight intensity to save power. */ 162 /* If battery is low. limit backlight intensity to save power. */
161 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 163 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
162 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) || 164 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) ||
@@ -169,6 +171,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
169 sharpsl_pm.machinfo->backlight_limit(0); 171 sharpsl_pm.machinfo->backlight_limit(0);
170 sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT; 172 sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
171 } 173 }
174#endif
172 175
173 /* Suspend if critical battery level */ 176 /* Suspend if critical battery level */
174 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 177 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)