amazing! good job @bevanweiss
The script also helps, nice!
I figured out what is wrong...
Removing GPIO_OPEN_DRAIN does the trick, because I assume this disables the internal pull ups...
The ms delay you can ignore... It was just for testing 
DTS
/ {
i2c_scl23_sda22 {
compatible = "i2c-gpio";
#address-cells = <1>;
#size-cells = <0>;
scl-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
status = "okay";
clock-frequency = <100000>;
i2c-gpio,delay-us = <50>; // 50us delay ~= 10kHz
};
};
So we have:
root@OpenWrt:~# sh ./i2c_dump_16x16.sh 0x4d
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: 00 00 00 01 00 00 00 40 40 91 00 00 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 07 7A 57 45 B0 FC AF 32 54 C9 DC A4 8F 90
40: 87 14 15 7A 46 81 BA DF B3 32 02 E1 02 2A 37 E8
50: 96 22 11 F5 94 11 AA 79 9F 7A E0 E9 A0 21 28 80
60: 19 FE BF E8 9D F2 AB A0 87 8D 12 54 04 B6 AB 90
70: 2E E3 DF E3 06 DC 73 8B C5 5A B9 5C 66 FD 87 75
80: CB F2 5B E5 12 F8 35 AF 93 86 44 90 0F B0 5D 70
90: 8C A4 4E DC 97 B1 23 C9 BE FE 5F 1A AB 7A 8C D1
A0: 98 A7 45 FC 8C D3 5B D9 DD 47 22 3C 5D A1 5D C3
B0: 7E 10 16 95 0E DE 75 91 0E DE 48 C5 16 F1 5D EB
C0: 8F 7C 90 2A 84 26 A4 61 23 00 01 01 00 00 00 00
D0: 00 00 00 11 2A 00 00 00 00 00 00 00 00 00 00 FF
E0: FF 00 00 00 00 00 04 00 00 32 00 00 ED 00 00 01
F0: BF FF 0C 1B 00 00 0B 52 62 C0 5A BC 15 D4 A1 78
root@OpenWrt:~# sh ./i2c_dump_16x16.sh 0x15
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: 00 40 14 30 00 00 00 00 00 00 00 00 91 14 14 14
10: 14 00 3C 40 4F 1E 1E 1E 1E AA 40 00 00 00 00 40
20: 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A0: 00 00 00 00 00 00 00 00 40 13 05 08 13 24 2B 3C
B0: 53 6A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
F0: 00 00 00 00 00 00 00 00 05 78 4F 4F 4F 40 40 00
root@OpenWrt:~# sh ./i2c_dump_16x16.sh 0x0d
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00: 00 40 14 52 00 00 00 00 00 00 00 00 91 14 14 14
10: 14 00 3C 40 4F 1E 1E 1E 1E AA 40 00 00 00 00 40
20: 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A0: 00 00 00 00 00 00 00 00 40 13 05 08 13 24 2B 3C
B0: 53 6A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
F0: 00 00 00 00 00 00 00 00 05 78 4F 4F 4F 40 40 00
root@OpenWrt:~#
POE
I got also poe online on openwrt, but it was random try outs and I don't know which one it was:D
I got different values : 0x05 for Lan1 if I connect a POE client:
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x59
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x5b
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x5e
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x5b
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x6c
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x6f
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x6f
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x71
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x6f
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xad
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0xa3
#disconnect
root@OpenWrt:~# i2cget -y 0 0x0d 0x05
0x0
EDIT: You find later in this post the solution that is provided from the docs.
Some light;-)
2.1 Left 4 Leds (simple registers)
# all 4 on
i2cset -y 0 0x4d 0x01 0x4F
# all 4 off
i2cset -y 0 0x4d 0x01 0x40
# first one
i2cset -y 0 0x4d 0x01 0x48
# 0100[1]000
# first off
i2cset -y 0 0x4d 0x01 0x40
# 0100[1]000
# second on
i2cset -y 0 0x4d 0x01 0x44
# 01000[1]00
# second+third on
i2cset -y 0 0x4d 0x01 0x46
# 01000[1][1]0
2.1 Right 4 Leds (simple registers, same idea)
# all 4 on
i2cset -y 0 0x4d 0x02 0x4F
# all 4 off
i2cset -y 0 0x4d 0x02 0x40
# ......
Reading the docs, I remembered we got some from hasivo 
hasivo_8port_pse_application_description
Judge whether the PSE chip is online,
Address:0X0C
If the readout result = 0x91, it indicates that the chip is online, otherwise it is offline
root@OpenWrt:~# i2cget -y 0 0x0d 0x0C
0x91
Port status
Address:0X01
0X01=4F=0100 1111
The last 4 bits of the fixed value of the first 0100 correspond to
1-4 ports, 1 = on, 0 = off
4F= 4 ports all on
# all offline
root@OpenWrt:~# i2cget -y 0 0x0d 0x01
0x40
# 1 connected
root@OpenWrt:~# i2cget -y 0 0x0d 0x01
0x48
# 0100 [1]000
# 4 connected
root@OpenWrt:~# i2cget -y 0 0x0d 0x01
0x41
# 0100 000[1]
Port Switch
Write address: 0X14 , Control port on or off
0X0F=48=0100 1000
The last 4 bits of the front 0100 fixed value correspond to 1-4 ports
1=on, 0=off
48= 1 Port 1 is allowed to open and other ports are closed,
# port 1 on
root@OpenWrt:~# i2cset -y 0 0x0d 0x14 0x48
# off
root@OpenWrt:~# i2cset -y 0 0x0d 0x14 0x40
So we have a working poe device
Nice
@bevanweiss as I have not done that before: How would you approach the next steps? I am exciting to work on it next weekend.
Writing a kernel module? Doing it with simple bash script? How does the communication with openwrt works then in a best way? Control via config file, some user space application? Also we need to figure out how to listen on the "link is up notification".
Thx for the collaboration, that was fun!