Configure gpio on low expansion connector


#1

Hello everyone,

I am currently facing issues using gpios (for example GPIO_208, pin 23). This gpio is connected to an interrupt pad of one spi sensor.

device tree declaration:

arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts

&spi2 {
/* On Low speed expansion */
label = “LS-SPI0”;
status = “okay”;

sensorhub@0 {
	compatible = "nanohub";
	reg = <0>;
	spi-max-frequency = <500000>;
	spi-cpol;
	spi-cpha;

            interrupt-parent = <&gpio26>;
	interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; /* GPIO_208 */

	status = "ok";
};

when the actual driver is probing gpiolib is reporting an error that gpio (GPIO_208) is configured in output while requesting it as irq.

I have two questions:

  1. what changed in the kernel? Before I was using without needed to configure the pad (by default should be input).

  2. someone is able to configure gpios using pinmux? There are no descriptions of the registers…

kernel used:
https://android.googlesource.com/kernel/hikey-linaro
branch:
android-hikey-linaro-4.9

Thanks,
Denny


#2

Why your are not using the original android-hikey-linaro-4.9 dts [1] which is compatible with the existing nanohub kernel driver.

[1] https://android.googlesource.com/kernel/hikey-linaro/+/android-hikey-linaro-4.9/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts#460

I don’t see obvious change in the kernel. I don’t think this is about pinmux but about gpio configuration. The gpio register is configured as output (maybe by the bootloader).