Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283454
b: refs/heads/master
c: b57f2f6
h: refs/heads/master
v: v3
  • Loading branch information
Philip Rakity authored and Anton Vorontsov committed Nov 26, 2011
1 parent a925bbd commit fcd6cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 60a1f6e4462bb71b39543ddbca314886a55adb9d
refs/heads/master: b57f2f6108fbf9ce33191fb574fe94b1f3ccbff3
6 changes: 6 additions & 0 deletions trunk/drivers/power/max8925_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,31 @@ static irqreturn_t max8925_charger_handler(int irq, void *data)
static int start_measure(struct max8925_power_info *info, int type)
{
unsigned char buf[2] = {0, 0};
int meas_cmd;
int meas_reg = 0, ret;

switch (type) {
case MEASURE_VCHG:
meas_cmd = MAX8925_CMD_VCHG;
meas_reg = MAX8925_ADC_VCHG;
break;
case MEASURE_VBBATT:
meas_cmd = MAX8925_CMD_VBBATT;
meas_reg = MAX8925_ADC_VBBATT;
break;
case MEASURE_VMBATT:
meas_cmd = MAX8925_CMD_VMBATT;
meas_reg = MAX8925_ADC_VMBATT;
break;
case MEASURE_ISNS:
meas_cmd = MAX8925_CMD_ISNS;
meas_reg = MAX8925_ADC_ISNS;
break;
default:
return -EINVAL;
}

max8925_reg_write(info->adc, meas_cmd, 0);
max8925_bulk_read(info->adc, meas_reg, 2, buf);
ret = ((buf[0]<<8) | buf[1]) >> 4;

Expand Down

0 comments on commit fcd6cc7

Please sign in to comment.