Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nano Pi Neo Air MCP23008 MCP23017

Featured Replies

Hello.

I need use MCP23017 extension. I have found kernel module gpio-mcp23s08. I have trouble with dtb overlay. I have only found RPi overlay.

Can anyone have or can help with write correct overlay? I am using MCP with I2C bus at 0x20 address.

Hi all,

Im runing latest stable version xenial and i had to upgrade to 4.14.18, nanopi duo, but i could not find gpio-mcp23s08 module?

Here is dts file iv based on online example.

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun8i-h3";

	fragment@0 {
		/* This fragment is required only if using interrupts */
		target = <&pio>;
		__overlay__ {
			mcp23017_pin_irq: mcp23017_pin_irq {
				pins = "PG11";
				function = "irq";
				bias-pull-up;
			};
		};
	};

	fragment@1 {
		target = <&i2c0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			mcp23017@20 {
				compatible = "microchip,mcp23017";
				reg = <0x20>;
				status = "okay";
				gpio-controller;
				#gpio-cells = <2>;
				/* Below are optional properties for supporting interrupts */
				interrupt-controller;
				#interrupt-cells = <2>;
				interrupt-parent = <&pio>;
				interrupts = <0 363 2>; /* PG11 IRQ_TYPE_EDGE_FALLING */
				pinctrl-names = "default";
				pinctrl-0 = <&mcp23017_pin_irq>;
			};
		};
	};
};

But of course i cannot see mcp23017 in list once i run: ls -l /sys/class/gpio/.

I know hw is ok and working good as if i use i2c detect i can see it at addr 0x20 also with i2cset i can manually trigger mcp230xx changes.

 

Can someone give nay hint where to look now and how to bind overlay to correct module?

 

Thanks!

Yes sorry for not being clear, im using MCP23017 an i2c port expander. If i understood good in mainline kernel gpio-mcp23s08 is used for 4 differnet devices.

https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt

Quote

Do you have ' status = "okay"; ' on the i2c itself ?

Not sure what you mean by this... I2C overlay works good as from user space i can control MCP23017 without any problem, but i want to implement it on system level so it can be used by other libraries that are talking with linux level gpio.

Ive followed this overlay, and applied changes that are specific for mcp device: https://github.com/armbian/sunxi-DT-overlays/blob/master/examples/i2c-pca857x.dts
 

I think that overlay looks good but i think problem is that gpio-mcp23s08 is missing from my install (find /lib/modules/$(uname -r) -type f -name '*.ko*'), sorry for noob questions, catching up on this stuff now :)

Thanks!

Now browsing Kernel mainline ive seen that driver was removed after v4.12.......

EDIT: It is moved to pinctrl driver folder :)

Hi all,

 

After building complete image on my own (v4.14.54) wiht included pincrtl-mcp23c08 i was able to test overlay i posted before and its workign good. I havent had any need to modprobe driver, just applied overlay and it appeared in sys. IN my case it started from linux gpio 400. Maybe someone find this interesting for future. Still have to test interrupt pins....

mcp400.PNG

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.