1. 17 Apr, 2019 5 commits
    • Chen-Yu Tsai's avatar
      power: supply: axp20x_usb_power: use polling to detect vbus status change · 97ec136e
      Chen-Yu Tsai authored
      On AXP221 and later AXP PMICs that have the N_VBUSEN pin, when this pin
      is high, either due to the PMIC driving it high or as an input, the VBUS
      detection related interrupt mechanisms are disabled.
      
      Previously this was worked around in the phy-sun4i-usb driver, which
      needed to sense VBUS changes and report them to the musb driver in a
      timely matter. However this workaround was only for the A31 and A33 type
      USB PHYs. To support newer platforms we would have to enable it for
      almost all the post-A31 SoCs.
      
      However, since this is actually the result of the PMIC's behavior, the
      workaround would be better if done in the PMIC driver, in this case the
      VBUS power supply driver.
      
      Add the same workqueue-based polling to the VBUS power supply driver.
      The polling interval is chosen to be the debounce interval from the USB
      PHY driver, as this short interval is needed in some cases, but the
      power supply driver would not know when.
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      97ec136e
    • Chen-Yu Tsai's avatar
      power: supply: axp20x_usb_power: Fix typo in VBUS current limit macros · c11f0b8f
      Chen-Yu Tsai authored
      The VBUS current limit value macros have VBUS typed as VBUC, while
      the bitmask macro is named correctly. Fix it.
      
      Fixes: 69fb4dca ("power: Add an axp20x-usb-power driver")
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      c11f0b8f
    • Chen-Yu Tsai's avatar
      dt-bindings: power: supply: axp20x_usb_power: add axp813 compatible · 2e8c9d7b
      Chen-Yu Tsai authored
      This adds the "x-powers,axp813-usb-power-supply" to the list of
      compatibles for AXP20X VBUS power supply driver.
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      2e8c9d7b
    • Wen Yang's avatar
      power: supply: core: fix leaked of_node refs in power_supply_get_battery_info · 2143bf6d
      Wen Yang authored
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./drivers/power/supply/power_supply_core.c:601:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:604:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:632:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:635:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:653:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:664:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      ./drivers/power/supply/power_supply_core.c:673:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function.
      Signed-off-by: default avatarWen Yang <wen.yang99@zte.com.cn>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      2143bf6d
    • Wen Yang's avatar
      power: supply: ab8500: fix leaked of_node refs in ab8500_bm_of_probe · 0b646fd1
      Wen Yang authored
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      492 int ab8500_bm_of_probe(struct device *dev,
      493                        struct device_node *np,
      494                        struct abx500_bm_data *bm)
      495 {
      496         const struct batres_vs_temp *tmp_batres_tbl;
      497         struct device_node *battery_node;
          ...
      501         /* get phandle to 'battery-info' node */
      502         battery_node = of_parse_phandle(np, "battery", 0);
          ...
      509         if (!btech) {
      510                 dev_warn(dev, "missing property battery-name/type\n");
      511                 return -EINVAL;    ---> leaked here
      512         }
          ...
      540         of_node_put(battery_node);   ---> released here
      541
      542         return 0;
      543 }
      
      Detected by coccinelle with the following warnings:
      ./drivers/power/supply/ab8500_bmdata.c:511:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 502, but without a corresponding object release within this function.
      Signed-off-by: default avatarWen Yang <wen.yang99@zte.com.cn>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      0b646fd1
  2. 15 Apr, 2019 10 commits
  3. 09 Apr, 2019 3 commits
  4. 05 Apr, 2019 10 commits
  5. 17 Mar, 2019 12 commits