summaryrefslogtreecommitdiffstats
path: root/drivers/power
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | smb347-charger: Convert to regmap APIMika Westerberg2012-05-052-327/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | smb347-charger: Move IRQ enabling to the end of probeMika Westerberg2012-05-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | smb347-charger: Rename few functions to match better what they are doingMika Westerberg2012-05-051-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | smb347-charger: Convert to use module_i2c_driver()Mika Westerberg2012-05-051-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | smb347_charger: Cleanup power supply registration code in probeRamakrishna Pallala2012-05-051-30/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ab8500: Clean up probe routinesLee Jones2012-05-053-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ab8500_fg: Harden platform data checkLinus Walleij2012-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ab8500_btemp: Harden platform data checkLinus Walleij2012-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | ab8500_charger: Harden platform data checkLinus Walleij2012-05-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Handle irq request failure caseRamakrishna Pallala2012-05-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Fix power supply and irq registration orderingRamakrishna Pallala2012-05-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | power_supply: Make the core a boolean instead of a tristateAnton Vorontsov2012-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | power_supply: Add voltage_ocv property and use it for max17042 driverRamakrishna Pallala2012-05-042-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Move dev_pm_ops struct under CONFIG_PMAnton Vorontsov2012-05-041-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Add suspend/resume hooksRamakrishna Pallala2012-05-041-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Fix driver exit functionRamakrishna Pallala2012-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | max17042_battery: Fix a couple buffer overflowsDan Carpenter2012-05-041-6/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge tag 'mfd-3.5-1' of ↵Linus Torvalds2012-05-291-8/+13
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * | mfd: Convert wm831x to irq_domainMark Brown2012-05-201-8/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' into for-nextJiri Kosina2012-04-0825-271/+11345
|\ \ | |/ | | | | | | | | | | | | 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
| * Merge tag 'for-v3.4-rc1' of git://git.infradead.org/battery-2.6Linus Torvalds2012-03-3016-195/+10368
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| | * max17042_battery: Clean up interrupt handlingRamakrishna Pallala2012-03-261-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Revert "max8998_charger: Include linux/module.h just once"Anton Vorontsov2012-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * ab8500_fg: Fix some build warnings on x86_64Anton Vorontsov2012-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * max17042_battery: Fix CHARGE_FULL representation.MyungJoo Ham2012-03-261-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * max8998_charger: Include linux/module.h just onceJesper Juhl2012-03-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * power_supply: Convert i2c drivers to module_i2c_driverAxel Lin2012-03-266-74/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * lp8727_charger: Add MODULE_DEVICE_TABLEAxel Lin2012-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add MODULE_DEVICE_TABLE to setup modalias for lp8727. Allows auto modprobing. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * charger-manager: Simplify charger_get_property(), get rid of a warningAnton Vorontsov2012-03-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following warning and makes the code a little bit more simpler: CC drivers/power/charger-manager.o charger-manager.c: In function 'charger_get_property': charger-manager.c:429:15: warning: 'i' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * charger-manager: Clean up for better readabilityAxel Lin2012-03-261-35/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch includes below changes: * Some code change for better readability. * Current code in probe already ensures desc->charger_regulators is not NULL. No need to check if it is NULL or not before calling regulator_bulk_free(). * Use dev_get_drvdata() in cm_suspend_prepare() and cm_suspend_complete() Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * da9052-battery: Convert to use module_platform_driverAxel Lin2012-03-261-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * da9052-battery: Fix a memory leak when unload the moduleAxel Lin2012-03-261-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * da9052-battery: Add missing platform_set_drvdataAxel Lin2012-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add missing platform_set_drvdata in da9052_bat_probe. Otherwise, calling platform_get_drvdata in da9052_bat_remove returns NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500: Turn unneeded global symbols into local onesAnton Vorontsov2012-03-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch fixes the following sparse warning: drivers/power/ab8500_charger.c:1619:6: warning: symbol 'ab8500_charger_detect_usb_type_work' was not declared. Should it be static? drivers/power/abx500_chargalg.c:1709:24: warning: symbol 'abx500_chargalg_sysfs_ops' was not declared. Should it be static? drivers/power/ab8500_fg.c:2328:24: warning: symbol 'ab8500_fg_sysfs_ops' was not declared. Should it be static? Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500_fg: Fix copy-paste errorAnton Vorontsov2012-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ab8500_fg_discharge_state_to() function should accept 'enum ab8500_fg_discharge_state' argument, not 'enum ab8500_fg_charge_state'. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500_fg: Get rid of 'struct battery_type'Anton Vorontsov2012-03-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct is duplicated, plus causes the following flood: CC drivers/power/ab8500_fg.o ab8500_fg.c: In function ‘ab8500_fg_get_ext_psy_data’: b8500_fg.c:2081:8: warning: assignment from incompatible pointer type [enabled by default] Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500_fg: Get rid of 'struct v_to_cap'Anton Vorontsov2012-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct is duplicated, plus when used it causes the following warnings: CHECK drivers/power/ab8500_fg.c ab8500_fg.c:818:13: warning: incorrect type in assignment (different base types) ab8500_fg.c:818:13: expected struct v_to_cap *tbl ab8500_fg.c:818:13: got struct abx500_v_to_cap *const v_to_cap_tbl CC drivers/power/ab8500_fg.o ab8500_fg.c: In function 'ab8500_fg_volt_to_capacity': ab8500_fg.c:818:6: warning: assignment from incompatible pointer type [enabled by default] Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500_btemp: Get rid of 'enum adc_therm'Anton Vorontsov2012-03-261-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the same as abx500_adc_therm, but when the former is used, the following warning flood pops up: drivers/power/ab8500_btemp.c: In function 'ab8500_btemp_batctrl_volt_to_res': ab8500_btemp.c:150:25: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] ab8500_btemp.c: In function 'ab8500_btemp_curr_source_enable': ab8500_btemp.c:212:25: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] ab8500_btemp.c:244:32: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] ab8500_btemp.c: In function 'ab8500_btemp_measure_temp': ab8500_btemp.c:462:25: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] ab8500_btemp.c: In function 'ab8500_btemp_id': ab8500_btemp.c:528:121: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] ab8500_btemp.c:551:25: warning: comparison between 'enum abx500_adc_therm' and 'enum adc_therm' [-Wenum-compare] This patch fixes the issue by switching the driver to use more namespace-friendly enum. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500_charger: Convert to the new USB OTG callsAnton Vorontsov2012-03-261-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following build errors: ab8500_charger.c: In function 'ab8500_charger_remove': ab8500_charger.c:2519:2: error: implicit declaration of function 'otg_unregister_notifier' [-Werror=implicit-function-declaration] ab8500_charger.c:2520:2: error: implicit declaration of function 'otg_put_transceiver' [-Werror=implicit-function-declaration] ab8500_charger.c: In function 'ab8500_charger_probe': ab8500_charger.c:2688:2: error: implicit declaration of function 'otg_get_transceiver' [-Werror=implicit-function-declaration] ab8500_charger.c:2688:10: warning: assignment makes pointer from integer without a cast [enabled by default] ab8500_charger.c:2695:2: error: implicit declaration of function 'otg_register_notifier' [-Werror=implicit-function-declaration] Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500-btemp: AB8500 battery temperature driverArun Murthy2012-03-263-0/+1136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is responsible for battery detection, obtaining battery temperature and monitor the battery temperature by taking precautionary measurements when battery temperature goes beyond or below the thresholds. Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500-fg: A8500 fuel gauge driverArun Murthy2012-03-261-0/+2636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is responsible for provide battery parameters to user space via sysfs by registers to power supply class. It uses fuel gauge and gpadc driver in obtaining the battery parameters. These battery properties are used by abx500 charging algorithm driver to monitor the battery. Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * ab8500-charger: AB8500 charger driverArun Murthy2012-03-261-0/+2789
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is responsible for detecting the ac/usb plugin and also includes function to enable ac/usb charging and re-kick the watchdog. It registers with the power supply class and provides information to the user space. The information include status of ac/usb charger device. This information in turn will be used by the abx500 charging algorithm driver to enable/disable and monitor charging. Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * abx500-chargalg: Add abx500 charging algorithmArun Murthy2012-03-261-0/+1921
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a charging algorithm driver for abx500 variants. It is the central entity for battery driver and is responsible for charging and monitoring the battery driver. It is a hardware independant driver and also monitors other abx500 power supply devices. Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * Add I2C driver for Summit Microelectronics SMB347 Battery Charger.Bruce E. Robertson2012-03-263-0/+1302
| | | | | | | | | | | | | | | | | | | | | | | | | | | Driver support for the Summit I²C battery charger. This is used in some Intel devices. Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * isp1704_charger: Fix probe error pathFelipe Contreras2012-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | We enable power, but don't disable it in case of an error. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * lp8727_charger: Correct typos on the commentKim, Milo2012-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | intergrated charger -> integrated charger ^ Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * lp8727_charger: Fix wrong code styleKim, Milo2012-03-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Definition of STATUS2 : remove space before tabs. Return code of lp8727_is_dedicated_charger(), lp8727_is_usb_charger() : remove parentheses when return is not a function. MODULE_AUTHOR section : remove space at the start of a line. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * lp8727_charger: Change i2c functionsKim, Milo2012-03-261-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On writing single byte via i2c, use i2c_smbus_write_byte_data() rather than i2c_smbus_write_i2c_block_data(). Name changes : lp8727_i2c_read() -> lp8727_read_bytes() lp8727_i2c_write() -> removed lp8727_i2c_read_byte() -> lp8727_read_byte() lp8727_i2c_write_byte() -> lp8727_write_byte() Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * lp8727_charger: Add error check routine on probe()Kim, Milo2012-03-261-18/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add error checking on initializing registers and interrupt handler. Initializing registers - lp8727_init_device() : check i2c error during probing the driver. Initializing interrupt handler - lp8727_intr_config() : check an error on creating the irq thread. If an error occurs on probing lp8727 driver, allocated lp8727 driver memory is freed. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
| | * lp8727_charger: Add company name and descriptionKim, Milo2012-03-262-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add 'Texas Instruments' because TI acquired National semiconductor at 2011. And the driver information is added in the header file. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
OpenPOWER on IntegriCloud