Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186333
b: refs/heads/master
c: 86c3400
h: refs/heads/master
i:
  186331: faeaac1
v: v3
  • Loading branch information
Uwe Kleine-König authored and Linus Torvalds committed Mar 6, 2010
1 parent 4b8dd19 commit 1a7ffb5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4dd4dd655cedb7c5c0bf45bc1d012ebbe21e8319
refs/heads/master: 86c3400810a7a33e176bf33b6b074d881e829374
35 changes: 35 additions & 0 deletions trunk/drivers/mfd/mc13783-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,41 @@ int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
}
EXPORT_SYMBOL(mc13783_irq_unmask);

int mc13783_irq_status(struct mc13783 *mc13783, int irq,
int *enabled, int *pending)
{
int ret;
unsigned int offmask = irq < 24 ? MC13783_IRQMASK0 : MC13783_IRQMASK1;
unsigned int offstat = irq < 24 ? MC13783_IRQSTAT0 : MC13783_IRQSTAT1;
u32 irqbit = 1 << (irq < 24 ? irq : irq - 24);

if (irq < 0 || irq >= MC13783_NUM_IRQ)
return -EINVAL;

if (enabled) {
u32 mask;

ret = mc13783_reg_read(mc13783, offmask, &mask);
if (ret)
return ret;

*enabled = mask & irqbit;
}

if (pending) {
u32 stat;

ret = mc13783_reg_read(mc13783, offstat, &stat);
if (ret)
return ret;

*pending = stat & irqbit;
}

return 0;
}
EXPORT_SYMBOL(mc13783_irq_status);

int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
{
unsigned int offstat = irq < 24 ? MC13783_IRQSTAT0 : MC13783_IRQSTAT1;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mfd/mc13783.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev);

int mc13783_irq_mask(struct mc13783 *mc13783, int irq);
int mc13783_irq_unmask(struct mc13783 *mc13783, int irq);
int mc13783_irq_status(struct mc13783 *mc13783, int irq,
int *enabled, int *pending);
int mc13783_irq_ack(struct mc13783 *mc13783, int irq);

static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated;
Expand Down

0 comments on commit 1a7ffb5

Please sign in to comment.