aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/dmabounce.c2
-rw-r--r--arch/arm/common/gic.c22
-rw-r--r--arch/arm/common/sharpsl_param.c2
-rw-r--r--arch/arm/common/sharpsl_pm.c22
4 files changed, 25 insertions, 23 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 6fbe7722aa44..b36b1e8a105d 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -6,7 +6,7 @@
6 * copy data to/from buffers located outside the DMA region. This 6 * copy data to/from buffers located outside the DMA region. This
7 * only works for systems in which DMA memory is at the bottom of 7 * only works for systems in which DMA memory is at the bottom of
8 * RAM, the remainder of memory is at the top and the DMA memory 8 * RAM, the remainder of memory is at the top and the DMA memory
9 * can be marked as ZONE_DMA. Anything beyond that such as discontigous 9 * can be marked as ZONE_DMA. Anything beyond that such as discontiguous
10 * DMA windows will require custom implementations that reserve memory 10 * DMA windows will require custom implementations that reserve memory
11 * areas at early bootup. 11 * areas at early bootup.
12 * 12 *
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 4deece5fbdf4..0c89bd35e06f 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -72,7 +72,7 @@ static inline unsigned int gic_irq(unsigned int irq)
72 * unmask it, in the same way we need to unmask an interrupt when 72 * unmask it, in the same way we need to unmask an interrupt when
73 * we first enable it. 73 * we first enable it.
74 * 74 *
75 * The GIC has a seperate notion of "end of interrupt" to re-enable 75 * The GIC has a separate notion of "end of interrupt" to re-enable
76 * an interrupt after handling, in order to support hardware 76 * an interrupt after handling, in order to support hardware
77 * prioritisation. 77 * prioritisation.
78 * 78 *
@@ -125,12 +125,11 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
125} 125}
126#endif 126#endif
127 127
128static void fastcall gic_handle_cascade_irq(unsigned int irq, 128static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
129 struct irq_desc *desc)
130{ 129{
131 struct gic_chip_data *chip_data = get_irq_data(irq); 130 struct gic_chip_data *chip_data = get_irq_data(irq);
132 struct irq_chip *chip = get_irq_chip(irq); 131 struct irq_chip *chip = get_irq_chip(irq);
133 unsigned int cascade_irq; 132 unsigned int cascade_irq, gic_irq;
134 unsigned long status; 133 unsigned long status;
135 134
136 /* primary controller ack'ing */ 135 /* primary controller ack'ing */
@@ -140,16 +139,15 @@ static void fastcall gic_handle_cascade_irq(unsigned int irq,
140 status = readl(chip_data->cpu_base + GIC_CPU_INTACK); 139 status = readl(chip_data->cpu_base + GIC_CPU_INTACK);
141 spin_unlock(&irq_controller_lock); 140 spin_unlock(&irq_controller_lock);
142 141
143 cascade_irq = (status & 0x3ff); 142 gic_irq = (status & 0x3ff);
144 if (cascade_irq > 1020) 143 if (gic_irq == 1023)
145 goto out; 144 goto out;
146 if (cascade_irq < 32 || cascade_irq >= NR_IRQS) {
147 do_bad_IRQ(cascade_irq, desc);
148 goto out;
149 }
150 145
151 cascade_irq += chip_data->irq_offset; 146 cascade_irq = gic_irq + chip_data->irq_offset;
152 generic_handle_irq(cascade_irq); 147 if (unlikely(gic_irq < 32 || gic_irq > 1020 || cascade_irq >= NR_IRQS))
148 do_bad_IRQ(cascade_irq, desc);
149 else
150 generic_handle_irq(cascade_irq);
153 151
154 out: 152 out:
155 /* primary controller unmasking */ 153 /* primary controller unmasking */
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
index c94864c5b1af..aad4d94ba8f5 100644
--- a/arch/arm/common/sharpsl_param.c
+++ b/arch/arm/common/sharpsl_param.c
@@ -20,7 +20,7 @@
20 * typically including LCD parameters are loaded by the bootloader at the 20 * typically including LCD parameters are loaded by the bootloader at the
21 * address PARAM_BASE. As the kernel will overwrite them, we need to store 21 * address PARAM_BASE. As the kernel will overwrite them, we need to store
22 * them early in the boot process, then pass them to the appropriate drivers. 22 * them early in the boot process, then pass them to the appropriate drivers.
23 * Not all devices use all paramaters but the format is common to all. 23 * Not all devices use all parameters but the format is common to all.
24 */ 24 */
25#ifdef CONFIG_ARCH_SA1100 25#ifdef CONFIG_ARCH_SA1100
26#define PARAM_BASE 0xe8ffc000 26#define PARAM_BASE 0xe8ffc000
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 5972df2b9af4..3bf3a927ae22 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -153,7 +153,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
153 sharpsl_pm.battstat.mainbat_percent = percent; 153 sharpsl_pm.battstat.mainbat_percent = percent;
154 } 154 }
155 155
156 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %d\n", voltage, 156 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
157 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); 157 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
158 158
159 /* If battery is low. limit backlight intensity to save power. */ 159 /* If battery is low. limit backlight intensity to save power. */
@@ -291,7 +291,7 @@ static void sharpsl_chrg_full_timer(unsigned long data)
291} 291}
292 292
293/* Charging Finished Interrupt (Not present on Corgi) */ 293/* Charging Finished Interrupt (Not present on Corgi) */
294/* Can trigger at the same time as an AC staus change so 294/* Can trigger at the same time as an AC status change so
295 delay until after that has been processed */ 295 delay until after that has been processed */
296irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id) 296irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id)
297{ 297{
@@ -625,7 +625,7 @@ static int sharpsl_fatal_check(void)
625 } 625 }
626 626
627 temp = get_select_val(buff); 627 temp = get_select_val(buff);
628 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %d\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT)); 628 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT));
629 629
630 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) || 630 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) ||
631 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt))) 631 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt)))
@@ -635,7 +635,7 @@ static int sharpsl_fatal_check(void)
635 635
636static int sharpsl_off_charge_error(void) 636static int sharpsl_off_charge_error(void)
637{ 637{
638 dev_err(sharpsl_pm.dev, "Offline Charger: Error occured.\n"); 638 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n");
639 sharpsl_pm.machinfo->charge(0); 639 sharpsl_pm.machinfo->charge(0);
640 sharpsl_pm_led(SHARPSL_LED_ERROR); 640 sharpsl_pm_led(SHARPSL_LED_ERROR);
641 sharpsl_pm.charge_mode = CHRG_ERROR; 641 sharpsl_pm.charge_mode = CHRG_ERROR;
@@ -691,14 +691,14 @@ static int sharpsl_off_charge_battery(void)
691 691
692 time = RCNR; 692 time = RCNR;
693 while(1) { 693 while(1) {
694 /* Check if any wakeup event had occured */ 694 /* Check if any wakeup event had occurred */
695 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 695 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
696 return 0; 696 return 0;
697 /* Check for timeout */ 697 /* Check for timeout */
698 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME) 698 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)
699 return 1; 699 return 1;
700 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) { 700 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
701 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occured. Retrying to check\n"); 701 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occurred. Retrying to check\n");
702 sharpsl_pm.full_count++; 702 sharpsl_pm.full_count++;
703 sharpsl_pm.machinfo->charge(0); 703 sharpsl_pm.machinfo->charge(0);
704 mdelay(SHARPSL_CHARGE_WAIT_TIME); 704 mdelay(SHARPSL_CHARGE_WAIT_TIME);
@@ -714,7 +714,7 @@ static int sharpsl_off_charge_battery(void)
714 714
715 time = RCNR; 715 time = RCNR;
716 while(1) { 716 while(1) {
717 /* Check if any wakeup event had occured */ 717 /* Check if any wakeup event had occurred */
718 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 718 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
719 return 0; 719 return 0;
720 /* Check for timeout */ 720 /* Check for timeout */
@@ -774,6 +774,8 @@ static struct pm_ops sharpsl_pm_ops = {
774 774
775static int __init sharpsl_pm_probe(struct platform_device *pdev) 775static int __init sharpsl_pm_probe(struct platform_device *pdev)
776{ 776{
777 int ret;
778
777 if (!pdev->dev.platform_data) 779 if (!pdev->dev.platform_data)
778 return -EINVAL; 780 return -EINVAL;
779 781
@@ -792,8 +794,10 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
792 794
793 sharpsl_pm.machinfo->init(); 795 sharpsl_pm.machinfo->init();
794 796
795 device_create_file(&pdev->dev, &dev_attr_battery_percentage); 797 ret = device_create_file(&pdev->dev, &dev_attr_battery_percentage);
796 device_create_file(&pdev->dev, &dev_attr_battery_voltage); 798 ret |= device_create_file(&pdev->dev, &dev_attr_battery_voltage);
799 if (ret != 0)
800 dev_warn(&pdev->dev, "Failed to register attributes (%d)\n", ret);
797 801
798 apm_get_power_status = sharpsl_apm_get_power_status; 802 apm_get_power_status = sharpsl_apm_get_power_status;
799 803