GPIO expander access is not working in kernel

Hi Jyijyi,

I am trying to access gpio expander max7321 in our custom board with WP7608. I can see a bug in Sierra wireless kernel code.
The gpio expander is listed as gpiochip812 successfully in /sys/class/gpio path. And i am trying to export that pin:
echo 812 > /sys/class/gpio/export

This command returns error. Because kernel allows to export only processor gpio pins. The function gpio_map_name_to_num in drivers/gpio/gpiolib-sysfs.c blocks gpios expander pins. The gpio_map_name_to_num() is Sierra Wireless code.

 Could you please help me to add gpio expander access from Linux user space?.


Raghavan K.

You can see here on how to use gpio expander command

Hi Jyijyi,
What is the DTS file to change gpio expander details for WP7608?. How can I compile and include it yocto_wp76xx.4k.cwe?.
I have changed as following in kernel/arch/arm/boot/dts/qcom/swi-wp-mangoh-green.dtsi file. But gpioexp does not show new i2c address 0x69. It shows old i2c address from green board 0x3E, 0x3F and 0x70.

&soc {
sierra_gpio {
// IO expander 1
alias-ARDUINO_RESET_LEVEL = <300 0>;
alias-BATTCHRGR_PG_N = <301 0>;
alias-BATTGAUGE_GPIO = <302 0>;
alias-LED_ON = <303 0>;
alias-ATMEGA_RESET_GPIO = <304 0>;
alias-CONNECT_TO_AV_LED = <305 0>;
alias-PCM_ANALOG_SELECT = <306 0>;
alias-CONNECT_TO_AV = <307 0>;

&i2c_4 {
expander: max7321@69 {
#gpio-cells = <2>;
compatible = “maxim,max7321”;
reg = <0x69>;
max732x,gpio_base = <300>;


No idea, but i guess you can use i2c tool in console to send command to the gpio expander