[Honor 9  Questions & Answers] Blaze Falconburger:
I managed to fix the buttons and flash/torch issue fixed by taking the following steps on firmware B170:

So here is the process I followed:

1. I flashed the modified TWRP from zxz0O0 (http://www.mediafire.com/file/uy70a3f3h2hp7bs/recovery-new-twrp.img)

It should run an update thread when TWRP loads which takes ~30 seconds (you can check dmesg for confirmation)

The update is the firmware for the touchkey_firmware

This did not fix the issue after booting back to the OS

2. This didn't fix the issue, so I then extracted boot.img extracted from B180 (I thought this was the same version as the firmware I was running) but this caused it to freeze on the "Device is booting" first screen. Bracing myself for a full reset and reflash I then tried:

I ran HWOTA expecting to do the rebrand procedure - in bootloader it pushed it's version of TWRP reocvery (reports as 3.1.1-1)

It then showed the running firmware as B170 - id10t, so I extracted and flashed boot.img extracted from B170

Booted to TWRP recovery by mistake (from HWOTA verison)

Rebooted back to bootloader, flashed boot.img fom B170

It then booted into OS

I've since booted back to TWRP, buttons still work

Installed SuperSU SR5 (SR5-SuperSU-v2.82-SR5-20171001224502) in recovery, still all working

Rebooted a couple of times, still working

It has remained working for >1 week now :)

To extract the boot.img, unpack the UPDATE.app file inside the firmware and then flash it with fastboot flash boot boot.img

I'm not sure if step 1 is required (modified TWWP), or just a simple re-flash of boot.img will fix the issue, maybe somebody could try and report?

Here is a dmesg log of the OS when the buttons/light aren't working. It seems related to i2c, so maybe the ID or something is wrong in the OS and a reflash of boot.img fixes it (after TWRP breaks it?)

Here is a dmesg log of the update running from the modified TWRP in step 1 - unsure if this is a required step or not, as we don't know exactly what breaks it - wrong/bad touchkey_firmware loaded to the buttons, or OS:

<6>[ 12.355163s][pid:1,cpu4,swapper/0][I/tp_color] [tp_color_info_init] --<6>[ 12.355194s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_init: button module init
<6>[ 12.355224s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe: cyttsp button's probing
<6>[ 12.355224s][pid:1,cpu4,swapper/0][I/DSM] client dsm_touch_key register success!
<6>[ 12.355255s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_parse_dt: vdd chanel is 2
<3>[ 12.355255s][pid:1,cpu4,swapper/0][E/cyp_key] cyttsp_button_parse_dt: unable to read vdd supply, set default value: 3300000
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq gpio = 220
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq_flags = 24578
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: input name = cyp_touch_key_psoc4000
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: button number = 2
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: button_status_reg = 0x4a
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: work_mode_reg = 0x01
<6>[ 12.355285s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: bootloader_addr = 0x28
<6>[ 12.355316s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: idac_limit = 20, 40
<6>[ 12.355316s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_limit = 1584, 2904
<6>[ 12.355316s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_charging_limit = 65535

<3>[ 12.464385s][pid:1,cpu4,swapper/0][E/cyp_key] cyttsp_i2c_read_block-70: failed to read block!
<6>[ 12.464385s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe-1952: restore new app client addr = 0x36
<6>[ 12.464385s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe-1955: switch to old client addr = 0x27
<6>[ 12.576477s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe-1990: switch to btld ops mode already
<6>[ 12.576477s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe-1995: data->client->addr = 0x36
<6>[ 12.577148s][pid:226,cpu7,cyp_key_updatet][I/cyp_key] cyttsp_fw_update_thread: fw update process running
<6>[ 12.577148s][pid:1,cpu4,swapper/0][I/cyp_key] cyttsp_button_probe: button probe done

<6>[ 13.613983s][pid:226,cpu7,cyp_key_updatet][I/cyp_key] cyttsp_handle_response: silicon id = 0x9a 0x11 0x71 0x0a, rev = 0x00, bootloader ver = 0x01 0x00 0x01
<6>[ 13.643005s][pid:226,cpu4,cyp_key_updatet][I/cyp_key] cyttsp_handle_response: first row number of flash: 0x4c 0x00
<6>[ 13.643005s][pid:226,cpu4,cyp_key_updatet][I/cyp_key] cyttsp_handle_response: last row number of flash: 0xff 0x00

<6>[ 30.208984s][pid:226,cpu4,cyp_key_updatet][I/cyp_key] cyttsp_fw_update_proc: back into normal mode already

I don't know if the HWOTA TWRP also runs a firmware update for cyttsp - if it does, this was the last one I loaded

[ 13.698822s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_probe: cyttsp button's probing
[ 13.698822s][pid:1,cpu6,swapper/0][I/DSM] client dsm_touch_key register success!
[ 13.698852s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_parse_dt: vdd chanel is 2
[ 13.698852s][pid:1,cpu6,swapper/0][E/cyp_key] cyttsp_button_parse_dt: unable to read vdd supply, set default value: 3300000
[ 13.698883s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq gpio = 220
[ 13.698883s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq_flags = 24578
[ 13.698883s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: input name = cyp_touch_key_psoc4000
[ 13.698883s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: button number = 2
[ 13.698883s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: button_status_reg = 0x4a
[ 13.698913s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: work_mode_reg = 0x01
[ 13.698913s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: bootloader_addr = 0x28
[ 13.698913s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: idac_limit = 20, 40
[ 13.698913s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_limit = 1584, 2904
[ 13.698913s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_charging_limit = 65535
[ 13.698913s][pid:1,cpu6,swapper/0][CAMERA]INFO: pmic power on!
[ 13.698944s][pid:1,cpu6,swapper/0][CAMERA]INFO: ncp6925_on enter.
[ 13.698944s][pid:1,cpu6,swapper/0][CAMERA]INFO: ncp6925_seq_config enter.
[ 13.699096s][pid:1,cpu6,swapper/0][CAMERA]INFO: calc_ldo_vlotage enter, ldo in 3300000
[ 13.700531s][pid:1,cpu6,swapper/0][CAMERA]INFO: ncp6925_seq_config chx_enable 0x10, voltage_reg 0x7, voltage_val 0x70
[ 13.700866s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_probe: key_code[1] = 158
[ 13.700866s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_probe: key_code[2] = 580
[ 13.700927s][pid:1,cpu6,swapper/0]input: touch_key as /devices/platform/amba/fdf0d000.i2c/i2c-4/4-0036/input/input4
[ 13.804046s][pid:1,cpu6,swapper/0]i2c_designware-hs fdf0d000.i2c: error info -121, slave addr 0x36.
[ 13.804077s][pid:1,cpu6,swapper/0][E/cyp_key] cyttsp_i2c_read_block-70: failed to read block!
[ 13.804077s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_probe-1959: restore new app client addr = 0x36
[ 13.804077s][pid:1,cpu6,swapper/0][I/cyp_key] cyttsp_button_probe-1964: client addr = 0x28
[ 13.806152s][pid:1,cpu6,swapper/0]i2c_designware-hs fdf0d000.i2c: error info -121, slave addr 0x28.
[ 13.808227s][pid:1,cpu6,swapper/0]i2c_designware-hs fdf0d000.i2c: error info -121, slave addr 0x56.
[ 13.808227s][pid:1,cpu6,swapper/0][E/cyp_key] fail to read btld slave addr, button's not on site
[ 13.808258s][pid:1,cpu6,swapper/0][E/cyp_key] cyttsp_button_probe: fail to read new btld slave addr
[ 13.808258s][pid:1,cpu6,swapper/0][E/cyp_key] cyttsp_button_probe: button's not on site
[ 13.808471s][pid:171,cpu7,kworker/u16:2][I/DSM] dsm_touch_key finish notify
[ 13.834197s][pid:1,cpu4,swapper/0][E/cyp_key] cyttsp_button_probe: Button probe failed

[ 13.834197s][pid:1,cpu4,swapper/0]huawei,cyp_touch_key: probe of 4-0036 failed with error -121

Here is a dmesg log from post flashing with working buttons:

[ 14.159393s][pid:1,cpu7,swapper/0][I/tp_color] [tp_color_info_init] --<6>[ 14.159393s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_init: button module init
[ 14.159423s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: cyttsp button's probing
[ 14.159454s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_parse_dt: vdd chanel is 2
[ 14.159484s][pid:1,cpu7,swapper/0][E/cyp_key] cyttsp_button_parse_dt: unable to read vdd supply, set default value: 3300000
[ 14.159484s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq gpio = 220
[ 14.159484s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: irq_flags = 24578
[ 14.159484s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: input name = cyp_touch_key_psoc4000
[ 14.159484s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: button number = 2
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: button_status_reg = 0x4a
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: work_mode_reg = 0x01
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: bootloader_addr = 0x28
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: idac_limit = 20, 40
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_limit = 1584, 2904
[ 14.159515s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_print_dt: cmod_charging_limit = 65535
[ 14.163604s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: key_code[1] = 158
[ 14.163635s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: key_code[2] = 580
[ 14.268951s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: succ to read from app addr, in app mode
[ 14.268951s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe-2009: data->client->addr = 0x36
[ 14.372955s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: ic awaken from sleep mode
[ 14.373596s][pid:1,cpu7,swapper/0][I/cyp_key] cyttsp_button_probe: button probe done
[ 14.373809s][pid:227,cpu6,cyp_key_updatet][I/cyp_key] cyttsp_fw_update_thread: fw update process running
[ 17.353973s][pid:227,cpu6,cyp_key_updatet][I/cyp_key] cyttsp_fw_update_proc: ic fw version: 0x04 0x00
[ 17.354492s][pid:227,cpu7,cyp_key_updatet][I/cyp_key] cyttsp_need_update_or_not: image version = 0x04 0x00, in chip version = 0x04 0x00
[ 17.354492s][pid:227,cpu7,cyp_key_updatet][I/cyp_key] cyttsp_fw_update_proc: same ver between ic and image, NO need to update
[ 22.944671s][pid:551,cpu5,surfaceflinger][E/cyp_key] cyttsp_button_input_enable: button power on already
[ 54.458679s][pid:551,cpu6,surfaceflinger][I/cyp_key] cyttsp_button_input_disable: enter deep sleep mode
[ 62.241058s][pid:551,cpu4,surfaceflinger][I/cyp_key] cyttsp_button_input_enable: enter normal mode

You can see the difference clearly in the working log above, it reads firmware version, agrees client address etc