hiby: r1: fix headphone detection

Change-Id: I4fdf47fb3585754428f6be804e65993e965c3914
This commit is contained in:
Roman Artiukhin 2026-07-15 15:41:24 +03:00
parent 078a506dfd
commit 0c29c97f1a

View file

@ -65,11 +65,11 @@ int hiby_has_valid_output(void) {
const char * const sysfs_hs_switch = "/sys/class/switch/headset/state";
const char * const sysfs_bal_switch = "/sys/class/switch/balance/state";
sysfs_get_int(sysfs_hs_switch, &status);
if (status) ps = 2; // headset
if (sysfs_get_int(sysfs_hs_switch, &status) && status)
ps = 2; // headset
sysfs_get_int(sysfs_bal_switch, &status);
if (status) ps = 3; // balanced output
if (sysfs_get_int(sysfs_bal_switch, &status) && status)
ps = 3; // balanced output
return ps;
}