<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Matrix keypad sends dual events in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1739188#M214000</link>
    <description>&lt;P&gt;Hi Mr. Vasavada,&lt;/P&gt;&lt;P&gt;I hope you are doing well also. The HW design is the same as when we used an iMX6 so we would expect it to work on iMX8 in a similar fashion.&lt;/P&gt;&lt;P&gt;Your Toradex link was not really helpful as we have succesfully bound the driver in the device tree and do get the key presses in user space, as per my explanation above.&lt;/P&gt;&lt;P&gt;What you could do to help is to specifically recommend the pinmux settings for PU/PD in the pinmux registers.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 06:25:02 GMT</pubDate>
    <dc:creator>NamnNamnsson</dc:creator>
    <dc:date>2023-10-13T06:25:02Z</dc:date>
    <item>
      <title>Matrix keypad sends dual events</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1738352#M213924</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a matrix keypad on iMX8M that behaves unexpectedly.&lt;/P&gt;&lt;P&gt;When pressing the "ENTER" button, an event for two keys are sent on key down but only &lt;U&gt;sometimes&lt;/U&gt;. Single event is sent on key up.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;% evtest
Event: time 1667916690.681361, type 4 (EV_MSC), code 4 (MSC_SCAN), value 02
Event: time 1667916690.681361, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 0
Event: time 1667916690.681361, type 4 (EV_MSC), code 4 (MSC_SCAN), value 03
Event: time 1667916690.681361, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1667916690.681361, -------------- SYN_REPORT ------------
Event: time 1667916690.885342, type 4 (EV_MSC), code 4 (MSC_SCAN), value 03
Event: time 1667916690.885342, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1&lt;/LI-CODE&gt;&lt;P&gt;When pressing the "BACK" button, there is &lt;U&gt;always&lt;/U&gt; a dual event sent on &lt;U&gt;both&lt;/U&gt; key down and key up.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;% evtest
Event: time 1667916583.825343, type 4 (EV_MSC), code 4 (MSC_SCAN), value 02
Event: time 1667916583.825343, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 1
Event: time 1667916583.825343, type 4 (EV_MSC), code 4 (MSC_SCAN), value 03
Event: time 1667916583.825343, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1
Event: time 1667916583.825343, -------------- SYN_REPORT ------------
Event: time 1667916583.909345, type 4 (EV_MSC), code 4 (MSC_SCAN), value 02
Event: time 1667916583.909345, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 0
Event: time 1667916583.909345, type 4 (EV_MSC), code 4 (MSC_SCAN), value 03
Event: time 1667916583.909345, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1667916583.909345, -------------- SYN_REPORT ------------&lt;/LI-CODE&gt;&lt;P&gt;The electrical schematics is as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skärmavbild 2023-10-12 kl. 09.02.23.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/244723iB0AA67C1102EDB35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Skärmavbild 2023-10-12 kl. 09.02.23.png" alt="Skärmavbild 2023-10-12 kl. 09.02.23.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Skärmavbild 2023-10-12 kl. 09.02.23.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We are using the driver matrix_keypad.c on Linux 6.1.1, this is our device tree:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;matrix-keypad {
	compatible = "gpio-matrix-keypad";
	pinctrl-0 = &amp;lt;&amp;amp;pinctrl_gpio_keys&amp;gt;;
	debounce-delay-ms = &amp;lt;5&amp;gt;;
	col-scan-delay-us = &amp;lt;2&amp;gt;;

	row-gpios = &amp;lt;	&amp;amp;gpio1 7 0
					&amp;amp;gpio1 8 0
					&amp;amp;gpio1 9 0&amp;gt;;

	col-gpios = &amp;lt;	&amp;amp;gpio1 5 0
					&amp;amp;gpio1 6 0&amp;gt;;

	linux,keymap = &amp;lt; 0x00000001 /* UNUSED */
					 0x0100000e /* BACK */
					 0x0200003d /* F3 */
					 0x0001006c /* DOWN */
					 0x0101001c /* ENTER */
					 0x02010067&amp;gt;; /* UP */
};

pinctrl_gpio_keys: keys0grp {
	fsl,pins = &amp;lt;
		MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x000 /* COL0_BTN */
		MX8MM_IOMUXC_GPIO1_IO06_GPIO1_IO6	0x000 /* COL1_BTN */
		MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x000 /* ROW0_BTN */
		MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8	0x000 /* ROW1_BTN */
		MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9	0x000 /* ROW2_BTN */
	&amp;gt;;
};&lt;/LI-CODE&gt;&lt;P&gt;We have tried different pinctrl settings with PU and PD but the symptoms are the same. We have tried with &lt;EM&gt;drive-inactive-cols&lt;/EM&gt; and the symptoms are the same. We have tried several different &lt;EM&gt;debounce-delay-ms&lt;/EM&gt; and &lt;EM&gt;col-scan-delay-us&lt;/EM&gt;&amp;nbsp;combinations and the symptoms are the same.&lt;/P&gt;&lt;P&gt;This is the output from gpioinfo and sys/kernel/debug/gpio respectively:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;% gpioinfo
line   5:      unnamed "matrix_kbd_col" output active-high [used]
line   6:      unnamed "matrix_kbd_col" output active-high [used]
line   7:      unnamed "matrix_kbd_row" input active-high [used]
line   8:      unnamed "matrix_kbd_row" input active-high [used]
line   9:      unnamed "matrix_kbd_row" input active-high [used]

% cat /sys/kernel/debug/gpio 
gpiochip0: GPIOs 0-31, parent: platform/30200000.gpio, 30200000.gpio:
gpio-5   (                    |matrix_kbd_col      ) out hi 
gpio-6   (                    |matrix_kbd_col      ) out hi 
gpio-7   (                    |matrix_kbd_row      ) in  lo IRQ 
gpio-8   (                    |matrix_kbd_row      ) in  lo IRQ 
gpio-9   (                    |matrix_kbd_row      ) in  lo IRQ &lt;/LI-CODE&gt;&lt;P&gt;How would you recommend we set the pin muxing and pin control to have only single events from any key up and key down press on any button?&lt;/P&gt;&lt;P&gt;Do you have any other solution to propose?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1738352#M213924</guid>
      <dc:creator>NamnNamnsson</dc:creator>
      <dc:date>2023-10-12T07:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix keypad sends dual events</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1739154#M213995</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221694"&gt;@NamnNamnsson&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;Please make sure that there are no issues with the matrix keypad hardware design.&lt;/P&gt;
&lt;P&gt;One can refer to the below-mentioned links for similar issues.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.gammon.com.au/forum/?id=14175" target="_self"&gt;http://www.gammon.com.au/forum/?id=14175&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.toradex.com/t/adding-a-matrix-keypad-to-verdin-imx8mm-running-torizon/16423/4" target="_self"&gt;https://community.toradex.com/t/adding-a-matrix-keypad-to-verdin-imx8mm-running-torizon/16423/4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 05:53:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1739154#M213995</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-10-13T05:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix keypad sends dual events</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1739188#M214000</link>
      <description>&lt;P&gt;Hi Mr. Vasavada,&lt;/P&gt;&lt;P&gt;I hope you are doing well also. The HW design is the same as when we used an iMX6 so we would expect it to work on iMX8 in a similar fashion.&lt;/P&gt;&lt;P&gt;Your Toradex link was not really helpful as we have succesfully bound the driver in the device tree and do get the key presses in user space, as per my explanation above.&lt;/P&gt;&lt;P&gt;What you could do to help is to specifically recommend the pinmux settings for PU/PD in the pinmux registers.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 06:25:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Matrix-keypad-sends-dual-events/m-p/1739188#M214000</guid>
      <dc:creator>NamnNamnsson</dc:creator>
      <dc:date>2023-10-13T06:25:02Z</dc:date>
    </item>
  </channel>
</rss>

