mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-11-16 19:48:30 +01:00
tool: add a tool for dumping EDID/DisplayID from I2C
Dumps the content of every I2C address which might contain an EDID or DisplayID blob for every connector which has an I2C bus. This can be useful to discover DisplayID blobs which are not nested inside an EDID blob. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
parent
5c9801a75f
commit
8781d1d7a9
1 changed files with 36 additions and 0 deletions
36
tool/dump-i2c.sh
Executable file
36
tool/dump-i2c.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh -eu
|
||||
|
||||
if ! lsmod | grep i2c_dev &>/dev/null; then
|
||||
echo "kernel module i2c-dev must be loaded"
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! command -v i2cdump &>/dev/null; then
|
||||
echo "i2cdump from i2c-tools must be installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
for connector in $(find /sys/class/drm/ -maxdepth 1 -name 'card[0-9]-*'); do
|
||||
bus=$(find "$connector/" -maxdepth 1 -mindepth 1 -type d -name 'i2c-*' -print -quit | sed -n 's/.*\/i2c\-\(.*\)/\1/p')
|
||||
if [ "$bus" = "" ]; then
|
||||
bus=$(find "$connector/ddc/i2c-dev/" -maxdepth 1 -mindepth 1 -type d -name 'i2c-*' -print -quit | sed -n 's/.*\/i2c\-\(.*\)/\1/p')
|
||||
fi
|
||||
if [ "$bus" = "" ]; then
|
||||
echo "Connector $(basename $connector) does not have an i2c bus. Skipping."
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Dumping connector $(basename $connector) i2c bus address 0x50"
|
||||
i2cdump -y $bus 0x50 b
|
||||
|
||||
echo "Dumping connector $(basename $connector) i2c bus address 0x51"
|
||||
i2cdump -y $bus 0x51 b
|
||||
|
||||
echo "Dumping connector $(basename $connector) i2c bus address 0x54"
|
||||
i2cdump -y $bus 0x54 b
|
||||
|
||||
echo "Dumping connector $(basename $connector) i2c bus address 0x55"
|
||||
i2cdump -y $bus 0x55 b
|
||||
done
|
||||
|
Loading…
Reference in a new issue