I extend it now to all GPIOs
I need to check with the events still
Code:
//Test overlay on bit-bashed I2C//devices connected are an EEPROM ans a GPIO expander////swi2c-dummy-rev1-overlay.dts//for devicetree bindings of MCP23017 refer to///home/pi/linux/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt//MCP23017 data sheet: https://www.microchip.com/en-us/product/mcp23017//AT24AA32A data sheet: https://www.microchip.com/en-us/product/24AA32A//aBUGSworstnightmare, 20241218#include <dt-bindings/gpio/gpio.h>#include <dt-bindings/pinctrl/bcm2835.h>/dts-v1/;/plugin/;/ {compatible = "brcm,bcm2711";fragment@0 {target-path = "/";__overlay__ {i2c_gpio: i2c@0 {reg = <0xffffffff>;compatible = "i2c-gpio";gpios = <&gpio 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* sda */ &gpio 11 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* scl */>;i2c-gpio,delay-us = <2>; /* ~100 kHz */#address-cells = <1>;#size-cells = <0>;};};};fragment@1 {target-path = "/aliases";__overlay__ {i2c_gpio = "/i2c@0";};};fragment@2 {target-path = "/__symbols__";__overlay__ {i2c_gpio = "/i2c@0";};};fragment@10 {target = <&gpio>;__overlay__ {mcp23017_20_pins: mcp23017_pins@20 {brcm,pins = <18>;brcm,function = <0>;brcm,pull = <2>;};};};fragment@20 {target = <&mcp23017_20>;mcp23017_20_irq: __overlay__ {interrupt-controller;interrupt-parent = <&gpio>;interrupts = <18 2>;interrupt-names = "mcp23017@20 irq";#interrupt-cells=<2>;microchip,irq-mirror;pinctrl-names = "default";pinctrl-0 = <&mcp23017_20_pins>, <&gpio20pullups>;gpio20pullups: pinmux {pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15";bias-pull-up;};};};fragment@30 {target = <&i2c_gpio>;__overlay__ {#address-cells = <1>;#size-cells = <0>;status = "okay"; mcp23017_20: mcp@20 {compatible = "microchip,mcp23017";reg = <0x20>;gpio-controller;#gpio-cells = <2>;status = "okay";};mcp23017_21: mcp@21 {compatible = "microchip,mcp23017";reg = <0x21>;gpio-controller;#gpio-cells = <2>;status = "okay";}; };};__overrides__ {i2c_gpio_sda = <&i2c_gpio>,"gpios:4";i2c_gpio_scl = <&i2c_gpio>,"gpios:16";i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";bus = <&i2c_gpio>, "reg:0";};};
I need to check with the events still
Statistics: Posted by koerli — Wed Dec 25, 2024 9:05 pm