MCP23017 GPIO Progromming

Hi
I have MCP23017 on carrier board.
I define it on DT and add driver to kernel.
The GPIOs are detected and work fine in user space with echo and cat.
I want to have input with 100k pullup ports.
How I do it? in user space or system calls

here is my device tree mcp Part

&i2c4 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

	gpio_ex1: gpio_mcp@20 {
		compatible = "microchip,mcp23017";
		gpio-controller;
		#gpio-cells = <2>;
		reg = <0x20>;			  
	};
	
	gpio_ex2: gpio_mcp@21 {
		compatible = "microchip,mcp23017";
		gpio-controller;
		#gpio-cells = <2>;
		reg = <0x21>;
	};
};

Which Linux BSP version you are using? “Standard” MCP23017 Linux driver doesn’t support pull up configuration. However you can apply a patch to enable it. Some details available here.

Hi
I use BSP 2.8b6 with Kernel 4.9.166. Could apply this patch?

We never tested this but you can give a try.