Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357568
b: refs/heads/master
c: 60c185f
h: refs/heads/master
v: v3
  • Loading branch information
Laxman Dewangan authored and Samuel Ortiz committed Feb 13, 2013
1 parent ebe494f commit df2356f
Show file tree
Hide file tree
Showing 2 changed files with 53 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: a36516b016f52f0f6e5284025e3487f63b4be33b
refs/heads/master: 60c185f059c88ad4b9b170b1f9322e3adcccca07
52 changes: 52 additions & 0 deletions trunk/include/linux/mfd/palmas.h
Original file line number Diff line number Diff line change
Expand Up @@ -2789,4 +2789,56 @@ enum usb_irq_events {
#define PALMAS_GPADC_TRIM15 0xE
#define PALMAS_GPADC_TRIM16 0xF

static inline int palmas_read(struct palmas *palmas, unsigned int base,
unsigned int reg, unsigned int *val)
{
unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
int slave_id = PALMAS_BASE_TO_SLAVE(base);

return regmap_read(palmas->regmap[slave_id], addr, val);
}

static inline int palmas_write(struct palmas *palmas, unsigned int base,
unsigned int reg, unsigned int value)
{
unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
int slave_id = PALMAS_BASE_TO_SLAVE(base);

return regmap_write(palmas->regmap[slave_id], addr, value);
}

static inline int palmas_bulk_write(struct palmas *palmas, unsigned int base,
unsigned int reg, const void *val, size_t val_count)
{
unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
int slave_id = PALMAS_BASE_TO_SLAVE(base);

return regmap_bulk_write(palmas->regmap[slave_id], addr,
val, val_count);
}

static inline int palmas_bulk_read(struct palmas *palmas, unsigned int base,
unsigned int reg, void *val, size_t val_count)
{
unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
int slave_id = PALMAS_BASE_TO_SLAVE(base);

return regmap_bulk_read(palmas->regmap[slave_id], addr,
val, val_count);
}

static inline int palmas_update_bits(struct palmas *palmas, unsigned int base,
unsigned int reg, unsigned int mask, unsigned int val)
{
unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
int slave_id = PALMAS_BASE_TO_SLAVE(base);

return regmap_update_bits(palmas->regmap[slave_id], addr, mask, val);
}

static inline int palmas_irq_get_virq(struct palmas *palmas, int irq)
{
return regmap_irq_get_virq(palmas->irq_data, irq);
}

#endif /* __LINUX_MFD_PALMAS_H */

0 comments on commit df2356f

Please sign in to comment.