Loading drivers/power/reset/gemini-poweroff.c +11 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,17 @@ static int gemini_poweroff_probe(struct platform_device *pdev) val |= GEMINI_CTRL_ENABLE; writel(val, gpw->base + GEMINI_PWC_CTRLREG); /* Now that the state machine is active, clear the IRQ */ /* Clear the IRQ */ val = readl(gpw->base + GEMINI_PWC_CTRLREG); val |= GEMINI_CTRL_IRQ_CLR; writel(val, gpw->base + GEMINI_PWC_CTRLREG); /* Wait for this to clear */ val = readl(gpw->base + GEMINI_PWC_STATREG); while (val & 0x70U) val = readl(gpw->base + GEMINI_PWC_STATREG); /* Clear the IRQ again */ val = readl(gpw->base + GEMINI_PWC_CTRLREG); val |= GEMINI_CTRL_IRQ_CLR; writel(val, gpw->base + GEMINI_PWC_CTRLREG); Loading drivers/power/reset/vexpress-poweroff.c +8 −4 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ static void vexpress_reset_do(struct device *dev, const char *what) } static struct device *vexpress_power_off_device; static atomic_t vexpress_restart_nb_refcnt = ATOMIC_INIT(0); static void vexpress_power_off(void) { Loading Loading @@ -99,11 +100,14 @@ static int _vexpress_register_restart_handler(struct device *dev) int err; vexpress_restart_device = dev; if (atomic_inc_return(&vexpress_restart_nb_refcnt) == 1) { err = register_restart_handler(&vexpress_restart_nb); if (err) { dev_err(dev, "cannot register restart handler (err=%d)\n", err); atomic_dec(&vexpress_restart_nb_refcnt); return err; } } device_create_file(dev, &dev_attr_active); return 0; Loading drivers/power/supply/axp288_charger.c +1 −1 Original line number Diff line number Diff line Loading @@ -718,7 +718,7 @@ static int charger_init_hw_regs(struct axp288_chrg_info *info) } /* Determine charge current limit */ cc = (ret & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS; cc = (val & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS; cc = (cc * CHRG_CCCV_CC_LSB_RES) + CHRG_CCCV_CC_OFFSET; info->cc = cc; Loading drivers/power/supply/generic-adc-battery.c +15 −10 Original line number Diff line number Diff line Loading @@ -241,10 +241,10 @@ static int gab_probe(struct platform_device *pdev) struct power_supply_desc *psy_desc; struct power_supply_config psy_cfg = {}; struct gab_platform_data *pdata = pdev->dev.platform_data; enum power_supply_property *properties; int ret = 0; int chan; int index = 0; int index = ARRAY_SIZE(gab_props); bool any = false; adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL); if (!adc_bat) { Loading Loading @@ -278,8 +278,6 @@ static int gab_probe(struct platform_device *pdev) } memcpy(psy_desc->properties, gab_props, sizeof(gab_props)); properties = (enum power_supply_property *) ((char *)psy_desc->properties + sizeof(gab_props)); /* * getting channel from iio and copying the battery properties Loading @@ -293,15 +291,22 @@ static int gab_probe(struct platform_device *pdev) adc_bat->channel[chan] = NULL; } else { /* copying properties for supported channels only */ memcpy(properties + sizeof(*(psy_desc->properties)) * index, &gab_dyn_props[chan], sizeof(gab_dyn_props[chan])); index++; int index2; for (index2 = 0; index2 < index; index2++) { if (psy_desc->properties[index2] == gab_dyn_props[chan]) break; /* already known */ } if (index2 == index) /* really new */ psy_desc->properties[index++] = gab_dyn_props[chan]; any = true; } } /* none of the channels are supported so let's bail out */ if (index == 0) { if (!any) { ret = -ENODEV; goto second_mem_fail; } Loading @@ -312,7 +317,7 @@ static int gab_probe(struct platform_device *pdev) * as come channels may be not be supported by the device.So * we need to take care of that. */ psy_desc->num_properties = ARRAY_SIZE(gab_props) + index; psy_desc->num_properties = index; adc_bat->psy = power_supply_register(&pdev->dev, psy_desc, &psy_cfg); if (IS_ERR(adc_bat->psy)) { Loading drivers/power/supply/max77693_charger.c +1 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ static int max77693_set_charge_input_threshold_volt(struct max77693_charger *chg case 4800000: case 4900000: data = (uvolt - 4700000) / 100000; break; default: dev_err(chg->dev, "Wrong value for charge input voltage regulation threshold\n"); return -EINVAL; Loading Loading
drivers/power/reset/gemini-poweroff.c +11 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,17 @@ static int gemini_poweroff_probe(struct platform_device *pdev) val |= GEMINI_CTRL_ENABLE; writel(val, gpw->base + GEMINI_PWC_CTRLREG); /* Now that the state machine is active, clear the IRQ */ /* Clear the IRQ */ val = readl(gpw->base + GEMINI_PWC_CTRLREG); val |= GEMINI_CTRL_IRQ_CLR; writel(val, gpw->base + GEMINI_PWC_CTRLREG); /* Wait for this to clear */ val = readl(gpw->base + GEMINI_PWC_STATREG); while (val & 0x70U) val = readl(gpw->base + GEMINI_PWC_STATREG); /* Clear the IRQ again */ val = readl(gpw->base + GEMINI_PWC_CTRLREG); val |= GEMINI_CTRL_IRQ_CLR; writel(val, gpw->base + GEMINI_PWC_CTRLREG); Loading
drivers/power/reset/vexpress-poweroff.c +8 −4 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ static void vexpress_reset_do(struct device *dev, const char *what) } static struct device *vexpress_power_off_device; static atomic_t vexpress_restart_nb_refcnt = ATOMIC_INIT(0); static void vexpress_power_off(void) { Loading Loading @@ -99,11 +100,14 @@ static int _vexpress_register_restart_handler(struct device *dev) int err; vexpress_restart_device = dev; if (atomic_inc_return(&vexpress_restart_nb_refcnt) == 1) { err = register_restart_handler(&vexpress_restart_nb); if (err) { dev_err(dev, "cannot register restart handler (err=%d)\n", err); atomic_dec(&vexpress_restart_nb_refcnt); return err; } } device_create_file(dev, &dev_attr_active); return 0; Loading
drivers/power/supply/axp288_charger.c +1 −1 Original line number Diff line number Diff line Loading @@ -718,7 +718,7 @@ static int charger_init_hw_regs(struct axp288_chrg_info *info) } /* Determine charge current limit */ cc = (ret & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS; cc = (val & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS; cc = (cc * CHRG_CCCV_CC_LSB_RES) + CHRG_CCCV_CC_OFFSET; info->cc = cc; Loading
drivers/power/supply/generic-adc-battery.c +15 −10 Original line number Diff line number Diff line Loading @@ -241,10 +241,10 @@ static int gab_probe(struct platform_device *pdev) struct power_supply_desc *psy_desc; struct power_supply_config psy_cfg = {}; struct gab_platform_data *pdata = pdev->dev.platform_data; enum power_supply_property *properties; int ret = 0; int chan; int index = 0; int index = ARRAY_SIZE(gab_props); bool any = false; adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL); if (!adc_bat) { Loading Loading @@ -278,8 +278,6 @@ static int gab_probe(struct platform_device *pdev) } memcpy(psy_desc->properties, gab_props, sizeof(gab_props)); properties = (enum power_supply_property *) ((char *)psy_desc->properties + sizeof(gab_props)); /* * getting channel from iio and copying the battery properties Loading @@ -293,15 +291,22 @@ static int gab_probe(struct platform_device *pdev) adc_bat->channel[chan] = NULL; } else { /* copying properties for supported channels only */ memcpy(properties + sizeof(*(psy_desc->properties)) * index, &gab_dyn_props[chan], sizeof(gab_dyn_props[chan])); index++; int index2; for (index2 = 0; index2 < index; index2++) { if (psy_desc->properties[index2] == gab_dyn_props[chan]) break; /* already known */ } if (index2 == index) /* really new */ psy_desc->properties[index++] = gab_dyn_props[chan]; any = true; } } /* none of the channels are supported so let's bail out */ if (index == 0) { if (!any) { ret = -ENODEV; goto second_mem_fail; } Loading @@ -312,7 +317,7 @@ static int gab_probe(struct platform_device *pdev) * as come channels may be not be supported by the device.So * we need to take care of that. */ psy_desc->num_properties = ARRAY_SIZE(gab_props) + index; psy_desc->num_properties = index; adc_bat->psy = power_supply_register(&pdev->dev, psy_desc, &psy_cfg); if (IS_ERR(adc_bat->psy)) { Loading
drivers/power/supply/max77693_charger.c +1 −0 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ static int max77693_set_charge_input_threshold_volt(struct max77693_charger *chg case 4800000: case 4900000: data = (uvolt - 4700000) / 100000; break; default: dev_err(chg->dev, "Wrong value for charge input voltage regulation threshold\n"); return -EINVAL; Loading