13 Sep, 2013

1 commit


11 Sep, 2013

1 commit

  • Pull battery/power supply driver updates from Anton Vorontsov:
    "New drivers:

    - APM X-Gene system reboot driver by Feng Kan and Loc Ho (APM).

    - Qualcomm MSM reboot/poweroff driver by Abhimanyu Kapur (Codeaurora).

    - Texas Instruments BQ24190 charger driver by Mark A. Greer (Animal
    Creek Technologies).

    - Texas Instruments TWL4030 MADC battery driver by Lukas Märdian and
    Marek Belisko (Golden Delicious Computers). The driver is used on
    Freerunner GTA04 phones.

    Highlighted fixes and improvements:

    - Suspend/wakeup logic improvements: power supply objects will block
    system suspend until all power supply events are processed. Thanks
    to Zoran Markovic (Linaro), Arve Hjonnevag and Todd Poynor (Google)"

    * tag 'for-v3.12' of git://git.infradead.org/battery-2.6:
    rx51_battery: Fix channel number when reading adc value
    power: Add twl4030_madc battery driver.
    bq24190_charger: Workaround SS definition problem on i386 builds
    power_supply: Prevent suspend until power supply events are processed
    vexpress-poweroff: Should depend on the required infrastructure
    twl4030-charger: Fix compiler warning with regulator_enable()
    rx51_battery: Replace hardcoded channels values.
    bq24190_charger: Add support for TI BQ24190 Battery Charger
    ab8500-charger: We print an unintended error message
    max8925_power: Fix missing of_node_put
    power_supply: Replace strict_strtol() with kstrtol()
    power: Add APM X-Gene system reboot driver
    power_supply: tosa_battery: Get rid of irq_to_gpio usage
    power supply: collie_battery: Convert to use dev_pm_ops
    power_supply: Make goldfish_battery depend on GOLDFISH || COMPILE_TEST
    power: reset: Add msm restart support
    MAINTAINERS: drivers/power: add entry for SmartReflex AVS drivers

    Linus Torvalds
     

31 Aug, 2013

2 commits

  • This issue was introduced in commit 8e2747f031bd "power: rx51_battery:
    Replace hardcoded channels values."

    Original code use channel as argument which was shifted by one in
    function. After mentioned commit argument is already shifted so we need to
    get index back.

    Signed-off-by: Marek Belisko
    Signed-off-by: Anton Vorontsov

    Marek BElisko
     
  • This driver is used and tested on gta04 phone. It's using twl4030_madc
    (similar to rx51 existing driver). Driver also implement charging and
    discharging calibration data so user can define ranges and level.

    Signed-off-by: Marek Belisko
    Signed-off-by: Lukas Märdian
    Signed-off-by: Anton Vorontsov

    Marek BElisko
     

29 Aug, 2013

1 commit

  • For __i386__ builds we have:

    arch/x86/include/uapi/asm/ptrace-abi.h:#define SS 16

    And in the driver:

    BQ24190_SYSFS_FIELD_RO(vbus_stat, SS, VBUS_STAT)

    That breaks the build like this:

    drivers/power/bq24190_charger.c:375:138: error: ‘BQ24190_REG_16’
    undeclared here (not in a function)
    drivers/power/bq24190_charger.c:375:162: error:
    ‘BQ24190_REG_16_THERM_STAT_MASK’ undeclared here (not in a function)
    drivers/power/bq24190_charger.c:375:203: error:
    ‘BQ24190_REG_16_THERM_STAT_SHIFT’ undeclared here (not
    in a function)

    With this commit we workaround the problem by undefining 'SS'.

    Reported-by: kbuild test robot
    Signed-off-by: Anton Vorontsov

    Anton Vorontsov
     

28 Aug, 2013

7 commits

  • This patch, originally authored by Arve Hjonnevag and Todd Poynor,
    prevents the system from entering suspend mode until the power supply
    plug, unplug, or any other change of state event is fully processed. This
    guarantees that the screen lights up and displays the battery charging
    state. The implementation uses the power supply wakeup_source object.

    Cc: David Woodhouse
    Cc: Arve Hjonnevag
    Cc: Todd Poynor
    Cc: John Stultz
    Signed-off-by: Zoran Markovic
    Signed-off-by: Anton Vorontsov

    Zoran Markovic
     
  • ARM Versatile Express reset driver requires platform-specific config
    infrastructure to be present in the kernel. When VEXPRESS_CONFIG is not
    selected, the build will fail like this:

    drivers/built-in.o: In function `vexpress_reset_do.clone.0':
    iio-trig-interrupt.c:(.text+0x1aff38): undefined reference to `__vexpress_config_func_get'
    iio-trig-interrupt.c:(.text+0x1aff4c): undefined reference to `vexpress_config_write'

    Added required dependency to the Kconfig entry.

    Signed-off-by: Pawel Moll
    Signed-off-by: Anton Vorontsov

    Pawel Moll
     
  • The return value of regulator_enable need to be checked. This patch fixes
    the following warning:
    drivers/power/twl4030_charger.c: In function ‘twl4030_charger_enable_usb’:
    drivers/power/twl4030_charger.c:192:20: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Anton Vorontsov

    Peter Ujfalusi
     
  • In twl4030_madc header exist defines for fixed channels + add rx51
    specific channels and replace all hardcoded channels values.

    Signed-off-by: Marek Belisko
    Signed-off-by: Anton Vorontsov

    Marek BElisko
     
  • Add driver support for the Texas Instruments BQ24190 battery charger.
    Some of the information provided by the device is about the charger and
    other information is about the battery so create two power_supply objects
    (one for each) and provide the appropriate information for each one.

    The device has many fields that go beyond what is reasonable to report or
    modify using the existing 'POWER_SUPPLY_PROP_*' properties so the driver
    exports the register fields via sysfs. They are prefixed by 'f_' (for
    'field') to make it easier to distinguish between a register field and a
    "normal" sysfs file exported by the power_supply infrastructure.

    Signed-off-by: Mark A. Greer
    Signed-off-by: Anton Vorontsov

    Mark A. Greer
     
  • There is a missing break statement here, so we print an error message that
    the USB type is invalid. The original code still works fine though except
    for the error message.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Anton Vorontsov

    Dan Carpenter
     
  • Decrease np device_node refcount after we are done with the node.

    Signed-off-by: Libo Chen
    Signed-off-by: Anton Vorontsov

    Libo Chen
     

20 Aug, 2013

1 commit


10 Aug, 2013

6 commits

  • The usage of strict_strtol() is not preferred, because strict_strtol() is
    obsolete. Thus, kstrtol() should be used.

    Signed-off-by: Jingoo Han
    Signed-off-by: Anton Vorontsov

    Jingoo Han
     
  • Add APM X-Gene SoC system reboot driver. This driver handles only system
    reboot. System shutdown is board specific and can be handled by board
    driver or GPIO based shutdown driver.

    Signed-off-by: Loc Ho
    Signed-off-by: Feng Kan
    Signed-off-by: Kumar Sankaran
    Signed-off-by: Anton Vorontsov

    Loc Ho
     
  • This commit fixes the following error:

    linux/drivers/power/tosa_battery.c:153:2: error: implicit declaration of
    function 'irq_to_gpio' [-Werror=implicit-function-declaration]

    Since 9d08d5d77a355510c2f5657c86b0a4b25acfe72c, irq_to_gpio() is no longer
    available but still in use by collie_battery.c. As it's just for a debug
    message, just get rid of this call.

    Signed-off-by: Andrea Adami
    Signed-off-by: Anton Vorontsov

    Andrea Adami
     
  • This commit fixes the following warnings:

    linux/drivers/power/collie_battery.c:372:2: warning: initialization from
    incompatible pointer type [enabled by default]
    linux/drivers/power/collie_battery.c:372:2: warning: (near initialization
    for 'collie_bat_driver.suspend') [enabled by default]

    Referencess:

    MFD: ucb1x00-core: convert to use dev_pm_ops
    https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=5a09b7120a965a7d7e8494d0ed509135bbce0118

    MFD: mcp-core: remove legacy driver suspend/resume methods
    https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=cf4abfcc0df2985ff6061f74e63b8353f2a1d0bc

    Signed-off-by: Andrea Adami
    Signed-off-by: Anton Vorontsov

    Andrea Adami
     
  • Nearly all the other goldfish peripherals (mtd, keyboard, etc) have a
    dependency on the main platform's GOLDFISH Kconfig item, but this one got
    skipped. Even with consistency as a justification, there was initial
    resistance[1] from some people to adding it however, as they wanted the
    extra compile coverage.

    Now, with CONFIG_COMPILE_TEST, we have the middle ground that will give
    people the coverage who want it, and let those who don't want it to skip
    ever seeing the option presented.

    [1] https://lkml.org/lkml/2013/2/27/333

    Cc: David Woodhouse
    Cc: Jiri Slaby
    Cc: Greg Kroah-Hartman
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Anton Vorontsov

    Paul Gortmaker
     
  • Add support for restart and poweroff functionality present on MSM chipsets
    with the MPM2 ps-hold hardware.

    Signed-off-by: Abhimanyu Kapur
    Tested-by: Ivan T. Ivanov
    Reviewed-by: Stephen Boyd
    Signed-off-by: Anton Vorontsov

    Abhimanyu Kapur
     

11 Jul, 2013

1 commit

  • Pull battery subsystem update from Anton Vorontsov:
    "Nothing exciting this time, just assorted fixes and cleanups"

    * tag 'for-v3.11' of git://git.infradead.org/battery-2.6: (25 commits)
    charger-manager: Fix regulator_get() return check
    charger-manager: Fix a bug when it unregisters notifier block of extcon
    tps65090-charger: Add dt node to power_supply
    sbs-battery: Add dt to power_supply struct
    power_supply: Add of_node_put to fix refcount
    power_supply: Move of_node out of the #ifdef CONFIG_OF
    power/reset: Make the vexpress driver optional on arm and arm64
    charger-manager: Add missing newlines, fix a couple of typos, add pr_fmt
    tps65090-charger: Fix AC detect
    MAINTAINERS: Update email address for Anton Vorontsov
    charger-manager: Ensure event is not used as format string
    power_supply: Replace strict_strtoul() with kstrtoul()
    generic-adc-battery: Fix checking if none of the channels are supported
    power: Use platform_{get,set}_drvdata()
    pm2301_charger: Return error if create_singlethread_workqueue fails
    pm2301_charger: Fix NULL pointer dereference
    lp8727_charger: Support the device tree feature
    twl4030_charger: Remove unnecessary platform_set_drvdata()
    rx51_battery: Remove unnecessary platform_set_drvdata()
    jz4740-battery: Remove unnecessary platform_set_drvdata()
    ...

    Linus Torvalds
     

10 Jul, 2013

1 commit

  • Preparing to move the parsing of reboot= to generic kernel code forces
    the change in reboot_mode handling to use the enum.

    [akpm@linux-foundation.org: fix arch/arm/mach-socfpga/socfpga.c]
    Signed-off-by: Robin Holt
    Cc: Russell King
    Cc: Russ Anderson
    Cc: Robin Holt
    Cc: H. Peter Anvin
    Cc: Guan Xuetao
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     

29 Jun, 2013

5 commits

  • This patch fixes return value checking of regulator_get() in
    charger-manager driver. The API, regulator_get(), returns ERR_PTR() when
    it fails to get regulator with given name, not NULL.

    Signed-off-by: Jonghwa Lee
    Signed-off-by: Myungjoo Ham
    Acked-by: Chanwoo Choi
    Signed-off-by: Anton Vorontsov

    Jonghwa Lee
     
  • This patch prevents NULL pointer error cauesed by unregistering
    unregistered exton notifier block. At the probing time of charger manager,
    it tries to remove extcon notifier block when it fails to initialize them.
    It has to be applied for only registered one. Otherwise, it'd make kernel
    panic. To make it work right, it checks extcon_specific_cable_nb's
    extcon_dev node. If extcon cable notifier block was registered
    successfully, it has proper extcon_dev pointer if not so it has NULL
    pointer.

    Signed-off-by: Jonghwa Lee
    Signed-off-by: Myungjoo Ham
    Acked-by: Chanwoo Choi
    Signed-off-by: Anton Vorontsov

    Jonghwa Lee
     
  • Passing in the dt node for this charger enables the logic in the core to
    lookup this device, to see if it is supplying another power_supply,
    through dt.

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     
  • By passing in the dt node of this device, we enable the logic for linking
    power_supplies together from dt. This is specified by adding a
    "power-supplies" property with a phandle to the charger for a given
    supply.

    Enable this logic now for the sbs-battery driver.

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     
  • of_parse_phandle increments the refcount for a dt node before returning
    it. Add of_node_put where needed to properly decrement the refcount when
    we are done using a given node.

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     

22 Jun, 2013

1 commit


11 Jun, 2013

7 commits

  • Use of of devm_* API for resource allocation provides benefits such
    as auto handling of resource free. This reduces possibility have
    memory leaks in case of wrong error handling. All direct release
    calls should be removed to avoid races.

    Reported-by: Grygorii Strashko
    Signed-off-by: Andrii Tseglytskyi
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • SmartReflex driver interface is natively divided to two parts:

    - external SmartReflex interface
    - interface between SmartReflex driver and SmartReflex Class

    Functions which belong to AVS class interface can use
    struct omap_sr* instead of struct voltatedomain*, to provide a
    direct connection between SR driver and SR class. This allows
    us to optimize and not do additional lookups where none is
    required.

    sr_enable() and sr_disable() are interface functions between
    SR driver and SR class. They are typically used by Class driver
    to enable/disable SmartReflex hardware module.
    Now they take struct omap_sr* as input parameter.

    Signed-off-by: Andrii Tseglytskyi
    Acked-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • SmartReflex driver interface is natively divided to two parts:

    - external SmartReflex interface
    - interface between SmartReflex driver and SmartReflex Class

    Functions which belong to AVS class interface can use
    struct omap_sr* instead of struct voltatedomain*, to provide a
    direct connection between SR driver and SR class. This allows
    us to optimize and not do additional lookups where none is
    required.

    sr_configure_minmax() is interface function between SR driver
    and SR class. It is typically used by Class driver to
    configure MINMAXAVG module inside SmartReflex module.
    Now it takes struct omap_sr* as input parameter.

    Signed-off-by: Andrii Tseglytskyi
    Acked-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • SmartReflex driver interface is natively divided to two parts:

    - external SmartReflex interface
    - interface between SmartReflex driver and SmartReflex Class

    Functions which belong to AVS class interface can use
    struct omap_sr* instead of struct voltatedomain*, to provide a
    direct connection between SR driver and SR class. This allows
    us to optimize and not do additional lookups where none is
    required.

    sr_disable_errgen() and sr_configure_errgen() are interface
    functions between SR driver and SR class. They are typically
    used by Class driver to configure error generator module during
    SmartReflex enable/disable sequence.
    Now they take struct omap_sr* as input parameter.

    Signed-off-by: Andrii Tseglytskyi
    Acked-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • DRIVER_NAME was undefined for SmartReflex. Now it is
    defined with valid value "smartreflex". It is needed
    to define proper value for:
    MODULE_ALIAS("platform:" DRIVER_NAME);

    Signed-off-by: Andrii Tseglytskyi
    Acked-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • Runtime PM should be disabled for device on driver remove,
    otherwise runtime PM will be not balanced, and this will cause
    an error message, on next driver probe.

    Signed-off-by: Andrii Tseglytskyi
    Acked-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Andrii Tseglytskyi
     
  • vpboundsintr_en is available inside the IP block as an re-sycned
    version and one which is not. Due to this, there is an 1 sysclk
    cycle window where the SR_SInterruptz signal could be asserted low.
    IF, intr_en is cleared on the exact same cycle as the irqclr, an
    additional pulse is generated which indicates for VP that
    an additional adjustment of voltage is required.

    This results in VP doing two voltage adjustments for the SRERR
    (based on configuration, upto 4 steps), instead of the needed
    1 step.
    Due to the unexpected pulse from AVS which breaks the AVS-VP
    communication protocol, VP also ends up in a stuck condition by
    entering a state where VP module remains non-responsive
    to any futher AVS adjustment events. This creates the symptom
    called "TRANXDONE Timeout" scenario.

    By disabling errgen prior to disable of intr_en, this situation
    can be avoided.

    Signed-off-by: Vincent Bour
    Signed-off-by: Leonardo Affortunati
    Signed-off-by: Nishanth Menon
    Signed-off-by: Andrii.Tseglytskyi
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     

10 Jun, 2013

2 commits

  • Make sure that dev_ calls are newline terminated.
    Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt to prefix
    all pr_ calls with "charger-manager: "

    Fix a couple of typos.
    Fix formats with terminating n that should be \n.
    Coalesce formats for easier grep.
    Align arguments to open parenthesis for these dev_ calls.
    Add missing spaces after coalescing multiple string segments.

    Signed-off-by: Joe Perches
    Acked-by: Kees Cook
    Signed-off-by: Anton Vorontsov

    Joe Perches
     
  • The VACG interrupt was not being enabled. Thus, interrupts were never
    generated when AC status changes. In addition, interrupts were never
    cleared after taking and processing the interrupt.

    Added the register offset for the INTR_MASK register, since this is needed
    to unmask the VACG interrupt.

    Enabled the VACG interrupt in tps65090_config_charger().

    Cleared interrupts after processing, in tps65090_charger_isr().

    Also removed unused variable "enable" in tps65090_enable_charging(), and
    fixed a typo in one of the dev_err() prints.

    Signed-off-by: Andrew Chew
    Tested-by: Rhyland Klein
    Acked-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Andrew Chew
     

07 Jun, 2013

4 commits