Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24383555 authored by Zhou Song's avatar Zhou Song
Browse files

hal: reset vbat device if spkr protection starts failed

Device reference cnt of vbat device can be decreased to 0
if speaker protection starts failed, causing disabling of
vbat device missed.
Reset the path at the same place when it is enabled.

Change-Id: I6c57ed07b13a605744fc67653550c19dd8cf958b
parent 8d7aa691
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013 - 2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013 - 2021, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -2491,6 +2491,8 @@ exit:
        list_remove(&uc_info_tx->list);
        uc_info_tx->in_snd_device = in_snd_device;
        uc_info_tx->out_snd_device = SND_DEVICE_NONE;
        audio_route_reset_and_update_path(adev->audio_route,
           device_name);
        fp_disable_snd_device(adev, in_snd_device);
        fp_disable_audio_route(adev, uc_info_tx);
        free(uc_info_tx);