- 21 9月, 2012 25 次提交
-
-
由 Kim, Milo 提交于
If the charger is pulled out, just return as DISCHARGING. Then no need for additional 'else' statement. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
Charger has only one valid property - ONLINE. If the property is not ONLINE, then just return quickly. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
Just return with lp8727_write_byte(), no need to check its value. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
To initialize the device, previous interrupts need to be cleared while loading the driver. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
Use devm_kzalloc() rather than kzalloc()/kfree() to make allocating/freeing the private data simpler. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Fengguang Wu 提交于
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: NFengguang Wu <fengguang.wu@intel.com> Acked-by: NFelipe Balbi <balbi@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 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: NFengguang Wu <fengguang.wu@intel.com> Acked-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Anton Vorontsov 提交于
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: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Jett.Zhou 提交于
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: NJett.Zhou <jtzhou@marvell.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Kim, Milo 提交于
TI LP8788 PMU supports regulators, battery charger, RTC, ADC, backlight driver and current sinks. This patch supports the charger operations including the charger interrupt handling. The LP8788 charger driver provides configurable platform data. The charger platform data includes ADC input ID, maximum battery voltage, charging parameters and etc. The ADC input is used for getting the battery voltage and temperature. Charging parameters are used for updating the charger operations such like setting charging current and setting End-of-charge conditions. When the charging interrupt occurs, power supply uevents are generated in order to update the user-space information. For platform specific charger action, the charger_event() function can be used in the platform side. Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Dan Carpenter 提交于
We should decrement "i" before doing the free_irq(). If we call this because request_threaded_irq() failed then we don't want to free the thing which failed. Or in the case where we get here because power_supply_register() failed then the original codes does a read past the end of the array. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Olof Johansson 提交于
Turns out this driver doesn't actually try talking to the device at probe time, so if it's incorrectly configured in the device tree or platform data (or if the battery has been removed from the system), then probe will succeed and every access will sit there and time out. The end result is a possibly laggy system that thinks it has a battery but can never read status, which isn't very useful. Instead, just read any register (I chose status) at probe, and if that fails, don't register the device. Signed-off-by: NOlof Johansson <olof@lixom.net> Acked-by: NRhyland Klein <rklein@nvidia.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Ramakrishna Pallala 提交于
This patch checks for charger status register for determining the battery charging status and reports Discharing/Charging/Not Charging/Full accordingly. This patch also adds the interrupt support for Safety Timer Expiration. This interrupt is helpful in debugging the cause for charger fault. Signed-off-by: NRamakrishna Pallala <ramakrishna.pallala@intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Paul Parsons 提交于
When I reboot my iPAQ hx4700 in its cradle, the battery will not begin to charge even though the AC supply is connected. Charging will start only after the PDA power driver is tickled by some other power event, such as reseating the iPAQ in its cradle or connecting the USB cable. The problem lies in pda_power_probe(), where ac_draw is used by the call to update_charger() before being set by the call to regulator_get(). Moving the regulator_get() call to before the update_charger() call fixes the problem. Signed-off-by: NPaul Parsons <lost.distance@yahoo.com> Cc: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
- 23 8月, 2012 15 次提交
-
-
由 Ramakrishna Pallala 提交于
There are different types of chargers avalibale like AC, Solar, USB, etc.. Even in USB we have different types SDP/DCP/CDP/ACA and all these chargers have different o/p ratings. For example SDP supports only 500mA of charge current whereas AC charger can support upto 8A or more. Similarly batteries also come with charge current and voltage ratings and these ratings vary depending on its capacity and the technology used. This patch adds two new power supply properties CONSTANT_CHARGE_CURRENT_MAX and CONSTANT_CHARGE_CURRENT_MAX. Signed-off-by: NRamakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Anton Vorontsov 提交于
The comment says that charger_regulators is an array of regulator_bulk_data, which is not true, since it's actually a pointer to 'struct charger_regulator'. Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Chanwoo Choi 提交于
This patch remove unnecessary variable(cm->fullbatt_vchk_uV) by using 'desc->fullbatt_uV' field directly in fullbatt_handler() function to check the state of battery. Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com> Signed-off-by: NMyungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Chanwoo Choi 提交于
This patch disable regulator for charging when charger cable is detached before stopping charging forcibly on abnormal battery state and check return value of regulator_enable/disable() function to confirm correct operation of enabling or disabling regulator for charging. Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com> Signed-off-by: NMyungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Anton Vorontsov 提交于
Noticed the new warning: CHECK drivers/power/da9030_battery.c drivers/power/da9030_battery.c:190:68: warning: Using plain integer as NULL pointer This commit fixes the issue. Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Ramakrishna Pallala 提交于
It is possible that users can use non-standard chargers or use invalid batteries especially with mobile devices. This patch adds a new power supply property called 'AUTHENTIC' to indicate this to the user(user space). Signed-off-by: NRamakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Devendra Naga 提交于
With devm_kzalloc there is no need of freeing at the errorpath and also at unregister it. Signed-off-by: NDevendra Naga <develkernel412222@gmail.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Devendra Naga 提交于
module_platform_driver can be used to replace the platform_driver register and unregister functions, with the calls to module_init and module_exit, i.e. all the code that is doing like the below static int __init mymod_init(void) { return platform_driver_register(&drv_operations); } static void __exit mymod_exit(void) { platform_driver_unregister(&drv_operations); } module_init(mymod_init); module_exit(mymod_exit); can be replaced with module_platform_driver(drv_operations)... Signed-off-by: NDevendra Naga <develkernel412222@gmail.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Il Han 提交于
It would be better not to use the 0b-prefix for earlier versions of gcc-4.3. Signed-off-by: NIl Han <corone.il.han@gmail.com> Acked-by: NNeilBrown <neilb@suse.de> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Axel Lin 提交于
The fix for MFD part is already merged so we can remove the broken mark for da9052-battery. Signed-off-by: NAxel Lin <axel.lin@gmail.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Anton Vorontsov 提交于
The patch fixes the following warnings: CHECK drivers/power/da9052-battery.c drivers/power/da9052-battery.c:330:15: warning: symbol 'da9052_determine_vc_tbl_index' was not declared. Should it be static? CC drivers/power/da9052-battery.o drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index': drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type] Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Devendra Naga 提交于
if usb power supply registration fails, we wont unregister the ac power supply if battery power supply registration fails, we wont unregister the usb, and ac supply, take care of those things and also no need of goto -err_mem: at the fail case of kzalloc simply can have return -ENOMEM Signed-off-by: NDevendra Naga <develkernel412222@gmail.com> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Julia Lawall 提交于
Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Julia Lawall 提交于
Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-
由 Julia Lawall 提交于
Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
-