summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2012-07-26Merge tag 'driver-core-3.6-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core changes from Greg Kroah-Hartman: "Here's the big driver core pull request for 3.6-rc1. Unlike 3.5, this kernel should be a lot tamer, with the printk changes now settled down. All we have here is some extcon driver updates, w1 driver updates, a few printk cleanups that weren't needed for 3.5, but are good to have now, and some other minor fixes/changes in the driver core. All of these have been in the linux-next releases for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits) printk: Export struct log size and member offsets through vmcoreinfo Drivers: hv: Change the hex constant to a decimal constant driver core: don't trigger uevent after failure extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device sysfs: fail dentry revalidation after namespace change fix sysfs: fail dentry revalidation after namespace change extcon: spelling of detach in function doc extcon: arizona: Stop microphone detection if we give up on it extcon: arizona: Update cable reporting calls and split headset PM / Runtime: Do not increment device usage counts before probing kmsg - do not flush partial lines when the console is busy kmsg - export "continuation record" flag to /dev/kmsg kmsg - avoid warning for CONFIG_PRINTK=n compilations kmsg - properly print over-long continuation lines driver-core: Use kobj_to_dev instead of re-implementing it driver-core: Move kobj_to_dev from genhd.h to device.h driver core: Move deferred devices to the end of dpm_list before probing driver core: move uevent call to driver_register driver core: fix shutdown races with probe/remove(v3) Extcon: Arizona: Add driver for Wolfson Arizona class devices ...
2012-07-26Merge tag 'usb-3.6-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB patches from Greg Kroah-Hartman: "Here's the big USB patch set for the 3.6-rc1 merge window. Lots of little changes in here, primarily for gadget controllers and drivers. There's some scsi changes that I think also went in through the scsi tree, but they merge just fine. All of these patches have been in the linux-next tree for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up trivial conflicts in include/scsi/scsi_device.h (same libata conflict that Jeff had already encountered) * tag 'usb-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (207 commits) usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams usb: Add quirk detection based on interface information usb: s3c-hsotg: Add header file protection macros in s3c-hsotg.h USB: ehci-s5p: Add vbus setup function to the s5p ehci glue layer USB: add USB_VENDOR_AND_INTERFACE_INFO() macro USB: notify phy when root hub port connect change USB: remove 8 bytes of padding from usb_host_interface on 64 bit builds USB: option: add ZTE MF821D USB: sierra: QMI mode MC7710 moved to qcserial USB: qcserial: adding Sierra Wireless devices USB: qcserial: support generic Qualcomm serial ports USB: qcserial: make probe more flexible USB: qcserial: centralize probe exit path USB: qcserial: consolidate usb_set_interface calls USB: ehci-s5p: Add support for device tree USB: ohci-exynos: Add support for device tree USB: ehci-omap: fix compile failure(v1) usb: host: tegra: pass correct pointer in ehci_setup() USB: ehci-fsl: Update ifdef check to work on 64-bit ppc USB: serial: keyspan: Removed unrequired parentheses. ...
2012-07-24Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree from Jiri Kosina: "Trivial updates all over the place as usual." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (29 commits) Fix typo in include/linux/clk.h . pci: hotplug: Fix typo in pci iommu: Fix typo in iommu video: Fix typo in drivers/video Documentation: Add newline at end-of-file to files lacking one arm,unicore32: Remove obsolete "select MISC_DEVICES" module.c: spelling s/postition/position/g cpufreq: Fix typo in cpufreq driver trivial: typo in comment in mksysmap mach-omap2: Fix typo in debug message and comment scsi: aha152x: Fix sparse warning and make printing pointer address more portable. Change email address for Steve Glendinning Btrfs: fix typo in convert_extent_bit via: Remove bogus if check netprio_cgroup.c: fix comment typo backlight: fix memory leak on obscure error path Documentation: asus-laptop.txt references an obsolete Kconfig item Documentation: ManagementStyle: fixed typo mm/vmscan: cleanup comment error in balance_pgdat mm: cleanup on the comments of zone_reclaim_stat ...
2012-07-02usb: phy: fix return value check of usb_get_phyKishon Vijay Abraham I
usb_get_phy will return -ENODEV if it's not able to find the phy. Hence fixed all the callers of usb_get_phy to check for this error condition instead of relying on a non-zero value as success condition. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-29ARM: OMAP2+: do not allow SmartReflex to be built as a moduleJean Pihet
Disable the module option for POWER_AVS since this is currently not supported. This patch fixes these error in the case POWER_AVS is set to 'm': arch/arm/mach-omap2/built-in.o: In function `sr_class3_configure': arch/arm/mach-omap2/smartreflex-class3.c:43: undefined reference to `sr_configure_errgen' arch/arm/mach-omap2/built-in.o: In function `sr_class3_disable': arch/arm/mach-omap2/smartreflex-class3.c:33: undefined reference to `sr_disable_errgen' arch/arm/mach-omap2/smartreflex-class3.c:35: undefined reference to `sr_disable' arch/arm/mach-omap2/built-in.o: In function `sr_class3_enable': arch/arm/mach-omap2/smartreflex-class3.c:28: undefined reference to `sr_enable' arch/arm/mach-omap2/built-in.o: In function `sr_class3_init': arch/arm/mach-omap2/smartreflex-class3.c:59: undefined reference to `sr_register_class' Reported-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com> [tony@atomide.com: updated to use relative paths for the build error] Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-06-29Merge branch 'master' into for-nextJiri Kosina
Conflicts: include/linux/mmzone.h Synced with Linus' tree so that trivial patch can be applied on top of up-to-date code properly. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
2012-06-28ab8500-btemp: Fix typo 'AB5500'Paul Bolle
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-26Merge branch 'for_3.6/pm/sr-move' of ↵Tony Lindgren
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into devel-driver
2012-06-25usb: otg: support for multiple transceivers by a single controllerKishon Vijay Abraham I
Add a linked list for keeping multiple PHY instances with different types so that we can have separate USB2 and USB3 PHYs on one single board. _get_phy_ has been changed so that the controller gets the transceiver by type. _remove_phy_ has been added to let the phy be removed from the phy list. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-25usb: otg: utils: rename function name in OTG utilsKishon Vijay Abraham I
_transceiver() in otg.c is replaced with _phy. usb_set_transceiver is replaced with usb_add_phy to make it similar to other usb standard function names like usb_add_hcd. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-06-13W1: split master mutex to avoid deadlocks.NeilBrown
The 'mutex' in struct w1_master is use for two very different purposes. Firstly it protects various data structures such as the list of all slaves. Secondly it protects the w1 buss against concurrent accesses. This can lead to deadlocks when the ->probe code called while adding a slave needs to talk on the bus, as is the case for power_supply devices. ds2780 and ds2781 drivers contain a work around to track which process hold the lock simply to avoid this deadlock. bq27000 doesn't have that work around and so deadlocks. There are other possible deadlocks involving sysfs. When removing a device the sysfs s_active lock is held, so the lock that protects the slave list must take precedence over s_active. However when access power_supply attributes via sysfs, the s_active lock must take precedence over the lock that protects accesses to the bus. So to avoid deadlocks between w1 slaves and sysfs, these must be two separate locks. Making them separate means that the work around in ds2780 and ds2781 can be removed. So this patch: - adds a new mutex: "bus_mutex" which serialises access to the bus. - takes in mutex in w1_search and ds1wm_search while they access the bus for searching. The mutex is dropped before calling the callback which adds the slave. - changes all slaves to use bus_mutex instead of mutex to protect access to the bus - removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the related code from drivers/power/ds278[01]_battery.c which calls them. Signed-off-by: NeilBrown <neilb@suse.de> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-31ARM: OMAP: SmartReflex: Move smartreflex driver to drivers/Jean Pihet
After a clean-up of the interfaces the OMAP Smartreflex IP driver is now a generic driver. Move it to drivers/power/avs/. The build is controlled by the following Kconfig options: . CONFIG_POWER_AVS: general knob for Adaptive Voltage Scaling support, . CONFIG_POWER_AVS_OMAP: AVS(Adaptive Voltage Scaling) support on OMAP containing the version 1 or version 2 of the SmartReflex IP, . CONFIG_POWER_AVS_OMAP_CLASS3: Class 3 implementation of Smartreflex. Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: J Keerthy <j-keerthy@ti.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-05-31Merge tag 'for-v3.5' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull battery updates from Anton Vorontsov: "A bunch of fixes for v3.5, nothing extraordinary." * tag 'for-v3.5' of git://git.infradead.org/battery-2.6: (27 commits) smb347-charger: Include missing <linux/err.h> smb347-charger: Clean up battery attributes max17042_battery: Add support for max17047/50 chip sbs-battery.c: Capacity attr = remaining relative capacity isp1704_charger: Use after free on probe error ds2781_battery: Use DS2781_PARAM_EEPROM_SIZE and DS2781_USER_EEPROM_SIZE power_supply: Fix a typo in BATTERY_DS2781 Kconfig entry charger-manager: Provide cm_notify_event function for in-kernel use charger-manager: Poll battery health in normal state smb347-charger: Convert to regmap API smb347-charger: Move IRQ enabling to the end of probe smb347-charger: Rename few functions to match better what they are doing smb347-charger: Convert to use module_i2c_driver() smb347_charger: Cleanup power supply registration code in probe ab8500: Clean up probe routines ab8500_fg: Harden platform data check ab8500_btemp: Harden platform data check ab8500_charger: Harden platform data check MAINTAINERS: Fix 'F' entry for the power supply class max17042_battery: Handle irq request failure case ...
2012-05-29Merge tag 'mfd-3.5-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD changes from Samuel Ortiz: "Besides the usual cleanups, this one brings: * Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton, ST-E's STAX211, Samsung's MAX77693 and TI's LM3533. * Device tree support for the twl6040, tps65910, da9502 and ab8500 drivers. * Fairly big tps56910, ab8500 and db8500 updates. * i2c support for mc13xxx. * Our regular update for the wm8xxx driver from Mark." Fix up various conflicts with other trees, largely due to ab5500 removal etc. * tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits) mfd: Fix build break of max77693 by adding REGMAP_I2C option mfd: Fix twl6040 build failure mfd: Fix max77693 build failure mfd: ab8500-core should depend on MFD_DB8500_PRCMU gpio: tps65910: dt: process gpio specific device node info mfd: Remove the parsing of dt info for tps65910 gpio mfd: Save device node parsed platform data for tps65910 sub devices mfd: Add r_select to lm3533 platform data gpio: Add Intel Centerton support to gpio-sch mfd: Emulate active low IRQs as well as active high IRQs for wm831x mfd: Mark two lm3533 zone registers as volatile mfd: Fix return type of lm533 attribute is_visible mfd: Enable Device Tree support in the ab8500-pwm driver mfd: Enable Device Tree support in the ab8500-sysctrl driver mfd: Add support for Device Tree to twl6040 mfd: Register the twl6040 child for the ASoC codec unconditionally mfd: Allocate twl6040 IRQ numbers dynamically mfd: twl6040 code cleanup in interrupt initialization part mfd: Enable ab8500-gpadc driver for Device Tree mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver ...
2012-05-20mfd: Convert wm831x to irq_domainMark Brown
The modern idiom is to use irq_domain to allocate interrupts. This is useful partly to allow further infrastructure to be based on the domains and partly because it makes it much easier to allocate virtual interrupts to devices as we don't need to allocate a contiguous range of interrupt numbers. Convert the wm831x driver over to this infrastructure, using a legacy IRQ mapping if an irq_base is specified in platform data and otherwise using a linear mapping, always registering the interrupts even if they won't ever be used. Only boards which need to use the GPIOs as interrupts should need to use an irq_base. This means that we can't use the MFD irq_base management since the unless we're using an explicit irq_base from platform data we can't rely on a linear mapping of interrupts. Instead we need to map things via the irq_domain - provide a conveniencem function wm831x_irq() to save a small amount of typing when doing so. Looking at this I couldn't clearly see anything the MFD core could do to make this nicer. Since we're not supporting device tree yet there's no meaningful advantage if we don't do this conversion in one, the fact that the interrupt resources are used for repeated IP blocks makes accessor functions for the irq_domain more trouble to do than they're worth. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-18smb347-charger: Include missing <linux/err.h>Mika Westerberg
Without the include we get build errors like: drivers/power/smb347-charger.c: In function 'smb347_probe': drivers/power/smb347-charger.c:1039:2: error: implicit declaration of function 'IS_ERR' [-Werror=implicit-function-declaration] drivers/power/smb347-charger.c:1040:3: error: implicit declaration of function 'PTR_ERR' [-Werror=implicit-function-declaration] Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-06smb347-charger: Clean up battery attributesRamakrishna Pallala
CURRENT_NOW and VOLTAGE_NOW should be instantaneous readings from power supply(ex: battery). smb347 charger driver reports charge voltage for VOLTAGE_NOW and charge current for CURRENT_NOW attributes which are not instantaneous readings. This patch removes the battery VOLTAGE_NOW and CURRENT_NOW properties from the driver and also removes hw_to_current() which is not required anymore. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05max17042_battery: Add support for max17047/50 chipRamakrishna Pallala
max17047 is improved version of max17042 chip. It has few HW bug fixes with minor changes in register set. max17050 is same as max17047 chip except its silicon packging. So from driver's point of view there is no difference btw max1047 and max1050. This patch adds the support to dynamically detect the chip type and adds steps to initialize the max17047 chip. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05sbs-battery.c: Capacity attr = remaining relative capacityNikolaus Voss
Currently, the capacity exported by this driver refers to reg 0x0e, which is the absolute state of charge which according to SBS refers to the design capacity/ energy of the battery. It can be > 100 % and drops below 100 % for a fully charged battery with the battery aging. This is not what the user exspects of a remaining capacity indication between 0 and 100 % with 100 % referring to a fully charged battery. This is provided by SBS reg 0x0d, which is the relative state of charge referring to the full charge capacity. Signed-off-by: Nikolaus Voss <n.voss@weinmann.de> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05isp1704_charger: Use after free on probe errorDan Carpenter
We can't use "isp" after freeing it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05ds2781_battery: Use DS2781_PARAM_EEPROM_SIZE and DS2781_USER_EEPROM_SIZEAxel Lin
Since we have defined DS2781_PARAM_EEPROM_SIZE and DS2781_USER_EEPROM_SIZE, use them to simplify the code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05power_supply: Fix a typo in BATTERY_DS2781 Kconfig entryAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05charger-manager: Provide cm_notify_event function for in-kernel useChanwoo Choi
By using cm_notify_event function, charger driver can report several charger events (e.g. battery full and external power in/out, etc) to Charger-Manager. Charger-Manager can properly and immediately control chargers by the reported event. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05charger-manager: Poll battery health in normal stateChanwoo Choi
Charger-Manager needs to check battery health in normal state as well as suspend-to-RAM state. When the battery is fully charged, Charger-Manager needs to determine when the chargers restart charging. This patch allows Charger-Manager to monitor battery health in normal state and handle operation for chargers after battery is fully charged. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05smb347-charger: Convert to regmap APIMika Westerberg
The smb347-charger driver does a lot of read-modify-write to the device registers. Instead of open-coding everything we can take advantage of regmap API which provides nice functions to do this kind of things. In addition there is no need for custom debugfs file for dumping registers as this is already provided by the regmap API. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05smb347-charger: Move IRQ enabling to the end of probeMika Westerberg
There is a potential problem if we call smb347_irq_enable() from smb347_irq_init() because smb347_irq_enable() makes the device registers read-only once it returns and smb347_irq_init() expects them to still be read-write. Currently no harm happens because it is the last call we make in smb347_irq_init(). Anyway a better place for enabling IRQs is at the end of probe function and this is also symmetric to call smb347_irq_disable() which is done at the beginning of remove function. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05smb347-charger: Rename few functions to match better what they are doingMika Westerberg
The naming used in the driver for some functions is not very clear what the functions are really doing. To make this a bit easier to understand we rename few functions which were badly named. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05smb347-charger: Convert to use module_i2c_driver()Mika Westerberg
This reduces the amount of boilerplate code in the driver and makes it a bit simpler. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05smb347_charger: Cleanup power supply registration code in probeRamakrishna Pallala
This patch checks if the usb or mains charging is enabled by the platform before registering with the power supply class. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05ab8500: Clean up probe routinesLee Jones
These patches clean up some ugliness and brings the variable initialisation formatting more into line with other drivers. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05ab8500_fg: Harden platform data checkLinus Walleij
If no platform data at all is supplied the driver crashes, extend the checks to be more careful so we can compile in the driver and boot also without platform data present. Acked-by: Arun Murthy <arun.murthy@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05ab8500_btemp: Harden platform data checkLinus Walleij
If no platform data at all is supplied the driver crashes, extend the checks to be more careful so we can compile in the driver and boot also without platform data present. Acked-by: Arun Murthy <arun.murthy@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05ab8500_charger: Harden platform data checkLinus Walleij
If no platform data at all is supplied the driver crashes, extend the checks to be more careful so we can compile in the driver and boot also without platform data present. Acked-by: Arun Murthy <arun.murthy@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05max17042_battery: Handle irq request failure caseRamakrishna Pallala
suspend/resume functions take action based upon the fuel gauge interrupt. If the rquest irq fails we should assign 0 to client->irq. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04max17042_battery: Fix power supply and irq registration orderingRamakrishna Pallala
IRQ registration should happen only after power supply object usable. This patch fixes the ordering of power supply and irq registration calls. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04power_supply: Make the core a boolean instead of a tristateAnton Vorontsov
On Mon, Apr 02, 2012 at 01:53:23PM +1000, Benjamin Herrenschmidt wrote: > > drivers/built-in.o: In function `.nouveau_pm_trigger': > > (.text+0xa56e8): undefined reference to `.power_supply_is_system_supplied' > > > > nouveau probably needs to depends on CONFIG_POWER_SUPPLY to force a module > > build with the latter is =m > > Ok, not that trivial... > > The problem is more like POWER_SUPPLY should be a bool, not a tristate. > > If you think about it: you don't want things like nouveau to depend on a > random subsystem like that, people will never get it. In fact, > POWER_SUPPLY provides empty inline stubs when not enabled, so that's > really designed to not have depends... > > However that -cannot- work if POWER_SUPPLY is modular and the drivers > who use it are not. > > The only fixes here that make sense I can think of > that don't also involve Kconfig horrors are: > > - Ugly: in power_supply.h, use the extern variant if > > defined(CONFIG_POWER_SUPPLY) || > (defined(CONFIG_POWER_SUPPLY_MODULE) && defined(MODULE)) > > IE. use the stub if power supply is a module and what is being built is > built-in. Of course that's not only ugly, it somewhat sucks from a user > perspective as the subsystem now exists but can't be used by some > drivers... > > - Better: Just make the bloody thing a bool :-) The power supply > framework itself is small enough, just make it a boolean option and > avoid the problem entirely. The actual power supply sub drivers can > remain modular of course. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-05-04power_supply: Add voltage_ocv property and use it for max17042 driverRamakrishna Pallala
This adds a new sysfs file called 'voltage_ocv' which gives the Open Circuit Voltage of the battery. This property can be used for platform shutdown policies and can be useful for initial capacity estimations. Note: This patch is generated against linux-next branch. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04max17042_battery: Move dev_pm_ops struct under CONFIG_PMAnton Vorontsov
This is what we do for the rest of the drivers, saves some bytes. Plus a small style change while at it. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04max17042_battery: Add suspend/resume hooksRamakrishna Pallala
This patch adds suspend/resume methods to the driver. In suspend method irq line is disabled to avoid i2c read/write errors from the interrupt handler as the i2c bus itself could be in suspend state. In resume function irq line will be re-enabled. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04max17042_battery: Fix driver exit functionRamakrishna Pallala
This patch fixes driver's remove function: it should free the IRQ. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04max17042_battery: Fix a couple buffer overflowsDan Carpenter
There are a couple issues here caused by confusion between sizeof() and ARRAY_SIZE(). "table_size" should be the number of elements, but we should allocate it with kcalloc() so that we allocate the correct number of bytes. In max17042_init_model() we don't allocate enough space so we go past the end of the array in max17042_read_model_data() and max17042_model_data_compare(). In max17042_verify_model_lock() we allocate the right amount of space but we call max17042_read_model_data() with the wrong number of elements and also in the for loop we go past the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Dirk Brandewie <dirk.brandewie@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-04-08Merge branch 'master' into for-nextJiri Kosina
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
2012-04-05Fix typo milivolt => millivoltThomas Weber
Signed-off-by: Thomas Weber <thomas@tweber.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-03-30Merge tag 'for-v3.4-rc1' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull battery updates from Anton Vorontsov: "Various small bugfixes and enhancements, plus two new drivers: - A quite complex ab8500 charger driver, submitted by Arun Murthy @ ST-Ericsson; - Summit Microelectronics SMB347 Battery Charger, submitted by Bruce E Robertson and Alan Cox @ Intel. And that's all." * tag 'for-v3.4-rc1' of git://git.infradead.org/battery-2.6: (36 commits) max17042_battery: Clean up interrupt handling Revert "max8998_charger: Include linux/module.h just once" ab8500_fg: Fix some build warnings on x86_64 max17042_battery: Fix CHARGE_FULL representation. max8998_charger: Include linux/module.h just once power_supply: Convert i2c drivers to module_i2c_driver lp8727_charger: Add MODULE_DEVICE_TABLE charger-manager: Simplify charger_get_property(), get rid of a warning charger-manager: Clean up for better readability da9052-battery: Convert to use module_platform_driver da9052-battery: Fix a memory leak when unload the module da9052-battery: Add missing platform_set_drvdata ab8500: Turn unneeded global symbols into local ones ab8500_fg: Fix copy-paste error ab8500_fg: Get rid of 'struct battery_type' ab8500_fg: Get rid of 'struct v_to_cap' ab8500_btemp: Get rid of 'enum adc_therm' ab8500_charger: Convert to the new USB OTG calls ab8500-btemp: AB8500 battery temperature driver ab8500-fg: A8500 fuel gauge driver ...
2012-03-26max17042_battery: Clean up interrupt handlingRamakrishna Pallala
Max17042 driver has dummy hardIRQ function which does nothing but waking the threaded handler. This patch removes the hardIRQ function and also modifies the interrupt type to falling edge. While we are there, change the macros to comply with the Data sheet. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26Revert "max8998_charger: Include linux/module.h just once"Anton Vorontsov
This reverts commit 0c7b5558ecc0a508bb7199776afbf18279595539. linux-next has the following patch: - - - - commit 13ae246db4a02971ef4f557af1f6d3e21d64b710 Author: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Sun Jan 29 15:44:45 2012 -0500 includecheck: delete any duplicate instances of module.h - - - - It removes the other instance of include/module.h in this driver, and so both gets removed. This makes max8998 driver non-buildable. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26ab8500_fg: Fix some build warnings on x86_64Anton Vorontsov
Noticed the following warnings: CC drivers/power/ab8500_fg.o drivers/power/ab8500_fg.c: In function 'charge_full_store': drivers/power/ab8500_fg.c:2258:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat] drivers/power/ab8500_fg.c: In function ‘charge_now_store’: drivers/power/ab8500_fg.c:2280:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat] This patch fixes the issues. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26max17042_battery: Fix CHARGE_FULL representation.MyungJoo Ham
CHARGE_FULL should represent the full capacity of the battery in uAh. The 0x10 (FullCAP) register shows the compensated full capacity in mAh * 2; e.g., reg(0x10) = 0xBB8 means that it is 1500mAh. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26max8998_charger: Include linux/module.h just onceJesper Juhl
Remove the duplicate. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26power_supply: Convert i2c drivers to module_i2c_driverAxel Lin
Factor out some boilerplate code for i2c driver registration into module_i2c_driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Woogyom Kim <milo.kim@ti.com> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Peter Edwards <sweetlilmre@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>