History log of /drivers/power/twl4030_charger.c
Revision Date Author Comments
61a7784efd3c89ffb6242f29bcee170dd7f55e6b 28-May-2014 Nishanth Menon <nm@ti.com> power: twl4030_charger: detect battery presence prior to enabling charger

TWL4030's Battery Charger seems to be designed for non-hotpluggable
batteries.

If battery is not present in the system, BATSTS is always set with the
expectation that software will take actions to move to a required safe
state (could be power down or disable various charger paths).

It does not seem possible even by manipulating the edge detection
of the event (using BCIEDR2 register) to have a consistent hotplug
handling. This seems to be the result of BATSTS interrupt generated
when the thermistor of the battery pack is disconnected from the
dedicated ADIN1 pin. Clearing the status just results in the status
being regenerated by the monitoring ADC(MADC) and disabling the
edges of event just makes hotplug no longer function. The only
other option is to disable the detection of the MADC by disabling
BCIMFEN4::BATSTSMCHGEN (battery presence detector) - but then, we can
never again detect battery reconnection.

So, detect battery presence based on precharge(which is hardware
automatic state) or default main charger configuration at the time of
probe and enable charger logic only if battery was present.

Reported-by: Russell King <linux@arm.linux.org.uk>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
ec0b380245d7b7d4d8e4201facca780a14352cda 31-Oct-2013 NeilBrown <neilb@suse.de> twl4030_charger: Add devicetree support

This allows the charger to be enabled with devicetree, and allows the
parameters for charging the backup battery to be set.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Kumar Gala <galak@codeaurora.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
697be361d2b3fd7760869341d7ce805092a5c1e5 21-Aug-2013 Peter Ujfalusi <peter.ujfalusi@ti.com> twl4030-charger: Fix compiler warning with regulator_enable()

The return value of regulator_enable need to be checked. This patch fixes
the following warning:
drivers/power/twl4030_charger.c: In function ‘twl4030_charger_enable_usb’:
drivers/power/twl4030_charger.c:192:20: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
0f1e0169e08e1645a8406ab84286ebaf19c5cce5 06-May-2013 Jingoo Han <jg1.han@samsung.com> twl4030_charger: Remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on
probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is
not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
4420dc200084120955a7b81a5f012d6b4ab0974d 05-Mar-2013 Jingoo Han <jg1.han@samsung.com> twl4030_charger: Use module_platform_driver_probe()

This patch uses module_platform_driver_probe() macro which makes the code
smaller and simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
e9f14c18b83ccf3ab291b83a1d6c640113ecf545 13-Nov-2012 Peter Ujfalusi <peter.ujfalusi@ti.com> twl4030_charger: Change TWL4030_MODULE_* ids to TWL_MODULE_*

To facilitate upcoming cleanup in twl stack. No functional changes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
a2778b0fe15d7adfe65b092ae842510c6c031370 23-Aug-2012 Fengguang Wu <fengguang.wu@intel.com> twl4030_charger: Use IRQF_ONESHOT

Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
94b05cabc07d7ebb4f9d2f2dce6ab7db20f7fbac 17-Aug-2012 Il Han <corone.il.han@gmail.com> twl4030_charger: It would be better not to use the 0b-prefix

It would be better not to use the 0b-prefix for earlier versions of
gcc-4.3.

Signed-off-by: Il Han <corone.il.han@gmail.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
ded017ee6c7b90f7356bd8488f8af1c10ba90490 26-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: phy: fix return value check of usb_get_phy

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>
662dca54ca67c92b7aa14b9a2ec54acacf33ce45 22-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: otg: support for multiple transceivers by a single controller

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>
721002ec1dd55a52425455826af49cf8853b2d4f 22-Jun-2012 Kishon Vijay Abraham I <kishon@ti.com> usb: otg: utils: rename function name in OTG utils

_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>
ab37813f4093a5f59cb8e083cde277289dc72ed3 08-May-2012 NeilBrown <neilb@suse.de> twl4030_charger: Allow charger to control the regulator that feeds it

The charger needs usb3v1 to be running, so add a new consumer to
keep it running.

This allows the charger to draw current even when the USB driver has
powered down.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
210d4bc8a3128e3e61ac3bf4657114f8e6450e2a 08-May-2012 NeilBrown <neilb@suse.de> twl4030_charger: Add backup-battery charging

This allows a voltage and current (bb_uvolts and bb_uamps) to be
specified in the platform_data, and charging of the backup battery will
be enabled with those specification.

As it is not possible to monitor the backup battery at all there is no
new device created to represent it.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
9c645d2f887bd92df487b2c5dcd44d5fc0e7c761 08-May-2012 NeilBrown <neilb@suse.de> twl4030_charger: Fix some typos

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
fcc8ebc99034bae4020a3cec030553d469e265db 13-Feb-2012 Heikki Krogerus <heikki.krogerus@linux.intel.com> power_supply: Convert all users to new usb_phy

Use the new usb_phy_* functions instead of the old
otg_* ones.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
8675381109b0eb1c948a423c2b35e3f4509cb25e 13-Feb-2012 Heikki Krogerus <heikki.krogerus@linux.intel.com> usb: otg: Rename otg_transceiver to usb_phy

This is the first step in separating USB transceivers from
USB OTG utilities.

Includes fixes to IMX code from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
28d48f04ead41438f14d167fe61fd179de7029f3 03-Jun-2011 Grazvydas Ignotas <notasas@gmail.com> twl4030_charger: Fix warnings

Fix warnings emitted by some versions of gcc:
drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversion

While at it, also fix module_param permissions and a typo in my name.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
d6ccc442b12102414c1343f0adacaa8a1aaa516c 25-Feb-2011 Heikki Krogerus <heikki.krogerus@nokia.com> twl4030_charger: Make the driver atomic notifier safe

This queues work from the otg notification where the
i2c operations can be safely made. Needed for atomic otg
notifiers.

Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2e727f1787e311087950711451e6eec82c05d81c 27-Sep-2010 Grazvydas Ignotas <notasas@gmail.com> power_supply: Add driver for TWL4030/TPS65950 BCI charger

TWL4030/TPS65950 is a multi-function device with integrated charger,
which allows charging from AC or USB. This driver enables the charger
and provides several monitoring functions.

Tested on OMAP3 Pandora board.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>