13 Oct, 2012

1 commit

  • Pull ACPI & Thermal updates from Len Brown:
    "The generic Linux thermal layer is gaining some new capabilities
    (generic cooling via cpufreq) and some new customers (ARM).

    Also, an ACPI EC bug fix plus a regression fix."

    * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (30 commits)
    tools/power/acpi/acpidump: remove duplicated include from acpidump.c
    ACPI idle, CPU hotplug: Fix NULL pointer dereference during hotplug
    cpuidle / ACPI: fix potential NULL pointer dereference
    ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
    ACPI: EC: Make the GPE storm threshold a module parameter
    thermal: Exynos: Fix NULL pointer dereference in exynos_unregister_thermal()
    Thermal: Fix bug on cpu_cooling, cooling device's id conflict problem.
    thermal: exynos: Use devm_* functions
    ARM: exynos: add thermal sensor driver platform data support
    thermal: exynos: register the tmu sensor with the kernel thermal layer
    thermal: exynos5: add exynos5250 thermal sensor driver support
    hwmon: exynos4: move thermal sensor driver to driver/thermal directory
    thermal: add generic cpufreq cooling implementation
    Fix a build error.
    thermal: Fix potential NULL pointer accesses
    thermal: add Renesas R-Car thermal sensor support
    thermal: fix potential out-of-bounds memory access
    Thermal: Introduce locking for cdev.thermal_instances list.
    Thermal: Unify the code for both active and passive cooling
    Thermal: Introduce simple arbitrator for setting device cooling state
    ...

    Linus Torvalds
     

09 Oct, 2012

3 commits


07 Oct, 2012

1 commit

  • Pull battery updates from Anton Vorontsov:
    "1. New drivers:
    - Marvell 88pm860x charger and battery drivers;
    - Texas Instruments LP8788 charger driver;
    2. Two new power supply properties: whether a battery is authentic,
    and chargers' maximal currents and voltages;
    3. A lot of TI LP8727 Charger cleanups;
    4. New features for Charger Manager, mainly now we can disable
    specific regulators;
    5. Random fixes and cleanups for other drivers."

    Fix up trivial conflicts in

    * tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits)
    pda_power: Remove ac_draw_failed goto and label
    charger-manager: Add support sysfs entry for charger
    charger-manager: Support limit of maximum possible
    charger-manager: Check fully charged state of battery periodically
    lp8727_charger: More pure cosmetic improvements
    lp8727_charger: Fix checkpatch warning
    lp8727_charger: Add description in the private data
    lp8727_charger: Fix a typo - chg_parm to chg_param
    lp8727_charger: Make some cosmetic changes in lp8727_delayed_func()
    lp8727_charger: Clean up lp8727_charger_changed()
    lp8727_charger: Return if the battery is discharging
    lp8727_charger: Make lp8727_charger_get_propery() simpler
    lp8727_charger: Make lp8727_ctrl_switch() inline
    lp8727_charger: Make lp8727_init_device() shorter
    lp8727_charger: Clean up lp8727_is_charger_attached()
    lp8727_charger: Use specific definition
    lp8727_charger: Clean up lp8727 definitions
    lp8727_charger: Use the definition rather than enum
    lp8727_charger: Fix code for getting battery temp
    lp8727_charger: Clear interrrupts at inital time
    ...

    Linus Torvalds
     

03 Oct, 2012

2 commits

  • Fix the error handling path in omap_sr_probe to correctly
    de-allocate resources in case of problems.

    Signed-off-by: Jean Pihet
    Signed-off-by: Kevin Hilman

    Jean Pihet
     
  • Pull workqueue changes from Tejun Heo:
    "This is workqueue updates for v3.7-rc1. A lot of activities this
    round including considerable API and behavior cleanups.

    * delayed_work combines a timer and a work item. The handling of the
    timer part has always been a bit clunky leading to confusing
    cancelation API with weird corner-case behaviors. delayed_work is
    updated to use new IRQ safe timer and cancelation now works as
    expected.

    * Another deficiency of delayed_work was lack of the counterpart of
    mod_timer() which led to cancel+queue combinations or open-coded
    timer+work usages. mod_delayed_work[_on]() are added.

    These two delayed_work changes make delayed_work provide interface
    and behave like timer which is executed with process context.

    * A work item could be executed concurrently on multiple CPUs, which
    is rather unintuitive and made flush_work() behavior confusing and
    half-broken under certain circumstances. This problem doesn't
    exist for non-reentrant workqueues. While non-reentrancy check
    isn't free, the overhead is incurred only when a work item bounces
    across different CPUs and even in simulated pathological scenario
    the overhead isn't too high.

    All workqueues are made non-reentrant. This removes the
    distinction between flush_[delayed_]work() and
    flush_[delayed_]_work_sync(). The former is now as strong as the
    latter and the specified work item is guaranteed to have finished
    execution of any previous queueing on return.

    * In addition to the various bug fixes, Lai redid and simplified CPU
    hotplug handling significantly.

    * Joonsoo introduced system_highpri_wq and used it during CPU
    hotplug.

    There are two merge commits - one to pull in IRQ safe timer from
    tip/timers/core and the other to pull in CPU hotplug fixes from
    wq/for-3.6-fixes as Lai's hotplug restructuring depended on them."

    Fixed a number of trivial conflicts, but the more interesting conflicts
    were silent ones where the deprecated interfaces had been used by new
    code in the merge window, and thus didn't cause any real data conflicts.

    Tejun pointed out a few of them, I fixed a couple more.

    * 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (46 commits)
    workqueue: remove spurious WARN_ON_ONCE(in_irq()) from try_to_grab_pending()
    workqueue: use cwq_set_max_active() helper for workqueue_set_max_active()
    workqueue: introduce cwq_set_max_active() helper for thaw_workqueues()
    workqueue: remove @delayed from cwq_dec_nr_in_flight()
    workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
    workqueue: use hotcpu_notifier() for workqueue_cpu_down_callback()
    workqueue: use __cpuinit instead of __devinit for cpu callbacks
    workqueue: rename manager_mutex to assoc_mutex
    workqueue: WORKER_REBIND is no longer necessary for idle rebinding
    workqueue: WORKER_REBIND is no longer necessary for busy rebinding
    workqueue: reimplement idle worker rebinding
    workqueue: deprecate __cancel_delayed_work()
    workqueue: reimplement cancel_delayed_work() using try_to_grab_pending()
    workqueue: use mod_delayed_work() instead of __cancel + queue
    workqueue: use irqsafe timer for delayed_work
    workqueue: clean up delayed_work initializers and add missing one
    workqueue: make deferrable delayed_work initializer names consistent
    workqueue: cosmetic whitespace updates for macro definitions
    workqueue: deprecate system_nrt[_freezable]_wq
    workqueue: deprecate flush[_delayed]_work_sync()
    ...

    Linus Torvalds
     

02 Oct, 2012

1 commit

  • Pull ARM soc general cleanups from Olof Johansson:
    "This is a large branch that contains a handful of different cleanups:

    - Fixing up the I/O space remapping on PCI on ARM. This is a series
    from Rob Herring that restructures how all pci devices allocate I/O
    space, and it's part of the work to allow multiplatform kernels.
    - A number of cleanup series for OMAP, moving and removing some
    headers, sparse irq rework and in general preparation for
    multiplatform.
    - Final removal of all non-DT boards for Tegra, it is now
    device-tree-only!
    - Removal of a stale platform, nxp4008. It's an old mobile chipset
    that is no longer in use, and was very likely never really used
    with a mainline kernel. We have not been able to find anyone
    interested in keeping it around in the kernel.
    - Removal of the legacy dmaengine driver on tegra

    + A handful of other things that I haven't described above."

    Fix up some conflicts with the staging tree (and because nxp4008 was
    removed)

    * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (184 commits)
    ARM: OMAP2+: serial: Change MAX_HSUART_PORTS to 6
    ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus
    ARM: mmp: using for_each_set_bit to simplify the code
    ARM: tegra: harmony: fix ldo7 regulator-name
    ARM: OMAP2+: Make omap4-keypad.h local
    ARM: OMAP2+: Make l4_3xxx.h local
    ARM: OMAP2+: Make l4_2xxx.h local
    ARM: OMAP2+: Make l3_3xxx.h local
    ARM: OMAP2+: Make l3_2xxx.h local
    ARM: OMAP1: Move irda.h from plat to mach
    ARM: OMAP2+: Make hdq1w.h local
    ARM: OMAP2+: Make gpmc-smsc911x.h local
    ARM: OMAP2+: Make gpmc-smc91x.h local
    ARM: OMAP1: Move flash.h from plat to mach
    ARM: OMAP2+: Make debug-devices.h local
    ARM: OMAP1: Move board-voiceblue.h from plat to mach
    ARM: OMAP1: Move board-sx1.h from plat to mach
    ARM: OMAP2+: Make omap-wakeupgen.h local
    ARM: OMAP2+: Make omap-secure.h local
    ARM: OMAP2+: Make ctrl_module_wkup_44xx.h local
    ...

    Linus Torvalds
     

24 Sep, 2012

1 commit


22 Sep, 2012

3 commits

  • Driver to allow use of the ADC drivers supported by the IIO
    subsystem for battery status monitoring. Connecting this
    driver to the relevant IIO device requires registration of
    the appropriate iio_map structure array by the IIO device
    driver (usually from platform data). If specified the driver
    will also make use of a gpio to provide interrupt driven
    notification that the battery is fully charged.

    In last version:
    Addressed concerns raised by lars:
    a. made the adc_bat per device.
    b. get the IIO channel using hardcoded channel names.
    c. Minor issues related to gpio_is_valid and some code
    refactoring.

    In V1:
    Addressed concerns raised by Anton:
    a. changed the struct name to gab(generic adc battery).
    b. Added some functions to neaten the code.
    c. Some minor coding guidelines changes.
    d. Used the latest function introduce by lars:
    iio_read_channel_processed to streamline the code.

    In V2:
    Addressed concerns by lars:
    a. No need of allocating memory for channels.Make it array.
    b. Code restructring, coding style and following kernel guidelines changes
    suggested by him.

    In V3:
    Addressed conerns by Anton:
    a. Added the copyright.
    b. Coding guidelines changes suggested by him.
    c. Added Makefile and Kconfig

    Signed-off-by: anish kumar
    Acked-by: Anton Vorontsov
    Signed-off-by: Jonathan Cameron

    anish kumar
     
  • A previous patch added the ac_draw_failed goto and label to
    pda_power_probe(). The goto would be invoked after a failed call to
    regulator_get().

    However the way ac_draw is used - always after a check for NULL - suggests
    that a failed call to regulator_get() was not fatal.

    This patch removes the ac_draw_failed goto and label, partly reverting the
    previous patch.

    This patch also removes the assignment of an error code to ret after a
    failed call to regulator_get(), since the error code is now never used.

    Signed-off-by: Paul Parsons
    Cc: Philipp Zabel
    Signed-off-by: Anton Vorontsov

    Paul Parsons
     
  • This patch add support sysfs entry for each charger(regulator).
    Charger-manager use one or more chargers for charging battery but some
    charger isn't necessary on specific scenario. So, if some charger isn't
    needed, can disable specific charger through 'externally_control' entry
    while system is on state and confirm the information(name, state) of
    charger.

    The list of added sysfs entry
    - /sys/class/power_supply/battery/chargers/charger.[index]/name
    show name of charger(regulator)
    - /sys/class/power_supply/battery/chargers/charger.[index]/state
    show either enabled or disabled state of charger
    - /sys/class/power_supply/battery/chargers/charger.[index]/externally_control

    If 'externally_control' of specific charger is 1, Charger-manager cannot
    enable regulator for charging when charger cable is attached and charger
    must be maintained with disabled state. If 'externally_control' is zero,
    Charger-manager usually can control to enable/disable regulator.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Kyungmin Park
    Signed-off-by: Anton Vorontsov

    Chanwoo Choi
     

21 Sep, 2012

28 commits

  • This patch check maximum possible duration of charging/discharging.

    If whole charging duration exceed 'desc->charging_max_duration_ms', cm
    stop charging to prevent overcharge/overheat. And if discharging duration
    exceed, charger cable is attached, after full-batt, cm start charging to
    maintain fully charged state for battery.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Kyungmin Park
    Signed-off-by: Anton Vorontsov

    Chanwoo Choi
     
  • This patch check periodically fully charged state of battery to protect
    overcharge and overheat. If battery is fully charged, stop charging and
    check droped voltage with 'fullbatt_vchkdrop_ms' period. When voltage of
    battery is more droped than 'fullbatt_vchkdrop_uV' voltage,
    charger-manager will restart charging for battery.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: Myungjoo Ham
    Signed-off-by: Kyungmin Park
    Signed-off-by: Anton Vorontsov

    Chanwoo Choi
     
  • This is really minor, but it improves the readability.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Fix the warning on MODULE_AUTHOR.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Add description and relocate data.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Declare a variable at one line and align lines.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Declare a variable at one line. Just return when no charger exists to make
    code simpler.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • If the charger is pulled out, just return as DISCHARGING. Then no need for
    additional 'else' statement.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Charger has only one valid property - ONLINE. If the property is not
    ONLINE, then just return quickly.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Just return with lp8727_write_byte(), no need to check its value.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Change return type to boolean. Remove unnecessary check routine for NULL
    string. (Power supply name is always valid when the function is executed.)

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Add new LP8727_ICHG_SHIFT definition and replace a magic number. Reuse
    definition for the size of interrupt register buffer.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • All definitions should be unique, since they're in the gloabl namespace.
    So the prefix LP8727_ are added. Additionally, use BIT() macro for bit
    masks. Remove unnecessary definitions such as SW_DM1_U1 and SW_DP2_U2.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Enum lp8727_chg_state can be removed because only one charger status is
    used - EOC(End Of Charge).

    To check whether the EOC is reached or not, use simple comparison rather
    than shift-operation.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • For better understanding, use specific function and definitions rather
    than magic numbers. New enum type for die temperature is matched with hex
    codes. Specific temperature names are better than 0x1, 0x2 and 0x3.

    And lp8727_is_high_temperature() function has better readability than
    comparing raw register values.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • To initialize the device, previous interrupts need to be cleared while
    loading the driver.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • For better understanding, function name is changed. (lp8727_intr_config()
    is replaced with lp8727_setup_irq().)

    The private IRQ number is set when the IRQ is allocated successfully. This
    data is used for releasing the IRQ on unloading the driver. Even the IRQ
    number is not defined, the driver should be operated. In this case, just
    return as 0.

    In additional function lp8727_release_irq(), the workqueue is canceled and
    the allocated IRQ is released.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • LP8727 has two IRQ threads. One is the I2C HW IRQ pin, the other is for
    delayed interrupt processing. But this delayed processing can be handled
    without additional single thread by using schedule_delayed_work() with
    jiffies time value.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Debounce time is configurable in the platform side. If it is not defined,
    the default value is 270ms.

    Platform data is msec unit, and this time is converted to jiffies
    internally. The workqueue uses this jiffies time in the interrupt
    handling. So debounce_jiffies is added in the private data.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • LP8727 platform data is optional, so the driver should work even the
    platform data is NULL.

    To check the platform data, charging parameter data should be changed to
    the pointer type.

    Fix NULL point access problem when getting the battery properties. When
    the data is NULL, just return as invalid value.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • If the lp8727_register_psy() gets failed, registered interrupt handler
    should be freed, but this is not complete solution. It has still problem.
    Assume that the IRQ occurs while unregistering power supply devices. Then
    the ISR will access to freed IRQ.

    From Anton's opinion, it can be resolved if re-ordering the call sequence.

    Register power supplies first, then create interrupt handler. Then no need
    to free the IRQ in _probe(). Additionally goto statements can be removed
    because those can be replaced with return statements.

    The _remove() should be changed the sequence - in reverse order of
    _probe()

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Use devm_kzalloc() rather than kzalloc()/kfree() to make
    allocating/freeing the private data simpler.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Kim, Milo
     
  • Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

    Make sure threaded IRQs without a primary handler are always request with IRQF_ONESHOT

    Signed-off-by: Fengguang Wu
    Acked-by: Felipe Balbi
    Signed-off-by: Anton Vorontsov

    Fengguang Wu
     
  • Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

    ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

    Make sure threaded IRQs without a primary handler are always request
    with IRQF_ONESHOT

    Signed-off-by: Fengguang Wu
    Acked-by: Milo(Woogyom) Kim
    Signed-off-by: Anton Vorontsov

    Fengguang Wu
     
  • Sparse complains:

    CHECK drivers/power/88pm860x_battery.c
    drivers/power/88pm860x_battery.c:128:5: warning: symbol 'array_soc' was not declared. Should it be static?
    CHECK drivers/power/88pm860x_charger.c
    drivers/power/88pm860x_charger.c:640:3: warning: symbol 'pm860x_irq_descs' was not declared. Should it be static?
    CHECK drivers/mfd/88pm860x-core.c
    drivers/mfd/88pm860x-core.c:803:53: warning: incorrect type in assignment (different base types)
    drivers/mfd/88pm860x-core.c:803:53: expected struct charger_regulator *charger_regulators
    drivers/mfd/88pm860x-core.c:803:53: got struct regulator_bulk_data static [toplevel] *

    The issues are minor, except for the last one. We seemed to use
    'regulator_bulk_data' struct (just as charger manager documentation
    wrongly tells us), but in real it should have been
    'struct charger_regulator'. The only reason that it worked is
    because both 'supply' and 'regulator_name' struct members are the
    first in these structs. :-)

    Signed-off-by: Anton Vorontsov

    Anton Vorontsov
     
  • There are charger and battery measurement feature for 88pm860x PMIC.

    For charger, it can support pre-charge with small current when battery is
    nearly exausted and then changed into fast-charge with CC&CV mode.

    For battery monitor, it can support battery measurement such as
    vbat,vsys,vchg and ibat etc,it can aslo accumulating the Coulomb value
    charged or discharged from battery based on Conlomb Counter, we use it
    to estimate battery capacity.

    Signed-off-by: Jett.Zhou
    Signed-off-by: Anton Vorontsov

    Jett.Zhou