|
@@ -148,8 +148,8 @@ static const int ab9540_irq_regoffset[AB9540_NUM_IRQ_REGS] = {
|
|
|
|
|
|
/* AB8540 support */
|
|
|
static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = {
|
|
|
- 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23,
|
|
|
- 25, 26, 27, 28, 29, 30, 31,
|
|
|
+ 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22,
|
|
|
+ 23, 25, 26, 27, 28, 29, 30, 31,
|
|
|
};
|
|
|
|
|
|
static const char ab8500_version_str[][7] = {
|
|
@@ -322,7 +322,7 @@ static int ab8500_mask_and_set_register(struct device *dev,
|
|
|
struct ab8500 *ab8500 = dev_get_drvdata(dev->parent);
|
|
|
|
|
|
atomic_inc(&ab8500->transfer_ongoing);
|
|
|
- ret= mask_and_set_register_interruptible(ab8500, bank, reg,
|
|
|
+ ret = mask_and_set_register_interruptible(ab8500, bank, reg,
|
|
|
bitmask, bitvalues);
|
|
|
atomic_dec(&ab8500->transfer_ongoing);
|
|
|
return ret;
|
|
@@ -415,9 +415,11 @@ static void ab8500_irq_unmask(struct irq_data *data)
|
|
|
if (type & IRQ_TYPE_EDGE_FALLING) {
|
|
|
if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R)
|
|
|
ab8500->mask[index + 2] &= ~mask;
|
|
|
- else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
|
|
|
+ else if (offset >= AB9540_INT_GPIO50R &&
|
|
|
+ offset <= AB9540_INT_GPIO54R)
|
|
|
ab8500->mask[index + 1] &= ~mask;
|
|
|
- else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
|
|
|
+ else if (offset == AB8540_INT_GPIO43R ||
|
|
|
+ offset == AB8540_INT_GPIO44R)
|
|
|
/* Here the falling IRQ is one bit lower */
|
|
|
ab8500->mask[index] &= ~(mask << 1);
|
|
|
else
|
|
@@ -451,7 +453,7 @@ static void update_latch_offset(u8 *offset, int i)
|
|
|
/* Fix inconsistent ab8540 bit mapping... */
|
|
|
if (unlikely(*offset == 16))
|
|
|
*offset = 25;
|
|
|
- if ((i==3) && (*offset >= 24))
|
|
|
+ if ((i == 3) && (*offset >= 24))
|
|
|
*offset += 2;
|
|
|
}
|
|
|
|
|
@@ -573,8 +575,8 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
|
|
|
}
|
|
|
|
|
|
static struct irq_domain_ops ab8500_irq_ops = {
|
|
|
- .map = ab8500_irq_map,
|
|
|
- .xlate = irq_domain_xlate_twocell,
|
|
|
+ .map = ab8500_irq_map,
|
|
|
+ .xlate = irq_domain_xlate_twocell,
|
|
|
};
|
|
|
|
|
|
static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
|
|
@@ -1551,7 +1553,7 @@ static struct attribute_group ab9540_attr_group = {
|
|
|
|
|
|
static int ab8500_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
- static char *switch_off_status[] = {
|
|
|
+ static const char *switch_off_status[] = {
|
|
|
"Swoff bit programming",
|
|
|
"Thermal protection activation",
|
|
|
"Vbat lower then BattOk falling threshold",
|
|
@@ -1560,7 +1562,7 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
"Battery level lower than power on reset threshold",
|
|
|
"Power on key 1 pressed longer than 10 seconds",
|
|
|
"DB8500 thermal shutdown"};
|
|
|
- static char *turn_on_status[] = {
|
|
|
+ static const char *turn_on_status[] = {
|
|
|
"Battery rising (Vbat)",
|
|
|
"Power On Key 1 dbF",
|
|
|
"Power On Key 2 dbF",
|
|
@@ -1579,7 +1581,7 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
int i;
|
|
|
u8 value;
|
|
|
|
|
|
- ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL);
|
|
|
+ ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL);
|
|
|
if (!ab8500)
|
|
|
return -ENOMEM;
|
|
|
|
|
@@ -1636,7 +1638,7 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
ab8500->mask_size = AB8540_NUM_IRQ_REGS;
|
|
|
ab8500->irq_reg_offset = ab8540_irq_regoffset;
|
|
|
ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM;
|
|
|
- }/* Configure AB8500 or AB9540 IRQ */
|
|
|
+ } /* Configure AB8500 or AB9540 IRQ */
|
|
|
else if (is_ab9540(ab8500) || is_ab8505(ab8500)) {
|
|
|
ab8500->mask_size = AB9540_NUM_IRQ_REGS;
|
|
|
ab8500->irq_reg_offset = ab9540_irq_regoffset;
|
|
@@ -1646,10 +1648,12 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
ab8500->irq_reg_offset = ab8500_irq_regoffset;
|
|
|
ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM;
|
|
|
}
|
|
|
- ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
|
|
|
+ ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!ab8500->mask)
|
|
|
return -ENOMEM;
|
|
|
- ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
|
|
|
+ ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
|
|
|
+ GFP_KERNEL);
|
|
|
if (!ab8500->oldmask)
|
|
|
return -ENOMEM;
|
|
|
|
|
@@ -1674,14 +1678,13 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
if (value) {
|
|
|
for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) {
|
|
|
if (value & 1)
|
|
|
- printk(KERN_CONT " \"%s\"",
|
|
|
- switch_off_status[i]);
|
|
|
+ pr_cont(" \"%s\"", switch_off_status[i]);
|
|
|
value = value >> 1;
|
|
|
|
|
|
}
|
|
|
- printk(KERN_CONT "\n");
|
|
|
+ pr_cont("\n");
|
|
|
} else {
|
|
|
- printk(KERN_CONT " None\n");
|
|
|
+ pr_cont(" None\n");
|
|
|
}
|
|
|
ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK,
|
|
|
AB8500_TURN_ON_STATUS, &value);
|
|
@@ -1692,12 +1695,12 @@ static int ab8500_probe(struct platform_device *pdev)
|
|
|
if (value) {
|
|
|
for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) {
|
|
|
if (value & 1)
|
|
|
- printk("\"%s\" ", turn_on_status[i]);
|
|
|
+ pr_cont("\"%s\" ", turn_on_status[i]);
|
|
|
value = value >> 1;
|
|
|
}
|
|
|
- printk("\n");
|
|
|
+ pr_cont("\n");
|
|
|
} else {
|
|
|
- printk("None\n");
|
|
|
+ pr_cont("None\n");
|
|
|
}
|
|
|
|
|
|
if (plat && plat->init)
|