AnsweredAssumed Answered

GPT input Capture in I.MX8M Mini

Question asked by jun heo on May 19, 2020
Latest reply on May 20, 2020 by igorpadykov

Hi,

I am working on I.MX8M mini(A53) using linux kernel 4.14.78(debian).

I want to find out the motor speed with the GPT CAPTURE function by connecting a motor encoder to SAI3_RXFS.

 

I have added the patchwork from the below link:

[PATCH 1/2] clocksource/drivers/imx: add input capture support 

 

I also modified the device tree to use GPT1 CPTURE1.

 

fsl-imx8mm-ufl.dts

pinctrl_gpt_input_capture0: gptinputcapture0grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_RXFS_GPT1_CAPTURE1 0x1b0b0
>;
};

 

fsl-imx9mm.dtsi:

gpt1: gpt@302d0000 {
compatible = "fsl,imx8mm-gpt", "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
reg = <0x0 0x302d0000 0x0 0x10000>;
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_GPT1_ROOT>,
<&clk IMX8MM_CLK_GPT1_ROOT>,
<&clk IMX8MM_CLK_GPT_3M>;
clock-names = "ipg", "per", "osc_per";
pinctrl-name = "default";
pinctrl-0 = <&pinctrl_gpt_input_capture0>;
status = "okay";
};

 

However, I still have no access to GPT Input Capture Register 1.

I think we should use the mxc_request_input_capture function.
But the problem is, i do not know where should i use the mxc_request_input_capture.

Outcomes