Loading
power: oplus_vooc: Skip fw header/footer for vooc_fw_update_newmethod
The vooc charging firmware files that ships in OnePlus sm8250 devices has an 80 byte header and a 128 byte footer, and when we load the firwmare, the header and footer is present in the payload to be written. However, the fw_update functions for the various ICs assume that the header and footer is already removed from the payload, and on the OnePlus 8 and OnePlus 8 Pro (which uses an STM8S MCU), trying to write this payload without removing the header and footer leads to some funny writes that causes the bus driver to always report a -107 error on any subsequent writes. Fix this by lying about the payload size and doing some pointer arithmetic so that the fw_update functions would end up writing a payload that excludes the header and footer. Change-Id: I00fbc2c34df13f34f0a6bd59ef313f99d0edc3fc