I try access multiple ICs via I2C over the MCP23017 I/O Expander for a custom embedded board. I know ICs I2C adresses.
How should I add the MCP23017 to the device-tree?
I think I need to add the ICs as child nodes under MCP2301 in device-tree, but I don't know how to do it.
There are a device-tree example below. Will Linux detect the ICs when implemented this way? What is the easiest way to access ICs?
&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c_1>;
status = "okay";
/* mcp23017 I2C IO Expander */
gpio_ex3: gpio_mcp@20 {
compatible = "microchip,mcp23017";
gpio-controller;
#gpio-cells = <2>;
reg = <0x20>;
status = "okay";
};