26 Dec, 2016

1 commit

  • ktime_set(S,N) was required for the timespec storage type and is still
    useful for situations where a Seconds and Nanoseconds part of a time value
    needs to be converted. For anything where the Seconds argument is 0, this
    is pointless and can be replaced with a simple assignment.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra

    Thomas Gleixner
     

15 Dec, 2016

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:

    - new driver for Intel PIIX4

    - lots of module autoload fixes

    - misc fixes

    * tag 'for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
    power_supply: wm97xx_battery: use power_supply_get_drvdata
    wm8350_power: use permission-specific DEVICE_ATTR variants
    power: ipaq_micro_battery: fix alias
    power: supply: bq27xxx_battery: Fix register map for BQ27510 and BQ27520
    bq24190_charger: Fix PM runtime use for bq24190_battery_set_property
    power: supply: lp8788: remove an unneeded NULL check
    power: reset: zx-reboot: Fix module autoload
    power: reset: syscon-reboot-mode: Fix module autoload
    power: reset: at91-poweroff: Fix module autoload
    power: reset: at91-reset: Fix module autoload
    power: supply: axp288_fuel_gauge: Fix module autoload
    power: supply: max8997_charger: Fix module autoload
    power: supply: max17040: Change register transaction length from 8 bits to 16 bits
    power: supply: bq27xxx_battery: don't update poll_interval param if same
    power: supply: improve function-level documentation
    power: reset: Add Intel PIIX4 poweroff driver

    Linus Torvalds
     

24 Nov, 2016

5 commits

  • As the power supply framework provides a way to store and retrieve
    private supply data, use it.

    In the process, change the platform data for wm97xx_battery from a
    container of a single struct wm97xx_batt_pdata to the direct point to wm97xx_batt_pdata.

    Signed-off-by: Robert Jarzmik
    Acked-by: Charles Keepax
    Signed-off-by: Sebastian Reichel

    Robert Jarzmik
     
  • Use DEVICE_ATTR_RO for read only attributes. This simplifies the source
    code, improves readbility, and reduces the chance of inconsistencies.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @ro@
    declarer name DEVICE_ATTR;
    identifier x,x_show;
    @@

    DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL);

    @script:ocaml@
    x << ro.x;
    x_show << ro.x_show;
    @@

    if not (x^"_show" = x_show) then Coccilib.include_match false

    @@
    declarer name DEVICE_ATTR_RO;
    identifier ro.x,ro.x_show;
    @@

    - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL);
    + DEVICE_ATTR_RO(x);
    //

    Signed-off-by: Julia Lawall
    Acked-by: Charles Keepax
    Signed-off-by: Sebastian Reichel

    Julia Lawall
     
  • The alias for the ipaq_micro_battery driver is incorrect, fix it so the
    module can be auto-loaded.

    Signed-off-by: Russell King
    Signed-off-by: Sebastian Reichel

    Russell King
     
  • The BQ27510 and BQ27520 use a slightly different register map than the
    BQ27500, add a new type enum and add these gauges to it.

    Fixes: d74534c27775 ("power: bq27xxx_battery: Add support for additional bq27xxx family devices")
    Based-on-patch-by: Kenneth R. Crudup
    Signed-off-by: Andrew F. Davis
    Signed-off-by: Sebastian Reichel

    Andrew F. Davis
     
  • There's a typo, it should do pm_runtime_get_sync, not put.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Cc: Mark A. Greer
    Signed-off-by: Tony Lindgren
    Reviewed-by: Mark Greer
    Signed-off-by: Sebastian Reichel

    Tony Lindgren
     

21 Oct, 2016

1 commit

  • When testing SD hotplug automatically, I got bunch of
    useless log like this:

    [ 588.357838] mmc0: card 0007 removed
    [ 589.492664] rockchip-iodomain ff770000.syscon:io-domains: Setting to 3300000 done
    [ 589.500698] vccio_sd: ramp_delay not set
    [ 589.504817] rockchip-iodomain ff770000.syscon:io-domains: Setting to 3300000 done
    [ 589.669705] rockchip-iodomain ff770000.syscon:io-domains: Setting to 3300000 done
    [ 589.677593] vccio_sd: ramp_delay not set
    [ 589.681581] rockchip-iodomain ff770000.syscon:io-domains: Setting to 1800000 done
    [ 590.032820] dwmmc_rockchip ff0c0000.dwmmc: Successfully tuned phase to 140
    [ 590.039725] mmc0: new ultra high speed SDR50 SDHC card at address 0007
    [ 590.046641] mmcblk0: mmc0:0007 SD32G 29.3 GiB
    [ 590.052163] mmcblk0: p1

    Moreover the code is intent to print the 'uV' for debug but
    later print it using dev_info. It looks more like to me that
    it should be the real intention of the code. Anyway, let's
    mark this verbose log as debug message.

    Signed-off-by: Shawn Lin
    Reviewed-by: Heiko Stuebner
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Shawn Lin
     

19 Oct, 2016

10 commits

  • We checked that "pdata->chg_params" is non-NULL earlier in this function
    so when we add "i" to it, it's still non-NULL.

    Signed-off-by: Dan Carpenter
    Acked-by: Milo Kim
    Signed-off-by: Sebastian Reichel

    Dan Carpenter
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/power/reset/zx-reboot.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/power/reset/zx-reboot.ko | grep alias
    alias: of:N*T*Czte,sysctrlC*
    alias: of:N*T*Czte,sysctrl

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

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/power/reset/syscon-reboot-mode.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/power/reset/syscon-reboot-mode.ko | grep alias
    alias: of:N*T*Csyscon-reboot-modeC*
    alias: of:N*T*Csyscon-reboot-mode

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

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/power/reset/at91-poweroff.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/power/reset/at91-poweroff.ko | grep alias
    alias: of:N*T*Catmel,at91sam9x5-shdwcC*
    alias: of:N*T*Catmel,at91sam9x5-shdwc
    alias: of:N*T*Catmel,at91sam9rl-shdwcC*
    alias: of:N*T*Catmel,at91sam9rl-shdwc
    alias: of:N*T*Catmel,at91sam9260-shdwcC*
    alias: of:N*T*Catmel,at91sam9260-shdwc

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

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/power/reset/at91-reset.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/power/reset/at91-reset.ko | grep alias
    alias: of:N*T*Catmel,sama5d3-rstcC*
    alias: of:N*T*Catmel,sama5d3-rstc
    alias: of:N*T*Catmel,at91sam9g45-rstcC*
    alias: of:N*T*Catmel,at91sam9g45-rstc
    alias: of:N*T*Catmel,at91sam9260-rstcC*
    alias: of:N*T*Catmel,at91sam9260-rstc
    alias: platform:at91-sam9g45-reset
    alias: platform:at91-sam9260-reset

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

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

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

    After this patch:

    $ modinfo drivers/power/supply/axp288_fuel_gauge.ko | grep alias
    alias: platform:axp288_fuel_gauge

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

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

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

    After this patch:

    $ modinfo drivers/power/supply/max8997_charger.ko | grep alias
    alias: platform:max8997-battery

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

    Javier Martinez Canillas
     
  • According to the datasheet, MAX17040 has six 16-bit registers.
    Register reads and writes are only valid if all 16 bits are transferred.
    Any write command that is terminated early is ignored.
    So it's better to change register transacton length from 8 bits to 16 bits.

    Signed-off-by: Liu Xiang
    Signed-off-by: Sebastian Reichel

    Liu Xiang
     
  • To avoid canceling the delayed workqueue needlessly, and scheduling an
    immediate polling. Check if the new poll_interval value is different
    than the previous setting.

    Cc: Tony Lindgren
    Cc: Sebastian Reichel
    Signed-off-by: Matt Ranostay
    Signed-off-by: Sebastian Reichel

    Matt Ranostay
     
  • In drivers/power/supply/ab8500_fg.c, fix two typos and adjust the function
    name in two cases to correspond to the names of the defined functions.

    In drivers/power/supply/power_supply_core.c, change two variable names to
    the names of the corresponding parameters.

    Issue detected using Coccinelle (http://coccinelle.lip6.fr/)

    Signed-off-by: Julia Lawall
    Signed-off-by: Sebastian Reichel

    Julia Lawall
     

18 Oct, 2016

1 commit

  • Add a driver which allows powering off the system via an Intel PIIX4
    southbridge, by entering the PIIX4 SOff state. This is useful on the
    MIPS Malta development board, where it will power down the FPGA based
    board until its ON/NMI button is pressed, or the QEMU implementation of
    the MIPS Malta board where it will cause QEMU to exit.

    Signed-off-by: Paul Burton
    Cc: Sebastian Reichel
    Cc: Dmitry Eremin-Solenikov
    Cc: David Woodhouse
    Cc: linux-pm@vger.kernel.org
    Signed-off-by: Sebastian Reichel

    Paul Burton
     

07 Oct, 2016

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:
    - move power supply drivers to drivers/power/supply
    - unify location of power supply DT documentation
    - tps65217-charger: IRQ support
    - act8945a-charger: misc. cleanups & improvements
    - sbs-battery cleanup
    - fix users of deprecated create_singlethread_workqueue()
    - misc fixes.

    * tag 'for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (46 commits)
    power: supply: bq27xxx_battery: allow kernel poll_interval parameter runtime update
    power: supply: sbs-battery: Cleanup removal of chip->pdata
    power: reset: st: Remove obsolete platforms from dt doc
    power: reset: st-poweroff: Remove obsolete platforms.
    power: reset: zx-reboot: Unmap region obtained by of_iomap
    power: reset: xgene-reboot: Unmap region obtained by of_iomap
    power: supply: ab8500: cleanup with list_first_entry_or_null()
    power: reset: add in missing white space in error message text
    sbs-battery: make writes to ManufacturerAccess optional
    power: bq24257: Fix use of uninitialized pointer bq->charger
    power: supply: sbs-battery: simplify DT parsing
    power: supply: bq24735-charger: Request status GPIO with initial input setup
    power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect
    power: supply: act8945a_charger: Add max current property
    power: supply: act8945a_charger: Add capacity level property
    doc: bindings: power: act8945a-charger: Update properties.
    power: supply: act8945a_charger: Fix the power supply type
    power: supply: act8945a_charger: Add status change update support
    power: supply: act8945a_charger: Improve state handling
    power: supply: act8945a_charger: Remove "battery_temperature"
    ...

    Linus Torvalds
     

21 Sep, 2016

2 commits


20 Sep, 2016

7 commits


13 Sep, 2016

1 commit

  • Use a more common logging style.

    Miscellanea:

    o Use pr_warn
    o Coalesce formats adding missing spaces
    o Argument alignment
    o Remove unnecessary OOM messages as k.alloc does stack dumps

    Signed-off-by: Joe Perches
    Acked-by: Nishanth Menon
    [khilman: update shortlog]
    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Joe Perches
     

07 Sep, 2016

1 commit

  • After the change to use the gpio descriptor interface, we get a warning if
    -Wmaybe-uninitialized is added back to the build flags (it is currently
    disabled:

    drivers/power/supply/sbs-battery.c: In function 'sbs_probe':
    drivers/power/supply/sbs-battery.c:760:28: error: 'pdata' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    The problem is that if neither the DT properties nor a platform_data
    pointer are provided, the chip->pdata pointer gets set to an uninitialized
    value.

    Looking at the code some more, I found that the sbs_of_populate_pdata
    function is more complex than necessary and has confusing calling
    conventions of possibly returning a valid pointer, a NULL pointer
    or an ERR_PTR pointer (in addition to the uninitialized pointer).

    To fix all of that, this gets rid of the chip->pdata pointer and
    simply moves the two integers into the sbs_info structure. This
    makes it much clearer from reading sbs_probe() what the precedence
    of the three possible values are (pdata, DT, hardcoded defaults)
    and completely avoids the #ifdef CONFIG_OF guards as
    of_property_read_u32() gets replaced with a compile-time stub
    when that is disabled, and returns an error if passed a NULL of_node
    pointer.

    Signed-off-by: Arnd Bergmann
    Fixes: 3b5dd3a49496 ("power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect")
    Signed-off-by: Sebastian Reichel

    Arnd Bergmann
     

05 Sep, 2016

1 commit

  • This requests the status GPIO with initial input setup. It is required
    to read the GPIO status at probe time and thus correctly avoid sending
    I2C messages when AC is not plugged.

    When requesting the GPIO without initial input setup, it always reads 0
    which causes probe to fail as it assumes the charger is connected, sends
    I2C messages and fails.

    While at it, this switches the driver over to gpiod API.

    Signed-off-by: Paul Kocialkowski
    Signed-off-by: Sebastian Reichel

    Paul Kocialkowski
     

01 Sep, 2016

3 commits


31 Aug, 2016

5 commits