On a Thinkpad 13 $ cat /sys/class/dmi/id/product_version ThinkPad S2 the battery name is BAT1, but its id for ACPI calls is 1. The battery management code introduced in 4.17 contains a tpacpi_battery_get_id function that returns 2 (BAT_SECONDARY) when invoked for "BAT1". This prevents the code from working for this line of laptops. Would the code return 1 (BAT_PRIMARY) for these machines, then the battery management functions correctly. I suspect that this also might be the case for machines that identify as "ThinkPad 13 2nd Gen" but cannot test this due to not owning such a laptop.
In order to run with an unsupported battery (i.e. a Thinkpad 13 on kernel 4.17), https://patchwork.kernel.org/patch/10483501/ is needed. Otherwise, the kernel freezes.
Patch: https://patchwork.kernel.org/patch/10519235/