Age | Commit message (Collapse) | Author | Files | Lines |
|
There is no dynamic information in cpcap-battery's
power-supply description struct, so let's make it
static const.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Fix typo
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
[[email protected]: separated out from charger changes]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Add charge_now property for capacity reporting.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Arthur Demchenkov <[email protected]>
[[email protected]: updated to apply for naming changes]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Calculate percentage using charge_full value provided.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Arthur Demchenkov <[email protected]>
[[email protected]: updated to apply after dropping my earlier patch]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Save the battery empty and full states so we can use those to estimate
the battery capacity in the following patches.
If the user provides us with charge_full value (which it could save in a
permanent storage between reboots), initialize low and high counter_uah
with calculated values.
If we hit battery low once, we should stick on reporting it until the
charger is connected. This way low->counter_uah will be updated
properly, and that will allow us to get more accurate charge_full value.
Based on an earlier patch by Tony Lindgren with charge_full usage and
other improvments done by Arthur Demchenkov.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Co-developed-by: Tony Lindgren <[email protected]>
Signed-off-by: Arthur Demchenkov <[email protected]>
[[email protected]: combined earlier patches, updated comments]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Add charge_full property and let user update it. This is needed for
capacity reporting in the following patches.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Arthur Demchenkov <[email protected]>
[[email protected]: updated comments]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
We now get battery full notification from cpcap-charger, so let's use that
for battery full status and charger disconnect.
Note that any current based battery full detection we have tried earlier is
flakey as it won't account for example for CPU load increasing the battery
current. Anyways, if current based battery full detection is also still
needed, we can reconsider adding it in addition to the charger status based
detection.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
We want to have the battery update it's status when the charge is done,
and when the charger is disconnected. Otherwise the battery does not know
when it's full unless there's a userspace app polling the battery status.
To do this, we add supplied_to handling to cpcap-battery, and implement
power_supply_changed() for cpcap-charger. When cpcap-charger calls
power_supply_changed(), cpcap-battery will update it's status.
Let's also use new_state variable for the POWER_SUPPLY_STATUS_CHARGING
case to have unified handling for the switch.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Let's turn cpcap_charger_set_state() into separate cpcap_charger_enable()
and cpcap_charger_disable() to simplify things, and to allow managing
status separately. This can be then used for the follow-up patches to
make battery full status behave a bit nicer.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
We currently have both state and status, get rid of state and use
generic status instead.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Droid 4 has same problem as N900: it is often necessary to manually
tweak current draw from USB, for example when using thin charging cable.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
[[email protected]: rebased, cleaned up whitespace issues, updated comments]
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Just get rid of the custom enumeration if favor of the standard one.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
This should be only shown when debug is enabled.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
If we have a USB charger connected, reboot is flakey and often fails to
reboot the device with the charger LED staying on.
Let's fix this by implementing .shutdown.
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Fix missing power_supply_put().
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Fixes: 8b0134cc14b9 ("power: supply: cpcap-battery: Fix handling of lowered charger voltage")
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Fix missing power_supply_put().
Cc: Arthur Demchenkov <[email protected]>
Cc: Carl Philipp Klemm <[email protected]>
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Fixes: 5688ea049233 ("power: supply: cpcap-charger: Allow changing constant charge voltage")
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
This patch adds battery gauge driver for Acer Iconia Tab A500 device.
The battery gauge function is provided via the Embedded Controller,
which is found on the Acer A500.
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
overrun
Corrects BQ256XX_NUM_WD_VAL from value of "8" to "4" and fixes the issue when 'i'
is equal to array size then array index over runs the array
Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Immutable branch between mach-pxa and power-supply for for 5.12
This immutable branch replaces legacy gpio API in wm97xx_battery and
z2_battery with new gpiod API, which involves the drivers in
power-supply and some mach-pxa board files.
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
This converts the WM97xx driver to use a GPIO descriptor
instead of passing a GPIO number thru platform data.
Like everything else in the driver, use a simple local
variable for the descriptor, it can only ever appear in
one instance anyway so it should not hurt.
After converting the driver I noticed that none of the
boardfiles actually define a meaningful GPIO line for
this, but hey, it is converted.
Cc: Haojian Zhuang <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Daniel Mack <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
This converts the Palm Z2 battery driver to use GPIO descriptors.
Cc: Haojian Zhuang <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Daniel Mack <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
This driver provides poweroff and reboot support for a system through
the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x
family of PMICs.
Signed-off-by: Cristian Ciocaltea <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The only usage of it is to put its address in an array of pointers to
const static structs. Make it const to allow the compiler to put it in
read-only memory.
Signed-off-by: Rikard Falkeborn <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The only usage of it is to put its address in an array of pointers to
const static structs. Make it const to allow the compiler to put it in
read-only memory.
Signed-off-by: Rikard Falkeborn <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Add support for the LTC4162-L Li-Ion battery charger. The driver allows
reading back telemetry and to set some charging options like the input
current limit.
Signed-off-by: Mike Looijmans <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The MAX8903 uses up to 5 different GPIO lines to control and
monitor charging.
When converting to use GPIO descriptors instead of the old
GPIO numbers the following side-refactorings were done:
- Decomission the platform data container struct as all
GPIO descriptors are now "live" members of the driver
state container. The "dc_valid" and "usb_valid" just
indicate the presence of a DC or USB charger detection
line, and this can be handled by just checking if
the optional GPIO descriptor for each is != NULL.
- The gpiolib will now respect the GPIO_ACTIVE_LOW flag
for each of the lines, meaning gpiod_get_value() for example
will return 1 (asserted) if a line is flagged as
active low and is also physically low. The same applies
to output lines, vice versa mutatis mutandis. The code
has been augmented to account for this in all sites.
- The terse parenthesis such as this:
gpio_set_value(pdata->cen, ta_in ? 0 :
(data->usb_in ? 0 : 1));
have been expanded to more readable if / else if / else
statements that are easier for humans to read.
- Comments were inserted to underscore polarity in each
case where it could be confusing to users of the old code.
One thing is notable: the device tree bindings does not show
an example of polarity assigned for the line "dcm-gpios"
DC current monitor, is assumed to be flagged GPIO_ACTIVE_HIGH
and driving it high (asserted) will achieve DC charger current
limits and driving it low will achieve USB charger current
limits. Device trees with this (optional) GPIO line defined
should definately be flagged as GPIO_ACTIVE_HIGH.
Cc: Chris Lapa <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The platform data header is not included by any other file in
the kernel but the driver itself. Decomission the stand-alone
header and absorb it into the driver itself.
Cc: Chris Lapa <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The driver includes two GPIO headers but does not use
symbols from any of them, so drop these includes.
Cc: Alexander Kurz <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
'HWMON_T_INPUT' and 'HWMON_T_MIN_ALARM' in power_supply_hwmon_info are
duplicated and can be removed.
Signed-off-by: Menglong Dong <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The Mele PCG03 is another mini PC using the AXP288 PMIC where the EFI
code does not disable the charger part of the PMIC causing us to report
a discharging battery with a random battery charge to userspace.
Add it to the deny-list to avoid the bogus battery status reporting.
Cc: Rasmus Porsager <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The BQ256XX family of devices are highly integrated buck chargers
for single cell batteries.
Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Add the bindings for the bq256xx series of battery charging ICs.
Datasheets:
- https://www.ti.com/lit/ds/symlink/bq25600.pdf
- https://www.ti.com/lit/ds/symlink/bq25601.pdf
- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
- https://www.ti.com/lit/ds/symlink/bq25618.pdf
- https://www.ti.com/lit/ds/symlink/bq25619.pdf
Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
"disconnected"
There is a spelling mistake in a dev_dbg message. Fix it.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Register for extcon notification and set charging current depending on
the detected cable type. Current values are taken from vendor kernel,
where most charger types end up setting 650mA [0].
Also enable and disable the CHARGER regulator based on extcon events.
[0] https://github.com/krzk/linux-vendor-backup/blob/samsung/galaxy-s2-epic-4g-touch-sph-d710-exynos4210-dump/drivers/misc/max8997-muic.c#L1675-L1678
Signed-off-by: Timon Baetz <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Commit 25d76fed7ffe ("phy: cpcap-usb: Use IRQF_ONESHOT") started causing
errors loading phy-cpcap-usb driver:
cpcap_battery cpcap_battery.0: failed to register power supply
genirq: Flags mismatch irq 211. 00002080 (se0conn) vs. 00000080 (se0conn)
cpcap-usb-phy cpcap-usb-phy.0: could not get irq se0conn: -16
Let's fix this by adding the missing IRQF_ONESHOT to also cpcap-battery
and cpcap-charger drivers.
Fixes: 25d76fed7ffe ("phy: cpcap-usb: Use IRQF_ONESHOT")
Reported-by: Merlijn Wajer <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
A semicolon is not needed after a switch statement.
Signed-off-by: Tom Rix <[email protected]>
Acked-by: Paul Cercueil <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
Adds a module option to ignore a missing temperature sensor.
Useful for 3rd party batteries.
Signed-off-by: Carl Philipp Klemm <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
The of_mdio_find_bus() takes a reference to the underlying device
structure, we should release that reference using a put_device() call.
Signed-off-by: Daniel González Cabanelas <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
|
|
|
|
Since commit 36e2c7421f02 ("fs: don't allow splice read/write without
explicit ops") we've required that file operation structures explicitly
enable splice support, rather than falling back to the default handlers.
Most /proc files use the indirect 'struct proc_ops' to describe their
file operations, and were fixed up to support splice earlier in commits
40be821d627c..b24c30c67863, but the mountinfo files interact with the
VFS directly using their own 'struct file_operations' and got missed as
a result.
This adds the necessary support for splice to work for /proc/*/mountinfo
and friends.
Reported-by: Joan Bruguera Micó <[email protected]>
Reported-by: Jussi Kivilinna <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=209971
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Pull NTB fixes from Jon Mason:
"Bug fix for IDT NTB and Intel NTB LTR management support"
* tag 'ntb-5.11' of git://github.com/jonmason/ntb:
ntb: intel: add Intel NTB LTR vendor support for gen4 NTB
ntb: idt: fix error check in ntb_hw_idt.c
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"Fix a number of autobuild failures due to missing Kconfig
dependencies"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: qat - add CRYPTO_AES to Kconfig dependencies
crypto: keembay - Add dependency on HAS_IOMEM
crypto: keembay - CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 should depend on ARCH_KEEMBAY
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fix from Ingo Molnar:
"Fix a segfault that occurs when built with Clang"
* tag 'objtool-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Fix seg fault with Clang non-section symbols
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar:
"Misc fixes/updates:
- Fix static keys usage in module __init sections
- Add separate MAINTAINERS entry for static branches/calls
- Fix lockdep splat with CONFIG_PREEMPTIRQ_EVENTS=y tracing"
* tag 'locking-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
softirq: Avoid bad tracing / lockdep interaction
jump_label/static_call: Add MAINTAINERS
jump_label: Fix usage in module __init
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar:
"Update/fix two CPU sanity checks in the hotplug and the boot code, and
fix a typo in the Kconfig help text.
[ Context: the first two commits are the result of an ongoing
annotation+review work of (intentional) tick_do_timer_cpu() data
races reported by KCSAN, but the annotations aren't fully cooked
yet ]"
* tag 'timers-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timekeeping: Fix spelling mistake in Kconfig "fullfill" -> "fulfill"
tick/sched: Remove bogus boot "safety" check
tick: Remove pointless cpu valid check in hotplug code
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Ingo Molnar:
"Fix a context switch performance regression"
* tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched: Optimize finish_lock_switch()
|
|
Commit c9a3c4e637ac ("mfd: ab8500-debugfs: Remove extraneous curly
brace") removed a left-over curly brace that caused build failures, but
Joe Perches points out that the subsequent 'seq_putc()' should also be
removed, because the commit that caused all these problems already added
the final '\n' to the seq_printf() above it.
Reported-by: Joe Perches <[email protected]>
Fixes: 886c8121659d ("mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc")
Cc: Thomas Gleixner <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:
- Fix a tegra enumeration regression (Rob Herring)
- Fix a designware-host check that warned on *success*, not failure
(Alexander Lobakin)
* tag 'pci-v5.11-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: dwc: Fix inverted condition of DMA mask setup warning
PCI: tegra: Fix host link initialization
|
|
Clang errors:
drivers/mfd/ab8500-debugfs.c:1526:2: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
drivers/mfd/ab8500-debugfs.c:1528:2: error: expected identifier or '('
return 0;
^
drivers/mfd/ab8500-debugfs.c:1529:1: error: extraneous closing brace ('}')
}
^
3 errors generated.
The cleanup in ab8500_interrupts_show left a curly brace around, remove
it to fix the error.
Fixes: 886c8121659d ("mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc")
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Commit 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address
allocation") added dma_mask_set() call to explicitly set 32-bit DMA mask
for MSI message mapping, but for now it throws a warning on ret == 0, while
dma_set_mask() returns 0 in case of success.
Fix this by inverting the condition.
[bhelgaas: join string to make it greppable]
Fixes: 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address allocation")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
|