RFC for a GPIO input muxer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am writing to you to ask for comments on the preferred way of implementing a 4-way GPIO multiplexer in the most generic way. The situation is that there is a dual 4-way multiplexer on my device and its select pins a controlled with GPIOs. The output pins of the multiplexer are connected to two other GPIOs. The datasheet of the multiplexer is here: https://assets.nexperia.com/documents/data-sheet/74HC_HCT153.pdf

This is what I have been contemplating on but I am not aware if the same could be achieved with existing pinctrl or gpio driver or combination of those. 

The 'key-mux1' below implements a gpio-controller that drives the multiplexer and provides gpios for reading device key presses. At the moment it has to be polled as interrupts are not being generated by the key presses. I tried looking around but software interrupts did not give me any hits.

I have omitted 'key-mux2' from this for clarity.

mux: mux-controller {
	compatible = "gpio-mux";
	#mux-control-cells = <0>;

	mux-gpios = <&gpio 9 GPIO_ACTIVE_HIGH>,		/* s0 */
		    <&gpio 11 GPIO_ACTIVE_HIGH>;	/* s1 */
};

gpio2: key-mux1 {
	compatible = "gpio-mux-input";
	mux-controls = <&mux>;

	gpio-controller;
	#gpio-cells = <2>;

	// GPIOs used by this node, mux pin
	pin-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;	/* 1y */
};

keys {
	compatible = "gpio-keys-polled";
	poll-interval = <20>;

	aoss {
		label = "aoss";
		linux,code = <KEY_WPS_BUTTON>;
		gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
		debounce-interval = <60>;
	};
}

Sincerely,
Mauri



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux