History log of /drivers/power/tps65090-charger.c
Revision Date Author Comments
193dcced049ceacc0cce1a512ad8a1e1a26eedad 20-Jun-2014 Doug Anderson <dianders@chromium.org> charger: tps65090: Allow charger module to be used when no irq

On the ARM Chromebook tps65090 has two masters: the AP (the main
processor running linux) and the EC (the embedded controller). The AP
is allowed to mess with FETs but the EC is in charge of charge control.

The tps65090 interupt line is routed to both the AP and the EC, which
can cause quite a headache. Having two people adjusting masks and
acking interrupts is a recipe for disaster.

In the shipping kernel we had a hack to have the AP pay attention to
the IRQ but not to ack it. It also wasn't supposed to configure the
IRQ in any way. That hack allowed us to detect when the device was
charging without messing with the EC's state.

The current tps65090 infrastructure makes the above difficult, and it
was a bit of a hack to begin with. Rather than uglify the driver to
support it, just extend the driver's existing notion of "no irq" to
the charger. This makes the charger code poll every 2 seconds for AC
detect, which is sufficient.

For proper functioning, requires (mfd: tps65090: Don't tell child
devices we have an IRQ if we don't). If we don't have that patch
we'll simply fail to probe on devices without an interrupt (just like
we did before this patch).

Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
[sre@kernel.org: Use -ENXIO instead of NO_IRQ for missing interrupt,
since NO_IRQ is not available on all architectures.]
Signed-off-by: Sebastian Reichel <sre@kernel.org>
c42ba72ec3a7a1b6aa30122931f1f4b91b601c31 17-Apr-2014 Doug Anderson <dianders@chromium.org> mfd: tps65090: Stop caching most registers

Nearly all of the registers in tps65090 combine control bits and
status bits. Turn off caching of all registers except the select few
that can be cached.

In order to avoid adding more duplicate #defines, we also move some
register offset definitions to the mfd driver (and resolve
inconsistent names).

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
e47bcba4a189ab1ba23072ee2f457b1d72cd22fe 28-Sep-2013 Manish Badarkhe <badarkhe.manish@gmail.com> tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code

Instead of "#if defined(CONFIG_OF)" use "IS_ENABLED(CONFIG_OF)" option
for DT code to avoid if-deffery in code.

Also, arranged header files in alphabetically.

Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
0ed81393235fbf9d3379b55d2ceece1885ea3fae 23-Sep-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> tps65090-charger: Drop devm_free_irq of devm_ allocated irq

The devm_request_irq function allocates irq that is released when a driver
detaches. Thus, there is no reason to explicitly call devm_free_irq in
probe or remove functions.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
605860bc2495cd584fd639f00806591af0b1fefa 10-Jun-2013 Rhyland Klein <rklein@nvidia.com> tps65090-charger: Add dt node to power_supply

Passing in the dt node for this charger enables the logic in the core to
lookup this device, to see if it is supplying another power_supply,
through dt.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
e24142178fc2f60824af4312d326edacdcd667a3 06-Jun-2013 Andrew Chew <achew@nvidia.com> tps65090-charger: Fix AC detect

The VACG interrupt was not being enabled. Thus, interrupts were never
generated when AC status changes. In addition, interrupts were never
cleared after taking and processing the interrupt.

Added the register offset for the INTR_MASK register, since this is needed
to unmask the VACG interrupt.

Enabled the VACG interrupt in tps65090_config_charger().

Cleared interrupts after processing, in tps65090_charger_isr().

Also removed unused variable "enable" in tps65090_enable_charging(), and
fixed a typo in one of the dev_err() prints.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Tested-by: Rhyland Klein <rklein@nvidia.com>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
e08358792422ef0b78d7c81f333fc0803fb41cd4 23-May-2013 Jingoo Han <jg1.han@samsung.com> power: Use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
594f8f888d325591851f419c22e0349263214eff 21-Mar-2013 Rhyland Klein <rklein@nvidia.com> tps65090: Setup compatible property for dt

Setup the compatible property so that when this device is registered
through device tree, it can match the expected compatiblity string used in
the tps65090 driver.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
6f8da5df8c451103e0043f73a00c90676da6be9e 12-Mar-2013 Rhyland Klein <rklein@nvidia.com> power_supply: Add support for tps65090-charger

This patch adds support for the tps65090 charger driver. This driver is
responsible for controlling the charger aspect of the tps65090 mfd.
Currently, this mainly consists of turning on and off the charger, but
some features of the charger can be supported through this driver
including:

- Enable Auto Recharge based on Battery voltage
- Fast Charge Safety Timer
- Maximum battery discharge current
- Maximum battery adapter current
- Enable External Charge
- Disable charging termination based on low charger current (supported)

Once the driver is accepted, later patches can add support for the
features above which are not yet supported.

Based on work by:

Syed Rafiuddin <srafiuddin@nvidia.com>
Laxman Dewangan <ldewangan@nvidia.com>

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>