summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-01-04power_supply: Convert drivers/power/* to use module_platform_driver()Axel Lin
This patch converts the drivers in drivers/power/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Mike Rapoport <mike@compulab.co.il> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Nithish Mahalingam <nithish.mahalingam@intel.com> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Balaji Rao <balajirrao@openmoko.org> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Clifton Barnes <cabarnes@indesign-llc.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04Merge branch 'power-supply-scope' of ↵Anton Vorontsov
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
2012-01-04power_supply: Add "unknown" in power supply typeKim, Milo
For the default value of power supply type, "unknown" is added. With default prop value, supply type property can be displayed as default - "Unknown". Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04lp8727_charger: Coding style changesKim, Milo
1. Useless braces were omitted 2. Useless void casts were omitted 3. module exit name changed lp8727_chg_exit -> lp8727_exit 4. Pointer coding style changes no space between pointer('*') and pointer name ex) u8 * data -> u8 *data 5. Author information change : email and additional author Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04lp8727_charger: Add supported i2c functionality check routineKim, Milo
lp8727 i2c r/w functions are based on SMBUS I2C BLOCK. So the driver needs to check whether i2c bus supports this functionality or not. Signed-off-by: Woogyom Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04power_supply: Add LP8727 charger driverWoogyom Kim
National Semiconductor LP8727 is the battery charger with Micro/Mini USB interface. This IC includes below functions: - I2C interface for accessing user registers - Single input Li-Ion battery charger - Charger input ID detection from Micro/Mini USB - Multiplexing switches on USB, UART Signed-off-by: Woogyom Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04power_supply: Charger-Manager: Add properties for power-supply-classDonggeun Kim
Charger Manager provides power-supply-class aggregating information from multiple chargers and a fuel-gauge. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-04power_supply: Add initial Charger-Manager driverDonggeun Kim
Because battery health monitoring should be done even when suspended, it needs to wake up and suspend periodically. Thus, userspace battery monitoring may incur too much overhead; every device and task is woken up periodically. Charger Manager uses suspend-again to provide in-suspend monitoring. This patch allows to monitor battery health in-suspend state. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-12-09power_supply: add "powers" links to self-powered HID devicesJeremy Fitzhardinge
Make the relationship between the Wiimote and Wacom self-powered HID devices and their power supply explicit by adding a "powers" link. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Jiri Kosina <jkosina@suse.cz>
2011-12-09power_supply: add scope properties to some self-powered HID devicesJeremy Fitzhardinge
The Wacom and Wiimote HID drivers register power supplies for themselves to indicate their battery levels. Make those power supplies device scope. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Jiri Kosina <jkosina@suse.cz>
2011-12-09power_supply: allow a power supply to explicitly point to powered deviceJeremy Fitzhardinge
If a power supply has a scope of "Device", then allow the power supply to indicate what device it actually powers. This is represented in the power supply's sysfs directory as a symlink named "powers", which points to the sysfs directory of the powered device. If the device has children, then the sub-devices are also powered by the same power supply. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Richard Hughes <richard@hughsie.com>
2011-12-09power_supply: add SCOPE attribute to power suppliesJeremy Fitzhardinge
This adds a "scope" attribute to a power_supply, which indicates how much of the system it powers. It appears in sysfs as "scope" or in the uevent file as POWER_SUPPLY_SCOPE=. There are presently three possible values: Unknown - unknown power topology System - the power supply powers the whole system Device - it powers a specific device, or tree of devices A power supply which doesn't have a "scope" attribute should be assumed to have "System" scope. In general, usermode should assume that loss of all System-scoped power supplies will power off the whole system, but any single one is sufficient to power the system. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Richard Hughes <richard@hughsie.com>
2011-11-26max8925_power: Check at probe time if power to set onlinePhilip Rakity
The interrupt for ac on/off can be missed during boot time. Check if online by seeing if we have power. We choose 0.5V since this is high enough to avoid random reading from a input that could be floating if no charger. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Ted Bennett <tbennett@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26max8925_power: Do not read random data from chip registersPhilip Rakity
Reading the voltage, charge etc requires that we tell the chip what property we want to read before reading it according to maxim. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Thomas Liu <Thomas.Liu@maxim-ic.com> Tested-by: Ted Bennett <tbennett@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26max17042_battery: Fix error handlingRamakrishna Pallala
In max17042_get_property(...), the values returned by max17042_read_reg are directly assigned to the variables, even if the read results in an error. This patch checks for the return code from max17042_read_reg and exits the function if there is any error. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26ds2760_battery: Add rated capacity of the hx4700 3600mAh batteryPaul Parsons
Add rated capacity of the HP iPAQ hx4700 3.7V 3600mAh (359114-001) battery. For this battery the value of the rated capacity EEPROM register at 0x32 is 14; thus rated_capacities[14] = 3600. Signed-off-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26power_supply: Remove IRQF_DISABLEDYong Zhang
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driverPali Rohár
* power_supply_unregister call bq27x00_battery_get_property which call bq27x00_battery_poll * make sure that bq27x00_battery_poll will not call schedule_delayed_work again after unregister (which cause OOPS) Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-26bq27x00_battery: Fix reporting error messagesPali Rohár
* Do not be noise if battery is not calibrated (use dev_dbg) Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Fix reporting status value for bq27500 batteryPali Rohár
Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Cache temperature value in converted unitPali Rohár
Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Cache energy propertyPali Rohár
Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Report -ENODATA if bq27000 battery was not calibratedPali Rohár
* CI (Capacity Inaccurate) flag is set after full reset on bq27000 battery * when is set, all capacity properties should be reported incorrectly, because there was no learning cycle and battery was not calibrated * instead reporting incorrect values, report -ENODATA Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Add support for property POWER_SUPPLY_PROP_CAPACITY_LEVELPali Rohár
Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25bq27x00_battery: Do not cache current_now value for bq27000 bateryPali Rohár
* This prevent reporting old current_now value for bq27000 * Also ask for current flags, to make sure that current_now will be reported with correct signature Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8925_power: Enable power change notificationsPhilip Rakity
The power core infrastructure allow external power change events to be passed to drivers what are listed in the supplied_to call back field. Enable this feature by allowing the supplied_to field to be passed to the driver. This feature will enable drivers named in the supplied_to field that have a external_power_changed callback to be notified when power was been turned on or off. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8925_power: Remove support for irq bits that do not existPhilip Rakity
The max8925 cannot return usb status.  The bits       [MAX8925_IRQ_VCHG_USB_OVP] = {               .reg            = MAX8925_CHG_IRQ1,               .mask_reg       = MAX8925_CHG_IRQ1_MASK,               .offs           = 1 << 3,       },       [MAX8925_IRQ_VCHG_USB_F] =  {               .reg            = MAX8925_CHG_IRQ1,               .mask_reg       = MAX8925_CHG_IRQ1_MASK,               .offs           = 1 << 4,       },       [MAX8925_IRQ_VCHG_USB_R] = {               .reg            = MAX8925_CHG_IRQ1,               .mask_reg       = MAX8925_CHG_IRQ1_MASK,               .offs           = 1 << 5,       }, do not exist in the irq register. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8925_power: Do not detect ac insert if handled by other codePhilip Rakity
On brownstone rev 4 ac-insert detect is handled by vbus. allow the platform code to configure the disabling of insert by setting no_insert_detect. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8925_power: No temperature interrupts if temperature not connectedPhilip Rakity
Brownstone does not have temperature reading circuit hooked up. This leads to spurious interrupts. Allow the platform layer to indicate no temperature circuit and do not activate interrupts if no temperature control is set Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8925_power: Fix incorrect voltage and current calculationPhilip Rakity
The datasheet indicates a 12 bit value is returned for i2c registers for voltage and current. Code was assuming 8 bits. But default for chip is 12 bit return value. Voltage is returned in 2mV units -- adjust to return as uV per linux power spec Adjust current calculation to return units in uA. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25max8997_charger: Fix unsigned value for less than zeroJonghwan Choi
The 'val' is a 'unsigned char', so it is never less than zero. Signed-off-by: Jonghwan Choi <jhbird.choi@gmail.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-25Merge tag 'v3.1' from ↵Anton Vorontsov
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git into master Battery tree missed last merge window, so it became stale enough so that patches no longer apply as people use pretty recent kernels.
2011-11-24intel_mid_battery: Handle Over Current gracefullyMajor Lee
When DCDC input line over current detecting, PMIC will change charging current automatically. Logging event is enough. Signed-off-by: Major Lee <major_lee@wistron.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-24tosa_battery: Convert to gpio_request_array() / gpio_free_array()Axel Lin
This change simplifies the implementation. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-24collie_battery: Convert to gpio_request_array() / gpio_free_array()Axel Lin
As suggested by Igor Grinberg, this change make the implementation looks simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-24olpc_battery: Remove unneeded 'olpc_battery_trigger_uevent'Anton Vorontsov
It is no longer used, so we can safely remove it. Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-24olpc_battery: Fix section mismatch noiseAnton Vorontsov
This patch fixes the following noise (by renaming _drv to _driver): WARNING: drivers/power/olpc_battery.o(.data+0x100): Section mismatch in reference from the variable olpc_battery_drv to the function .devinit.text:olpc_battery_probe() The variable olpc_battery_drv references the function __devinit olpc_battery_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: drivers/power/olpc_battery.o(.data+0x104): Section mismatch in reference from the variable olpc_battery_drv to the function .devexit.text:olpc_battery_remove() The variable olpc_battery_drv references the function __devexit olpc_battery_remove() If the reference is valid then annotate the variable with __exit* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: drivers/power/olpc_battery.o(.data+0x128): Section mismatch in reference from the variable olpc_battery_drv to the variable .devinit.rodata:olpc_battery_ids The variable olpc_battery_drv references the variable __devinitconst olpc_battery_ids If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-24bq20z75: Devicetree init supportRhyland Klein
Adding support to generate platform data when kernel is configured through device tree. Also adding the binding for the TI bq20z75 fuel gadge and the bq20z75 driver. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-11-15Linux 3.2-rc2v3.2-rc2Linus Torvalds
2011-11-15Merge branch 'iommu/fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu * 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: omap: Fix compile failure
2011-11-15Merge branch 'fixes' of git://git.linaro.org/people/triad/linux-pinctrlLinus Torvalds
* 'fixes' of git://git.linaro.org/people/triad/linux-pinctrl: pinctrl: hide subsystem from the populace pinctrl: fix "warning: 'struct pinctrl_dev' declared inside parameter list"
2011-11-15Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: fsl-rio: fix compile error
2011-11-15Merge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6: gpio: pca953x: propagate the errno from the chip_init functions gpio: pca953x: remove unneeded check for chip type gpio/omap: check return value from irq_alloc_generic_chip gpio/omap: replace MOD_REG_BIT macro with static inline
2011-11-15Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo/blackfin * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo/blackfin: blackfin: Fixup export.h includes Blackfin: add serial TX IRQ in individual platform resource
2011-11-15hfs: add sanity check for file name lengthDan Carpenter
On a corrupted file system the ->len field could be wrong leading to a buffer overflow. Reported-and-acked-by: Clement LECIGNE <clement.lecigne@netasq.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-14fsl-rio: fix compile errorLiu Gang
The "#include <linux/module.h>" was replaced by "#include <linux/export.h>" in the patch "powerpc: various straight conversions from module.h --> export.h". This will cause the following compile problem: arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception': arch/powerpc/sysdev/fsl_rio.c:296: error: implicit declaration of function 'search_exception_tables'. The file fsl_rio.c needs the declaration of function "search_exception_tables" in the header file "linux/module.h". Signed-off-by: Liu Gang <Gang.Liu@freescale.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-11-14blackfin: Fixup export.h includesLars-Peter Clausen
Commit 8dc7a9c84 ("blackfin: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE") inserted some of the include statements into sections protected by an unrelated #if CONFIG_... statement. This can cause, depending on the configuration used, warnings like this one: arch/blackfin/mach-bf537/boards/stamp.c:2940: warning: data definition has no type or storage class arch/blackfin/mach-bf537/boards/stamp.c:2940: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’ arch/blackfin/mach-bf537/boards/stamp.c:2940: warning: parameter names (without types) in function declaration This patch fixes it by moving the includes out of the #if protected sections. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bob Liu <lliubbo@gmail.com>
2011-11-14Blackfin: add serial TX IRQ in individual platform resourceSonic Zhang
The serial TX IRQ is not simply (RX IRQ + 1) on some Blackfin chips, so move the values to the platform resources. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bob Liu <lliubbo@gmail.com>
2011-11-14Merge branch 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-shLinus Torvalds
* 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-sh: ARM: mach-shmobile: cpuidle single/global and last_state fixes ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.h ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h ARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.h ARM: mach-shmobile: ap4evb: remove white space from end of line ARM: mach-shmobile: clock-sh7372: remove un-necessary index ARM: mach-shmobile: kota2: add comment out separator ARM: mach-shmobile: sh73a0: add MMC data pin pull-up
2011-11-14Merge branch 'sh-fixes-for-linus' of git://github.com/pmundt/linux-shLinus Torvalds
* 'sh-fixes-for-linus' of git://github.com/pmundt/linux-sh: mailmap: Fix up some renesas attributions sh: clkfwk: Kill off remaining debugfs cruft. drivers: sh: Kill off dead pathname for runtime PM stub. drivers: sh: Generalize runtime PM platform stub. sh: Wire up process_vm syscalls. sh: clkfwk: add clk_rate_mult_range_round() serial: sh-sci: Fix up SH-2A SCIF support. sh: Fix cached/uncaced address calculation in 29bit mode