02 May, 2017

2 commits

  • Pull ACPI updates from Rafael Wysocki:
    "These are some device enumeration code changes, updates of the AC and
    battery drivers to help them avoid attaching to devices that cannot be
    handled by them, new operation region driver for the Intel CHT Whiskey
    Cove PMIC, new sysfs entries for CPPC performance capabilities, a new
    _REV quirk blacklist entry and a couple of assorted minor fixes and
    cleanups.

    Specifics:

    - Update the core device enumeration code to make it more internally
    consistent and robust and drop the force_remove sysfs attribute
    that could be used to tell it to ignore errors on device
    hot-removal which was dangerous in general and no real and still
    relevant use cases for it could be found (Rafael Wysocki, Michal
    Hocko).

    - Make the core device enumeration code use _PXM to associate
    platform devices created by it with specific NUMA nodes (Shanker
    Donthineni).

    - Extend the CPPC library by adding more sysfs entries for
    performance capabilities to it and making it use the lowest
    nonlinear performance parameter (Prashanth Prakash).

    - Make the CPU online more consistent with CPU initialization in the
    ACPI processor driver (Prashanth Prakash).

    - Update the AC and battery drivers to help them avoid attaching to
    devices that cannot be handled by them and update the
    axp288_charger power supply driver to work correctly on ACPI
    systems without the INT3496 device (Hans de Goede).

    - Add an ACPI operation region driver for the Intel CHT Whiskey Cove
    PMIC and update the xpower operation region driver to work without
    IIO which isn't really necessary for it to work (Hans de Goede).

    - Add a new entry for Dell Inspiron 7537 to the _REV quirk blacklist
    (Kai Heng Feng).

    - Make the code in the ACPI video driver easier to follow by adding
    symbols and comments to it (Dmitry Frank).

    - Update ACPI documentation and drop a function that has no users
    from the tables-handling code (Cao jin, Baoquan He)"

    * tag 'acpi-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / PMIC: Stop xpower OPRegion handler relying on IIO
    ACPI / PMIC: Add opregion driver for Intel CHT Whiskey Cove PMIC
    ACPI / scan: Avoid enumerating devices more than once
    ACPI / scan: Apply default enumeration to devices with ACPI drivers
    power: supply: axp288_charger: Only wait for INT3496 device if present
    ACPI / AC: Add a blacklist with PMIC ACPI HIDs with a native charger driver
    ACPI / battery: Add a blacklist with PMIC ACPI HIDs with a native battery driver
    ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors
    ACPI / utils: Add new acpi_dev_present helper
    ACPI / video: add comments about subtle cases
    ACPI / video: get rid of magic numbers and use enum instead
    ACPI / doc: linuxized-acpica.txt: fix typos
    ACPI / blacklist: add _REV quirk for Dell Inspiron 7537
    ACPI / tables: Drop acpi_parse_entries() which is not used
    ACPI / CPPC: add sysfs entries for CPPC perf capabilities
    ACPI / CPPC: Read lowest nonlinear perf in cppc_get_perf_caps()
    ACPI / platform: Update platform device NUMA node based on _PXM method
    ACPI / Processor: Drop setup_max_cpus check from acpi_processor_add()
    ACPI / scan: Drop support for force_remove

    Linus Torvalds
     
  • Pull power management updates from Rafael Wysocki:
    "This time the majority of changes go to the cpufreq subsystem (and to
    the intel_pstate driver in particular) and there are some updates in
    the generic power domains framework, cpuidle, tools and a couple of
    other places.

    One thing worth mentioning is that the intel_pstate's sysfs interface
    has been reworked to be more consistent with the general expectations
    of the cpufreq core and less confusing, hopefully for the better.
    Also, we have a new cpufreq driver for Tegra186 and new hardware
    support in intel_pstata and the Mediatek cpufreq driver.

    Apart from that, the AnalyzeSuspend utility for system suspend
    profiling gets a companion called AnalyzeBoot for the analogous
    profiling of system boot and they both go into one place under
    tools/power/pm-graph/.

    The rest is mostly fixes, cleanups and code reorganization.

    Specifics:

    - Rework the intel_pstate driver's sysfs interface to make it more
    straightforward and more intuitive (Rafael Wysocki).

    - Make intel_pstate support all processors which advertise HWP
    (hardware-managed P-states) to the kernel in all operation modes
    and make it use the load-based P-state selection algorithm on a
    wider range of systems in the active mode (Rafael Wysocki).

    - Add cpufreq driver for Tegra186 (Mikko Perttunen).

    - Add support for Gemini Lake SoCs to intel_pstate (David Box).

    - Add support for MT8176 and MT817x to the Mediatek cpufreq driver
    and clean up that driver a bit (Daniel Kurtz).

    - Clean up intel_pstate and optimize it slightly (Rafael Wysocki).

    - Update the schedutil cpufreq governor, mostly to fix a couple of
    issues with it related to specific workloads, and rework its sysfs
    tunable and initialization a bit (Rafael Wysocki, Viresh Kumar).

    - Fix minor issues in the imx6q, dbx500 and qoriq cpufreq drivers
    (Christophe Jaillet, Irina Tirdea, Leonard Crestez, Viresh Kumar,
    YuanTian Tang).

    - Add file patterns for cpufreq DT bindings to MAINTAINERS (Geert
    Uytterhoeven).

    - Add support for "always on" power domains to the genpd (generic
    power domains) framework and clean up that code somewhat (Ulf
    Hansson, Lina Iyer, Viresh Kumar).

    - Fix minor issues in the powernv cpuidle driver and clean it up
    (Anton Blanchard, Gautham Shenoy).

    - Move the AnalyzeSuspend utility under tools/power/pm-graph/ and add
    an analogous boot-profiling utility called AnalyzeBoot to it (Todd
    Brandt).

    - Add rk3328 support to the rockchip-io AVS (Adaptive Voltage
    Scaling) driver (David Wu).

    - Fix minor issues in the cpuidle core, the intel_pstate_tracer
    utility, the devfreq framework and the PM core documentation
    (Chanwoo Choi, Doug Smythies, Johan Hovold, Marcin Nowakowski)"

    * tag 'pm-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (56 commits)
    PM / runtime: Document autosuspend-helper side effects
    PM / runtime: Fix autosuspend documentation
    tools: power: pm-graph: Package makefile and man pages
    tools: power: pm-graph: AnalyzeBoot v2.0
    tools: power: pm-graph: AnalyzeSuspend v4.6
    cpufreq: Add Tegra186 cpufreq driver
    cpufreq: imx6q: Fix error handling code
    cpufreq: imx6q: Set max suspend_freq to avoid changes during suspend
    cpufreq: imx6q: Fix handling EPROBE_DEFER from regulator
    cpuidle: powernv: Avoid a branch in the core snooze_loop() loop
    cpuidle: powernv: Don't continually set thread priority in snooze_loop()
    cpuidle: powernv: Don't bounce between low and very low thread priority
    cpuidle: cpuidle-cps: remove unused variable
    tools/power/x86/intel_pstate_tracer: Adjust directory ownership
    cpufreq: schedutil: Use policy-dependent transition delays
    cpufreq: schedutil: Reduce frequencies slower
    PM / devfreq: Move struct devfreq_governor to devfreq directory
    PM / Domains: Ignore domain-idle-states that are not compatible
    cpufreq: intel_pstate: Add support for Gemini Lake
    powernv-cpuidle: Validate DT property array size
    ...

    Linus Torvalds
     

20 Apr, 2017

1 commit

  • On some devices with an axp288 pmic setting vbus path based on the
    id-pin is handled by an ACPI _AIE interrupt on the gpio and the
    INT3496 device is disabled.

    Instead of returning -EPROBE_DEFER on these devices waiting for the
    never to show up INT3496 device, check for its presence and only
    request and monitor the matching extcon if the device is there,
    otherwise let the firmware handle the vbus path control.

    Signed-off-by: Hans de Goede
    Acked-by: Sebastian Reichel
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

14 Apr, 2017

24 commits

  • When I submitted the extcon handling I had a patch pending for the
    extcon sub-system for extcon_register_notifier to take -1 as cable id
    for listening for all type cable events on an extcon with a single
    notifier.

    In the end it was decided to instead add a new
    extcon_register_notifier_all function for this, switch to using this.

    Signed-off-by: Hans de Goede
    Acked-by: Liam Breck
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • On chip reset, polling loop used udelay(10) which is too short
    to be useful. Instead, use usleep_range(100, 200).

    Signed-off-by: Liam Breck
    Acked-by: Tony Lindgren
    Acked-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • On pm_runtime_get() failure, always emit an error message.
    Prevent unbalanced pm_runtime_get by calling:
    pm_runtime_put_noidle() in irq handler
    pm_runtime_put_sync() on any probe() failure
    Rename probe() out labels instead of renumbering them.

    Fixes: 13d6fa8447fa ("power: bq24190_charger: Use PM runtime autosuspend")
    Signed-off-by: Liam Breck
    Acked-by: Tony Lindgren
    Reviewed-by: Hans de Goede
    Acked-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • Polishing and fixes for initial extcon patch.

    Fixes: 4db249b6f3b4 ("power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost")
    Cc: Tony Lindgren
    Signed-off-by: Liam Breck
    Acked-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • If the charger is unplugged before the battery is full we may
    see an over/under voltage fault. Ignore this rather then emitting
    a message or uevent.

    This fixes messages like these getting logged on charger unplug + replug:
    bq24190-charger 15-006b: Fault: boost 0, charge 1, battery 0, ntc 0
    bq24190-charger 15-006b: Fault: boost 0, charge 0, battery 0, ntc 0

    Cc: Tony Lindgren
    Cc: Hans de Goede
    Signed-off-by: Liam Breck
    Acked-by: Tony Lindgren
    Reviewed-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • This adds a new driver for the LEGO MINDSTORMS EV3 battery. The EV3 is
    an embedded ARM device that can use 6 AA batteries or a special rechargeable
    Li-ion battery pack. The rechargeable battery pack presses a special key
    switch in the battery compartment to indicate that it is present.

    The EV3 is only capable of monitoring battery voltage and current. The
    charging circuit is built into the rechargeable battery pack and there is
    no way to communicate with is, so we can't provide any information about
    charging status.

    When not using the rechargeable battery pack, it is most common to use
    alkaline batteries to power the device, but it is also common for people to
    use rechargeable NiMH batteries. Since there is not a way to automatically
    differentiate between these, the technology property is made writable.

    Signed-off-by: David Lechner
    Signed-off-by: Sebastian Reichel

    David Lechner
     
  • Equivalent information can be nowadays obtained using function tracer.

    Signed-off-by: Enric Balletbo i Serra
    Signed-off-by: Sebastian Reichel

    Enric Balletbo i Serra
     
  • The driver doesn't have a struct of_device_id table but supported devices
    are registered via Device Trees. This is working on the assumption that a
    I2C device registered via OF will always match a legacy I2C device ID and
    that the MODALIAS reported will always be of the form i2c:.

    But this could change in the future so the correct approach is to have an
    OF device ID table if the devices are registered via OF.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Sebastian Reichel

    Javier Martinez Canillas
     
  • Some trivial improvements on the returning value of the
    functions:

    - remove unnecessary goto labels that just return, return
    immediately, instead.

    - do not initialize when not needed.

    - return the value from the calling function that fails instead
    of politically choosing -EINVAL.

    Signed-off-by: Andi Shyti
    Signed-off-by: Sebastian Reichel

    Andi Shyti
     
  • val might become 7 in which case stime[7] (array of length 7) would be
    accessed during the scnprintf call later and that will cause issues.
    Obviously, string concatenation is not intended here so just a comma needs
    to be added to fix the issue.

    Fixes: 98a276649358 ("power_supply: Add new lp8788 charger driver")
    Signed-off-by: Giedrius Statkevičius
    Acked-by: Milo Kim
    Signed-off-by: Sebastian Reichel

    Giedrius Statkevičius
     
  • The custom CPCAP PMIC used on Motorola phones such as Droid 4 has a
    USB battery charger. It can optionally also have a companion chip that
    is used for wireless charging.

    The charger on CPCAP also can feed VBUS for the USB host mode. This
    can be handled by the existing kernel phy_companion interface.

    Cc: devicetree@vger.kernel.org
    Cc: Marcel Partap
    Cc: Michael Scott
    Signed-off-by: Tony Lindgren
    Acked-by: Rob Herring
    Signed-off-by: Sebastian Reichel

    Tony Lindgren
     
  • Add support for monitoring an extcon device with USB SDP/CDP/DCP and HOST
    cables and adjust ilimit and enable/disable the 5V boost converter
    accordingly. This is necessary on systems where the PSEL pin is hardwired
    high and ILIM needs to be set by software based on the detected charger
    type, as well as on systems where the 5V boost converter is used, as
    that always needs to be enabled from software.

    Cc: Liam Breck
    Cc: Tony Lindgren
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • The bq24192 and bq24192i are mostly identical to the bq24190, TI even
    published a single datasheet for all 3 of them. The difference
    between the bq24190 and bq24192[i] is the way charger-type detection
    is done, the bq24190 is to be directly connected to the USB a/b lines,
    where as the the bq24192[i] has a gpio which should be driven high/low
    externally depending on the type of charger connected, from a register
    level access pov there is no difference.

    The differences between the bq24192 and bq24192i are:
    1) Lower default charge rate on the bq24192i
    2) Pre-charge-current can be max 640 mA on the bq24192i

    On x86/ACPI systems the code which instantiates the i2c client may not
    know the exact variant being used, so instead of coding the model-id
    in the i2c_id struct and bailing if it does not match, check the reported
    model-id matches one of the supported variants.

    This commit only adds support for the bq24192i as I don't
    have a bq24192 to test with, adding support for the bq24192 should
    be as simple as also accepting its model-id in the model-id test.

    Cc: Liam Breck
    Cc: Tony Lindgren
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • The i2c-core already maps of irqs before calling the driver's probe
    function and there are no in tree users of
    bq24190_platform_data->gpio_int.

    Remove the redundant custom irq-mapping code and just use client->irq.

    Cc: Liam Breck
    Cc: Tony Lindgren
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • Without CONFIG_PM, we get a harmless warning:

    drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
    drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]

    To avoid the warning, we can mark all four PM functions as __maybe_unused,
    which also lets us remove the incorrect #ifdef.

    Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
    Signed-off-by: Arnd Bergmann
    Acked-by: Tony Lindgren
    Acked-by: Liam Breck
    Signed-off-by: Sebastian Reichel

    Arnd Bergmann
     
  • Signed-off-by: Daniel Perez
    Signed-off-by: Sebastian Reichel

    Daniel Perez
     
  • This patch fixes 4 checkpatch.pl errors on lines 433 to 436:
    ERROR: code indent should use tabs where possible

    Signed-off-by: Munir Contractor
    Signed-off-by: Sebastian Reichel

    Munir Contractor
     
  • Since index is always 0, replace gpiod_get_index() by gpiod_get().

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sebastian Reichel

    Andy Shevchenko
     
  • Even if bus is not hot-pluggable, the devices can be unbound from the
    driver via sysfs, so we should not be using __exit annotations on
    remove() methods. The only exception is drivers registered with
    platform_driver_probe() which specifically disables sysfs bind/unbind
    attributes.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sebastian Reichel

    Dmitry Torokhov
     
  • The Gemini (SL3516) SoC has a special power controller block
    that only deal with shutting down the system.

    If you do not register a driver and activate the block, the
    power button on the systems utilizing this SoC will do an
    uncontrolled power cut, which is why it is important to have
    a special poweroff driver.

    The most basic functionality is to just shut down the system
    by writing a special bit in the control register after the
    system has reached pm_poweroff.

    It also handles the poweroff from a button or other sources:

    When the poweroff button is pressed, or a signal is sent to
    poweroff from an infrared remote control, or when the RTC
    fires a special alarm (!) the system emits an interrupt.
    At this point, Linux must acknowledge the interrupt and
    proceed to do an orderly shutdown of the system.

    After adding this driver, pressing the poweroff button gives
    this dmesg:

    root@gemini:/
    root@gemini:/ gemini-poweroff 4b000000.power-controller:
    poweroff button pressed

    calling shutdown scripts..
    setting /dev/rtc0 from system time
    unmounting file systems...
    umount: tmpfs busy - remounted read-only
    umount: can't unmount /: Invalid argument
    The system is going down NOW!
    Sent SIGTERM to all processes
    Sent SIGKILL to all processes
    Requesting system poweroff
    uhci_hcd 0000:00:09.1: HCRESET not completed yet!
    uhci_hcd 0000:00:09.0: HCRESET not completed yet!
    reboot: Power down
    gemini-poweroff 4b000000.power-controller: Gemini power off

    Cc: Janos Laube
    Cc: Paulius Zaleckas
    Cc: Hans Ulli Kroll
    Cc: Florian Fainelli
    Cc: linux-pm@vger.kernel.org
    Cc: Sebastian Reichel
    Signed-off-by: Linus Walleij
    Signed-off-by: Sebastian Reichel

    Linus Walleij
     
  • The driver doesn't have a struct of_device_id table but supported devices
    are registered via Device Trees. This is working on the assumption that a
    I2C device registered via OF will always match a legacy I2C device ID and
    that the MODALIAS reported will always be of the form i2c:.

    But this could change in the future so the correct approach is to have an
    OF device ID table if the devices are registered via OF.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Sebastian Reichel

    Javier Martinez Canillas
     
  • Make the syscon-poweroff driver accept value and mask instead of
    just value.

    Prior to this patch, the property name for the value was 'mask'. If
    only the mask property is defined on a node, maintain compatibility
    by using it as the value.

    Signed-off-by: Guy Shapiro
    Acked-by: Rob Herring
    Signed-off-by: Sebastian Reichel

    Guy Shapiro
     
  • We can get quite a few interrupts when the battery is trickle charging.
    Let's enable PM runtime autosuspend to avoid constantly toggling device
    driver PM runtime state.

    Let's use a 600 ms timeout as that's how long the USB chager detection
    might take.

    Acked-by: Mark Greer
    Acked-by: Liam Breck
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Tony Lindgren
     
  • Some SoCs like omap3 can configure GPIO irqs to use Linux generic
    dedicated wakeirq support. If the dedicated wakeirq is configured,
    the SoC will use a always-on interrupt controller to produce wake-up
    events.

    If bq24190 is configured for dedicated wakeirq, we need to check the
    interrupt status on PM runtime resume. This is because the Linux
    generic wakeirq will call pm_runtime_resume() on the device on a
    wakeirq. And as the bq24190 interrupt is falling edge sensitive
    and only active for 250 us, there will be no device interrupt seen
    by the runtime SoC IRQ controller.

    Note that this can cause spurious interrupts on omap3 devices with
    bq24190 connected to gpio banks 2 - 5 as there's a glitch on those
    pins waking from off mode as listed in "Advisory 1.45". Devices
    with this issue should not configure the optional wakeirq interrupt
    in the dts file.

    Acked-by: Mark Greer
    Acked-by: Liam Breck
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Tony Lindgren
     

13 Mar, 2017

1 commit


28 Feb, 2017

1 commit

  • Fix typos and add the following to the scripts/spelling.txt:

    intialization||initialization

    The "inintialization" in drivers/acpi/spcr.c is a different pattern but
    I fixed it as well in this commit.

    Link: http://lkml.kernel.org/r/1481573103-11329-16-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

30 Jan, 2017

3 commits

  • The X-Powers AXP20X and AXP22X PMICs expose the status of AC power
    supply.

    Moreover, the AXP20X can also expose the current current and voltage
    values of the AC power supply.

    This adds the driver which exposes the status of the AC power supply of
    the AXP20X and AXP22X PMICs.

    Signed-off-by: Quentin Schulz
    Acked-by: Jonathan Cameron
    Acked-by: Maxime Ripard
    [removed unused elements from struct axp20x_ac_power]
    Signed-off-by: Sebastian Reichel

    Quentin Schulz
     
  • The X-Powers AXP20X PMIC exposes the current current and voltage
    measures via an internal ADC.

    This adds the possibility to read IIO channels directly for processed
    values rather than reading the registers and computing the value.

    For backward compatibility purpose, if the IIO driver is not compiled,
    this driver will fall back on previous behaviour which is direct
    register readings.

    Signed-off-by: Quentin Schulz
    Acked-by: Maxime Ripard
    Acked-by: Jonathan Cameron
    Signed-off-by: Sebastian Reichel

    Quentin Schulz
     
  • If the driver is built as a module, I2C module alias information is not
    filled so the module won't be autoloaded. Export the I2C and OF devices
    ID to the module by using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias
    alias: i2c:max14656
    alias: of:N*T*Cmaxim,max14656C*
    alias: of:N*T*Cmaxim,max14656

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Sebastian Reichel

    Javier Martinez Canillas
     

21 Jan, 2017

1 commit


20 Jan, 2017

7 commits

  • Add breathing room in probe() out* section.

    Signed-off-by: Liam Breck
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • Reading both fault and status registers and logging any fault should
    take priority over handling status register update.

    Fix by moving the status handling to later in interrupt routine.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • Caching the fault register after a single I2C read may not keep an accurate
    value.

    Fix by doing two reads in irq_handle_thread() and using the cached value
    elsewhere. If a safety timer fault later clears itself, we apparently don't get
    an interrupt (INT), however other interrupts would refresh the register cache.

    From the data sheet: "When a fault occurs, the charger device sends out INT
    and keeps the fault state in REG09 until the host reads the fault register.
    Before the host reads REG09 and all the faults are cleared, the charger
    device would not send any INT upon new faults. In order to read the
    current fault status, the host has to read REG09 two times consecutively.
    The 1st reads fault register status from the last read [1] and the 2nd reads
    the current fault register status."

    [1] presumably a typo; should be "last fault"

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • We wrongly get uevents for bq24190-charger and bq24190-battery on every
    register change.

    Fix by checking the association with charger and battery before
    emitting uevent(s).

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • The device specific data is not fully initialized on
    request_threaded_irq(). This may cause a crash when the IRQ handler
    tries to reference them.

    Fix the issue by installing IRQ handler at the end of the probe.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • pm_resume() does a register_reset() which clears charger host mode.

    Fix by calling set_mode_host() after the reset.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck
     
  • The interrupt signal is TRIGGER_FALLING. This is is specified in the
    data sheet PIN FUNCTIONS: "The INT pin sends active low, 256us
    pulse to host to report charger device status and fault."

    Also the direction can be seen in the data sheet Figure 37 "BQ24190
    with D+/D- Detection and USB On-The-Go (OTG)" which shows a 10k
    pull-up resistor installed for the sample configurations.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Signed-off-by: Liam Breck
    Acked-by: Mark Greer
    Acked-by: Tony Lindgren
    Signed-off-by: Sebastian Reichel

    Liam Breck