Skip to content

Commit

Permalink
Merge branch 'fixes' into for-next
Browse files Browse the repository at this point in the history
Merge for-stable fixes branch into for-next development branch.

Signed-off-by: Sebastian Reichel <[email protected]>
  • Loading branch information
sre committed Mar 12, 2018
2 parents fc5a7f0 + f72c14a commit 75dd56c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
30 changes: 17 additions & 13 deletions drivers/power/reset/gemini-poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ static irqreturn_t gemini_powerbutton_interrupt(int irq, void *data)
val &= 0x70U;
switch (val) {
case GEMINI_STAT_CIR:
dev_info(gpw->dev, "infrared poweroff\n");
orderly_poweroff(true);
/*
* We do not yet have a driver for the infrared
* controller so it can cause spurious poweroff
* events. Ignore those for now.
*/
dev_info(gpw->dev, "infrared poweroff - ignored\n");
break;
case GEMINI_STAT_RTC:
dev_info(gpw->dev, "RTC poweroff\n");
Expand Down Expand Up @@ -116,7 +120,17 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
return -ENODEV;
}

/* Clear the power management IRQ */
/*
* Enable the power controller. This is crucial on Gemini
* systems: if this is not done, pressing the power button
* will result in unconditional poweroff without any warning.
* This makes the kernel handle the poweroff.
*/
val = readl(gpw->base + GEMINI_PWC_CTRLREG);
val |= GEMINI_CTRL_ENABLE;
writel(val, gpw->base + GEMINI_PWC_CTRLREG);

/* Now that the state machine is active, clear the IRQ */
val = readl(gpw->base + GEMINI_PWC_CTRLREG);
val |= GEMINI_CTRL_IRQ_CLR;
writel(val, gpw->base + GEMINI_PWC_CTRLREG);
Expand All @@ -129,16 +143,6 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
pm_power_off = gemini_poweroff;
gpw_poweroff = gpw;

/*
* Enable the power controller. This is crucial on Gemini
* systems: if this is not done, pressing the power button
* will result in unconditional poweroff without any warning.
* This makes the kernel handle the poweroff.
*/
val = readl(gpw->base + GEMINI_PWC_CTRLREG);
val |= GEMINI_CTRL_ENABLE;
writel(val, gpw->base + GEMINI_PWC_CTRLREG);

dev_info(dev, "Gemini poweroff driver registered\n");

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/bq27xxx_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ static int bq27xxx_battery_status(struct bq27xxx_device_info *di,
status = POWER_SUPPLY_STATUS_FULL;
else if (di->cache.flags & BQ27000_FLAG_CHGS)
status = POWER_SUPPLY_STATUS_CHARGING;
else if (power_supply_am_i_supplied(di->bat))
else if (power_supply_am_i_supplied(di->bat) > 0)
status = POWER_SUPPLY_STATUS_NOT_CHARGING;
else
status = POWER_SUPPLY_STATUS_DISCHARGING;
Expand Down
8 changes: 4 additions & 4 deletions drivers/power/supply/ltc2941-battery-gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ static int ltc294x_get_temperature(const struct ltc294x_info *info, int *val)

if (info->id == LTC2942_ID) {
reg = LTC2942_REG_TEMPERATURE_MSB;
value = 60000; /* Full-scale is 600 Kelvin */
value = 6000; /* Full-scale is 600 Kelvin */
} else {
reg = LTC2943_REG_TEMPERATURE_MSB;
value = 51000; /* Full-scale is 510 Kelvin */
value = 5100; /* Full-scale is 510 Kelvin */
}
ret = ltc294x_read_regs(info->client, reg, &datar[0], 2);
value *= (datar[0] << 8) | datar[1];
/* Convert to centidegrees */
*val = value / 0xFFFF - 27215;
/* Convert to tenths of degree Celsius */
*val = value / 0xFFFF - 2722;
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/power/supply/max17042_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ static int max17042_probe(struct i2c_client *client,

i2c_set_clientdata(client, chip);
psy_cfg.drv_data = chip;
psy_cfg.of_node = dev->of_node;

/* When current is not measured,
* CURRENT_NOW and CURRENT_AVG properties should be invisible. */
Expand Down

0 comments on commit 75dd56c

Please sign in to comment.