<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/power_supply.h, branch v6.2-rc8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.2-rc8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.2-rc8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-09-11T08:52:05Z</updated>
<entry>
<title>power: supply: Explain maintenance charging</title>
<updated>2022-09-11T08:52:05Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2022-07-19T11:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a1c7c1a40478db4edef8ad0a0c6975c8921088b7'/>
<id>urn:sha1:a1c7c1a40478db4edef8ad0a0c6975c8921088b7</id>
<content type='text'>
In order for everyone to understand clearly why we want to use
maintenance charging for batteries, expand the description with two
diagrams and some text.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: Support VBAT-to-Ri lookup tables</title>
<updated>2022-02-28T10:34:32Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2022-02-25T23:27:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9e7d165b4b0413c5b7db74515e4981a226b78a0'/>
<id>urn:sha1:e9e7d165b4b0413c5b7db74515e4981a226b78a0</id>
<content type='text'>
In Samsung devices, the method used to compensate for temperature,
age, load etc is by way of VBAT to Ri tables, which correlates the
battery voltage under load (VBAT) to an internal resistance (Ri).

Using this Ri and a measurement of the current out of the battery
(IBAT) the open circuit voltage (OCV) can be calculated as:

  OCV = VBAT - (Ri * IBAT)

The details are described in comments to struct
power_supply_battery_info in the commit.

Since not all batteries supply this VBAT-to-Ri data, the fallback
method to use the temperature-to-Ri lookup table can also be used
as a fallback.

Add two helper functions to check if we have the tables needed for
using power_supply_vbat2ri() or power_supply_temp2resist_simple()
respectively, so capacity estimation code can choose which one
to employ.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: ab8500: Standardize BTI resistance</title>
<updated>2022-02-28T10:34:31Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2022-02-25T23:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f918e0fe43ec41d906e2cf96b80b15451fed7ba'/>
<id>urn:sha1:1f918e0fe43ec41d906e2cf96b80b15451fed7ba</id>
<content type='text'>
The Battery Type Indicator (BTI) resistor is a resistor mounted
between a special terminal on the battery and ground. By sending
a fixed current (such as 7mA) through this resistor and measuring
the voltage over it, the resistance can be determined, and this
verifies the battery type.

Typical side view of the battery:

  o     o     o
 GND   BTI   +3.8V

Typical example of the electrical layout:

  +3.8 V   BTI
    |       |
    | +     |
 _______   [ ] 7kOhm
   ___      |
    |       |
    |       |
   GND     GND

By verifying this resistance before attempting to charge the
battery we add an additional level of security.

In some systems this is used for plug-and-play of batteries with
different capacity. In other cases, this is merely used to verify
that the right type of battery is connected, if several batteries
have the same physical shape and can be plugged into the same
slot. Sometimes this is just a surplus security mechanism.

Nokia and Samsung among many other vendors are known to use these
BTI resistors.

Add the BTI properties to struct power_supply_battery_info and
switch the AB8500 charger code over to using it.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: ab8500: Standardize alert mode charging</title>
<updated>2022-02-28T10:34:31Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2022-02-25T23:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0e8b903b522b5a3cb473035cea085d396dd7150a'/>
<id>urn:sha1:0e8b903b522b5a3cb473035cea085d396dd7150a</id>
<content type='text'>
The AB8500 code is using a special current and voltage setting
when the battery is in "alert mode", i.e. when it is starting
to go outside normal operating conditions so it is too
cold or too hot. This makes sense as a way for the charging
algorithm to deal with hostile environments.

Add the needed members to the struct power_supply_battery_info,
and switch the AB8500 charging code over to using this.

Reviewed-by: Matti Vaittineen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: ab8500: Standardize maintenance charging</title>
<updated>2022-02-28T10:34:31Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2022-02-25T23:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d72ce7d324786257410bec6b36e3756647dd76fd'/>
<id>urn:sha1:d72ce7d324786257410bec6b36e3756647dd76fd</id>
<content type='text'>
Maintenance charging is the phase of keeping up the charge
after the battery has charged fully using CC/CV charging.

This can be done in many successive phases and is usually
done with a slightly lower constant voltage than CV, and
a slightly lower allowed current.

Add an array of maintenance charging points each with a
current, voltage and safety timer, and add helper functions
to use these. Migrate the AB8500 code over.

This is used in several Samsung products using the AB8500
and these batteries and their complete parameters will
be added later as full examples, but the default battery
in the AB8500 code serves as a reasonable example so far.

Reviewed-by: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: Introduces bypass charging property</title>
<updated>2022-02-24T11:09:20Z</updated>
<author>
<name>Ricardo Rivera-Matos</name>
<email>rriveram@opensource.cirrus.com</email>
</author>
<published>2022-02-15T00:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05f2281b4192320a20d746df6146b3dd82f96e39'/>
<id>urn:sha1:05f2281b4192320a20d746df6146b3dd82f96e39</id>
<content type='text'>
Adds a POWER_SUPPLY_CHARGE_TYPE_BYPASS option to the POWER_SUPPLY_PROP_CHARGE_TYPE
property to facilitate bypass charging operation.

In bypass charging operation, the charger bypasses the charging path around the
integrated converter allowing for a "smart" wall adaptor to perform the power
conversion externally.

This operational mode is critical for the USB PPS standard of power adaptors and is
becoming a common feature in modern charging ICs such as:

- BQ25980
- BQ25975
- BQ25960
- LN8000
- LN8410

Signed-off-by: Ricardo Rivera-Matos &lt;rriveram@opensource.cirrus.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: core: Refactor power_supply_set_input_current_limit_from_supplier()</title>
<updated>2022-02-01T13:55:11Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2022-02-01T13:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2220af8ca61ae67de4ec3deec1c6395a2f65b9fd'/>
<id>urn:sha1:2220af8ca61ae67de4ec3deec1c6395a2f65b9fd</id>
<content type='text'>
Some (USB) charger ICs have variants with USB D+ and D- pins to do their
own builtin charger-type detection, like e.g. the bq24190 and bq25890 and
also variants which lack this functionality, e.g. the bq24192 and bq25892.

In case the charger-type; and thus the input-current-limit detection is
done outside the charger IC then we need some way to communicate this to
the charger IC. In the past extcon was used for this, but if the external
detection does e.g. full USB PD negotiation then the extcon cable-types do
not convey enough information.

For these setups it was decided to model the external charging "brick"
and the parameters negotiated with it as a power_supply class-device
itself; and power_supply_set_input_current_limit_from_supplier() was
introduced to allow drivers to get the input-current-limit this way.

But in some cases psy drivers may want to know other properties, e.g. the
bq25892 can do "quick-charge" negotiation by pulsing its current draw,
but this should only be done if the usb_type psy-property of its supplier
is set to DCP (and device-properties indicate the board allows higher
voltages).

Instead of adding extra helper functions for each property which
a psy-driver wants to query from its supplier, refactor
power_supply_set_input_current_limit_from_supplier() into a
more generic power_supply_get_property_from_supplier() function.

Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86</title>
<updated>2022-01-11T19:26:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-01-11T19:26:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=347708875a2fac81dd99ec826248ec29ac28f441'/>
<id>urn:sha1:347708875a2fac81dd99ec826248ec29ac28f441</id>
<content type='text'>
Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

  New drivers:
   - asus-tf103c-dock
   - intel_crystal_cove_charger
   - lenovo-yogabook-wmi
   - simatic-ipc platform-code + led driver + watchdog driver
   - x86-android-tablets (kernel module to workaround DSDT bugs on
     these)

  amd-pmc:
   - bug-fixes
   - smar trace buffer support

  asus-wmi:
   - support for custom fan curves

  int3472 (camera info ACPI object for Intel IPU3/SkyCam cameras):
   - ACPI core + int3472 changes to delay enumeration of camera sensor
     I2C clients until the PMIC for the sensor has been fully probed
   - Add support for board data (DSDT info is incomplete) for setting up
     the tps68470 PMIC used on some boards with these cameras
   - Add board data for the Microsoft Surface Go (original, v2 and v3)

  thinkpad_acpi:
   - various cleanups
   - support for forced battery discharging (for battery calibration)
   - support to inhibit battery charging
   - this includes power_supply core changes to add new APIs for this

  think_lmi:
   - enhanced BIOS password support

  various other small fixes and hardware-id additions"

* tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (78 commits)
  power: supply: Provide stubs for charge_behaviour helpers
  platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit
  platform/x86: int3472: Add board data for Surface Go 3
  platform/x86: Add Asus TF103C dock driver
  platform/x86: x86-android-tablets: Add TM800A550L data
  platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C data
  platform/x86: x86-android-tablets: Add Asus TF103C data
  platform/x86: x86-android-tablets: Add support for preloading modules
  platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables
  platform/x86: x86-android-tablets: Add support for instantiating serdevs
  platform/x86: x86-android-tablets: Add support for instantiating platform-devs
  platform/x86: x86-android-tablets: Add support for PMIC interrupts
  platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non probe() function
  platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entry
  platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and Pro
  platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet
  platform/x86: Add intel_crystal_cove_charger driver
  power: supply: fix charge_behaviour attribute initialization
  platform/x86: intel-uncore-frequency: use default_groups in kobj_type
  x86/platform/uv: use default_groups in kobj_type
  ...
</content>
</entry>
<entry>
<title>power: supply: Provide stubs for charge_behaviour helpers</title>
<updated>2022-01-08T15:56:01Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2022-01-08T15:31:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3367d1bd738c01b2737eaab7d922bfe5f1a41f38'/>
<id>urn:sha1:3367d1bd738c01b2737eaab7d922bfe5f1a41f38</id>
<content type='text'>
When CONFIG_SYSFS is not enabled provide stubs for the helper functions
to not break their callers.

Fixes: 539b9c94ac83 ("power: supply: add helpers for charge_behaviour sysfs")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://lore.kernel.org/r/20220108153158.189489-1-linux@weissschuh.net
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>power: supply_core: Pass pointer to battery info</title>
<updated>2022-01-03T17:53:10Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2021-12-15T01:01:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=25fd330370ac40653671f323acc7fb6db27ef6fe'/>
<id>urn:sha1:25fd330370ac40653671f323acc7fb6db27ef6fe</id>
<content type='text'>
The function to retrieve battery info (from the device tree) assumes
we have a static info struct that gets populated by calling into
power_supply_get_battery_info().

This is awkward since I want to support tables of static battery
info by just assigning a pointer to all info based on e.g. a
compatible value in the device tree.

We also have a mixture of static and dynamically allocated
variables here.

Bite the bullet and let power_supply_get_battery_info() allocate
also the memory used for the very top level
struct power_supply_battery_info container. Pass pointers
around and lifecycle this with the psy device just like the
stuff we allocate inside it.

Change all current users over.

As part of the change, initializers need to be added to some
previously uninitialized fields in struct
power_supply_battery_info.

Reviewed-By: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
