init: update i2c bus numbers and move initialization to ueventd

Update the i2c bus numbers to use the statically assigned numbers
configured in the kernel device tree. In addition, use ueventd to set
the ACL for the i2c devices.

Bug: 291606723
Test: performance boot testing
Test: verify selinux labelling with ls -Z on the modified device nodes
Change-Id: Ib412510e4b6c086c978ad5487486323685732cae
This commit is contained in:
Will McVicker 2023-09-20 16:10:55 -07:00 committed by Treehugger Robot
parent 184fc05293
commit b1662cade2
5 changed files with 52 additions and 237 deletions

View file

@ -35,7 +35,11 @@ cat "/sys/class/power_supply/main-charger/uevent"
echo "\n------ Power supply property pca9486-mains ------"
cat "/sys/class/power_supply/pca9468-mains/uevent"
echo "\n------ Power supply property tcpm ------"
cat "/sys/class/power_supply/tcpm-source-psy-i2c-max77759tcpc/uevent"
if [ -e "/sys/class/power_supply/tcpm-source-psy-i2c-max77759tcpc/uevent" ]; then
cat "/sys/class/power_supply/tcpm-source-psy-i2c-max77759tcpc/uevent"
elif [ -e "/sys/class/power_supply/tcpm-source-psy-8-0025/uevent" ]; then
cat "/sys/class/power_supply/tcpm-source-psy-8-0025/uevent"
fi
echo "\n------ Power supply property usb ------"
cat "/sys/class/power_supply/usb/uevent"
echo "\n------ Power supply property wireless ------"
@ -89,23 +93,24 @@ then
fi
echo "\n------ TCPC ------"
for f in /sys/devices/platform/10d50000.hsi2c/i2c-*/i2c-max77759tcpc
do
echo "registers:"
cat $f/registers
echo "frs:"
cat $f/frs
echo "auto_discharge:"
cat $f/auto_discharge
echo "bc12_enabled:"
cat $f/bc12_enabled
echo "cc_toggle_enable:"
cat $f/cc_toggle_enable
echo "contaminant_detection:"
cat $f/contaminant_detection
echo "contaminant_detection_status:"
cat $f/contaminant_detection_status
done
max77759tcpc_path="/sys/devices/platform/10d50000.hsi2c/i2c-8/i2c-max77759tcpc"
if [ -e "/sys/devices/platform/10d50000.hsi2c/i2c-8/8-0025" ]; then
max77759tcpc_path="/sys/devices/platform/10d50000.hsi2c/i2c-8/8-0025"
fi
echo "registers:"
cat $max77759tcpc_path/registers
echo "frs:"
cat $max77759tcpc_path/frs
echo "auto_discharge:"
cat $max77759tcpc_path/auto_discharge
echo "bc12_enabled:"
cat $max77759tcpc_path/bc12_enabled
echo "cc_toggle_enable:"
cat $max77759tcpc_path/cc_toggle_enable
echo "contaminant_detection:"
cat $max77759tcpc_path/contaminant_detection
echo "contaminant_detection_status:"
cat $max77759tcpc_path/contaminant_detection_status
echo "\n------ PD Engine ------"
cat "/dev/logbuffer_usbpd"
@ -199,26 +204,6 @@ then
fi
echo "\n------ Battery EEPROM ------"
if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom" ]
then
xxd /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom
fi
if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom" ]
then
xxd /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom
fi
if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom" ]
then
xxd /sys/devices/platform/10970000.hsi2c/i2c-6/6-0050/eeprom
fi
if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom" ]
then
xxd /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom
fi
if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom" ]
then
xxd /sys/devices/platform/10970000.hsi2c/i2c-7/7-0050/eeprom