1. 01 May, 2017 4 commits
    • Hans de Goede's avatar
      power: supply: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers · 2848e039
      Hans de Goede authored
      It is sensible to assume that the hardware actually always has a
      way of charging the battery so when power_supply_am_i_supplied does not
      find any suppliers, that does not mean that there are none, but simply
      that no power_supply-drivers are registered / bound for any suppliers for
      the supply calling power_supply_am_i_supplied.
      
      At which point a fuel-gauge driver calling power_supply_am_i_supplied()
      cannot determine whether the battery is being charged or not.
      
      Allow a caller of power_supply_am_i_supplied to differentiate between
      there not being any suppliers, vs no suppliers being online by returning
      -ENODEV if there are no suppliers matching supplied_to / supplied_from,
      which allows fuel-gauge drivers to return POWER_SUPPLY_STATUS_UNKNOWN
      rather then POWER_SUPPLY_STATUS_DISCHARGING if there are no suppliers.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
      2848e039
    • H. Nikolaus Schaller's avatar
      power: supply: twl4030-charger: don't check if battery is present · 19a2ee69
      H. Nikolaus Schaller authored
      We can't assume that the battery is or stays present after probing
      on devices with replaceable battery.
      
      On some devices (e.g. GTA04 or OpenPanodra) it can be removed
      and even be hot swapped by the user while device continues to operate
      through external AC or USB power (as long as system power consumption
      remains below ca. 500mA as provided by USB). Under certain conditions
      it is possible to boot without battery.
      
      So it makes no sense to check for this situation during probe and make
      the charger driver (and its status reports) completely non-operational if
      the battery can be inserted later.
      
      Tested on: GTA04 and OpenPandora.
      Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
      19a2ee69
    • H. Nikolaus Schaller's avatar
      power: supply: twl4030-charger: add writable INPUT_CURRENT_LIMIT property · 3fb319c2
      H. Nikolaus Schaller authored
      Currently, the twl4030 charger defines its own max_current by directly
      creating sysfs nodes. It should use the input_current_limit property
      which is e.g. used by the bq24257 driver.
      
      This patch adds the input_current_property with the same semantics as
      the max_current property. The code to manage the max_current property
      is removed by a separate patch.
      Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
      3fb319c2
    • Hans de Goede's avatar
      power: supply: bq24190_charger: Add disable-reset device-property · 6cf62a3b
      Hans de Goede authored
      Allow platform-code to disable the reset on probe and suspend/resume
      by setting a "disable-reset" boolean device property on the device.
      
      There are several reasons why the platform-code may want to disable
      the reset on probe and suspend/resume:
      
      1) Resetting the charger should never be necessary it should always have
      sane values programmed. If it is running with invalid values while we
      are not running (system turned off or suspended) there is a big problem
      as that may lead to overcharging the battery.
      
      2) The reset in suspend() is meant to put the charger back into default
      mode, but this is not necessary and not a good idea. If the charger has
      been programmed with a higher max charge_current / charge_voltage then
      putting it back in default-mode will reset those to the safe power-on
      defaults, leading to slower charging, or charging to a lower voltage
      (and thus not using the full capacity) while suspended which is
      undesirable. Reprogramming the max charge_current / charge_voltage
      after the reset will not help here as that will put the charger back
      in host mode and start the i2c watchdog if the host then does not do
      anything for 40s (iow if we're suspended for more then 40s) the watchdog
      expires resetting the device to default-mode, including resetting all
      the registers to there safe power-on defaults. So the only way to keep
      using custom charge settings while suspending is to keep the charger in
      its normal running state with the i2c watchdog disabled. This is fine
      as the charger will still automatically switch from constant current
      to constant voltage and stop charging when the battery is full.
      
      3) Besides never being necessary resetting the charger also causes
      problems on systems where the charge voltage limit is set higher then the
      reset value, if this is the case and the charger is reset while charging
      and the battery voltage is between the 2 voltages, then about half the
      time the charger gets confused and claims to be charging (REG08 contains
      0x64) but in reality the charger has decoupled itself from VBUS (Q1 off)
      and is drawing 0A from VBUS, leaving the system running from the battery.
      
      This last problem is happening on a GPD-win mini PC with a bq24292i
      charger chip combined with a max17047 fuel-gauge and a LiHV battery.
      I've checked and TI does not list any errata for the bq24292i which
      could explain this (there are no errata at all).
      
      Cc: Liam Breck <kernel@networkimprov.net>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarLiam Breck <kernel@networkimprov.net>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
      6cf62a3b
  2. 13 Apr, 2017 29 commits
  3. 04 Apr, 2017 1 commit
    • Chanwoo Choi's avatar
      extcon: Add new extcon_register_notifier_all() to monitor all external connectors · 815429b3
      Chanwoo Choi authored
      The extcon core already provides the extcon_register_notifier() function
      in order to register the notifier block which is used to monitor
      the state change for the specific external connector such as EXTCON_USB,
      EXTCON_USB_HOST and so on. The extcon consumer uses the this function.
      
      The extcon consumer might need to monitor the all supported external
      connectors from the extcon device. In this case, The extcon consumer
      should have each notifier_block structure for each external connector.
      
      This patch adds the new extcon_register_notifier_all() function
      that extcon consumer is able to monitor the state change of all
      supported external connectors by using only one notifier_block structure.
      
      - List of new added functions:
      int extcon_register_notifier_all(struct extcon_dev *edev,
      			struct notifier_block *nb);
      int extcon_unregister_notifier_all(struct extcon_dev *edev,
      			struct notifier_block *nb);
      int devm_extcon_register_notifier_all(struct device *dev,
      			struct extcon_dev *edev, struct notifier_block *nb);
      void devm_extcon_unregister_notifier_all(struct device *dev,
      			struct extcon_dev *edev, struct notifier_block *nb);
      Suggested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
      815429b3
  4. 26 Mar, 2017 6 commits
    • Linus Torvalds's avatar
      Linux 4.11-rc4 · c02ed2e7
      Linus Torvalds authored
      c02ed2e7
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 0dc82fa5
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "A smattering of different small fixes for some random driver
        subsystems. Nothing all that major, just resolutions for reported
        issues and bugs.
      
        All have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
        extcon: int3496: Set the id pin to direction-input if necessary
        extcon: int3496: Use gpiod_get instead of gpiod_get_index
        extcon: int3496: Add dependency on X86 as it's Intel specific
        extcon: int3496: Add GPIO ACPI mapping table
        extcon: int3496: Rename GPIO pins in accordance with binding
        vmw_vmci: handle the return value from pci_alloc_irq_vectors correctly
        ppdev: fix registering same device name
        parport: fix attempt to write duplicate procfiles
        auxdisplay: img-ascii-lcd: add missing sentinel entry in img_ascii_lcd_matches
        Drivers: hv: vmbus: Don't leak memory when a channel is rescinded
        Drivers: hv: vmbus: Don't leak channel ids
        Drivers: hv: util: don't forget to init host_ts.lock
        Drivers: hv: util: move waiting for release to hv_utils_transport itself
        vmbus: remove hv_event_tasklet_disable/enable
        vmbus: use rcu for per-cpu channel list
        mei: don't wait for os version message reply
        mei: fix deadlock on mei reset
        intel_th: pci: Add Gemini Lake support
        intel_th: pci: Add Denverton SOC support
        intel_th: Don't leak module refcount on failure to activate
        ...
      0dc82fa5
    • Linus Torvalds's avatar
      Merge tag 'driver-core-4.11-rc4' of... · 9e54ef9d
      Linus Torvalds authored
      Merge tag 'driver-core-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is a single kernfs fix for 4.11-rc4 that resolves a reported
        issue.
      
        It has been in linux-next with no reported issues"
      
      * tag 'driver-core-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()
      9e54ef9d
    • Linus Torvalds's avatar
      Merge tag 'tty-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · f1638fc6
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some tty and serial driver fixes for 4.11-rc4.
      
        One of these fix a long-standing issue in the ldisc code that was
        found by Dmitry Vyukov with his great fuzzing work. The other fixes
        resolve other reported issues, and there is one revert of a patch in
        4.11-rc1 that wasn't correct.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: fix data race in tty_ldisc_ref_wait()
        tty: don't panic on OOM in tty_set_ldisc()
        Revert "tty: serial: pl011: add ttyAMA for matching pl011 console"
        tty: acpi/spcr: QDF2400 E44 checks for wrong OEM revision
        serial: 8250_dw: Fix breakage when HAVE_CLK=n
        serial: 8250_dw: Honor clk_round_rate errors in dw8250_set_termios
      f1638fc6
    • Linus Torvalds's avatar
      Merge tag 'staging-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 53b4d591
      Linus Torvalds authored
      Pull IIO driver fixes from Greg KH:
       "Here are some small IIO driver fixes for 4.11-rc4 that resolve a
        number of tiny reported issues. All of these have been in linux-next
        for a while with no reported issues"
      
      * tag 'staging-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: imu: st_lsm6dsx: fix FIFO_CTRL2 overwrite during watermark configuration
        iio: adc: ti_am335x_adc: fix fifo overrun recovery
        iio: sw-device: Fix config group initialization
        iio: magnetometer: ak8974: remove incorrect __exit markups
        iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
      53b4d591
    • Linus Torvalds's avatar
      Merge tag 'usb-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · e431e0e4
      Linus Torvalds authored
      Pull USB/PHY fixes from Greg KH:
       "Here are a number of small USB and PHY driver fixes for 4.11-rc4.
      
        Nothing major here, just an bunch of small fixes, and a handfull of
        good fixes from Johan for devices with crazy descriptors. There are a
        few new device ids in here as well.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
        usb: gadget: f_hid: fix: Don't access hidg->req without spinlock held
        usb: gadget: udc: remove pointer dereference after free
        usb: gadget: f_uvc: Sanity check wMaxPacketSize for SuperSpeed
        usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval
        usb: gadget: acm: fix endianness in notifications
        usb: dwc3: gadget: delay unmap of bounced requests
        USB: serial: qcserial: add Dell DW5811e
        usb: hub: Fix crash after failure to read BOS descriptor
        ACM gadget: fix endianness in notifications
        USB: usbtmc: fix probe error path
        USB: usbtmc: add missing endpoint sanity check
        USB: serial: option: add Quectel UC15, UC20, EC21, and EC25 modems
        usb: musb: fix possible spinlock deadlock
        usb: musb: dsps: fix iounmap in error and exit paths
        usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer
        usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk
        uwb: i1480-dfu: fix NULL-deref at probe
        uwb: hwa-rc: fix NULL-deref at probe
        USB: wusbcore: fix NULL-deref at probe
        USB: uss720: fix NULL-deref at probe
        ...
      e431e0e4