Unknown battery level for DS4 in Linux

Hello,

I have problem with reading battery level from DualShock 4 using SDL_JoystickCurrentPowerLevel

I always get SDL_JOYSTICK_POWER_UNKNOWN.
This is strange, because I can read battery level using upower

$ upower -i `upower -e | grep 'sony'`
  native-path:          sony_controller_battery_a4:ae:11:b2:6f:3d
  model:                Wireless Controller
  serial:               a4:ae:11:b2:6f:3d
  power supply:         no
  updated:              wto, 10 maj 2022, 16:19:57 (44 seconds ago)
  has history:          yes
  has statistics:       yes
  gaming-input
    rechargeable:        yes
    warning-level:       none
    percentage:          95%
    icon-name:          'battery-full-symbolic'
  History (charge):
    1652192397	0,000	unknown
  History (rate):
    1652192397	0,000	unknown

My system: Linux pop-os 20.04
Kernel: 5.16.19

The same code compiled under Windows works properly.