Skip to contentSkip to conversation

counter: ti-eqep: Enable for TDA4VM/J721E

PATCH In review Jason Kridner 4 participants 4 messages Nov 30, 2021 – Dec 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 counter: ti-eqep: Enable for TDA4VM/J721E

Counter TI-EQEP was tested on TDA4VM/J721E SoC.

Overlay used for testing EQEP0 and EQEP1:

    &cbass_main {
	#address-cells = <2>;
	#size-cells = <2>;

	eqep0: qep@3200000 {
		compatible = "ti,am3352-eqep";
		reg = <0 0x3200000 0 0x100>;
		power-domains = <&k3_pds 94 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 94 0>;
		clock-names = "eqep0-ficlk";
		interrupts = <GIC_SPI 322 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep0";
		symlink = "bone/eQEP0"; /* A - P9_42, B - P9_27 */

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};

	eqep1: qep@3210000 {
		compatible = "ti,am3352-eqep";
		reg = <0 0x3210000 0 0x100>;
		power-domains = <&k3_pds 95 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 95 0>;
		clock-names = "eqep1-ficlk";
		interrupts = <GIC_SPI 323 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep1";
		symlink = "bone/eQEP1"; /* A - P8_35, B - P8_33 */

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};

	eqep2: qep@3220000 {
		status = "disabled";
		compatible = "ti,am3352-eqep";
		reg = <0 0x3220000 0 0x100>;
		power-domains = <&k3_pds 96 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 96 0>;
		clock-names = "eqep2-ficlk";
		interrupts = <GIC_SPI 324 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep2";

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};
    };
---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
index 2de53ab0dd25..453490059c88 100644
@@ -51,7 +51,7 @@ config STM32_LPTIMER_CNT
 
 config TI_EQEP
 	tristate "TI eQEP counter driver"
-	depends on (SOC_AM33XX || COMPILE_TEST)
+	depends on (SOC_AM33XX || ARCH_K3 || COMPILE_TEST)
 	select REGMAP_MMIO
 	help
 	  Select this option to enable the Texas Instruments Enhanced Quadrature
Signature · 1 line
2.30.2
#1 lore raw
Quoted 2 lines · Jason Kridner

Counter TI-EQEP was tested on TDA4VM/J721E SoC.

Thanks for doing this patch,
You could drop the example - This is an example which is probably better addressed in Documentation/devicetree/bindings/counter/ti-eqep.yaml or in the actual device tree for j721e itself.

Instead, I would suggest to keep the commit message short:

Enable TI-QEP for TI's K3 architecture as the driver is reusable or something of that form.

The actual devicetree dts patch should be separate and posted once the driver support is enabled.

Quoted 7 lines

Overlay used for testing EQEP0 and EQEP1:

    &cbass_main {
	#address-cells = <2>;
	#size-cells = <2>;

	eqep0: qep@3200000 {
	[...]
Quoted 24 lines
	};
    };
---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
index 2de53ab0dd25..453490059c88 100644
@@ -51,7 +51,7 @@ config STM32_LPTIMER_CNT
 
 config TI_EQEP
 	tristate "TI eQEP counter driver"
-	depends on (SOC_AM33XX || COMPILE_TEST)
+	depends on (SOC_AM33XX || ARCH_K3 || COMPILE_TEST)
 	select REGMAP_MMIO
 	help
 	  Select this option to enable the Texas Instruments Enhanced Quadrature
Signature · 1 line
2.30.2
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
maintainer
#2 lore raw
Quoted 18 lines · On Tue, 30 Nov 2021 15:16:28 -0600 Nishanth Menon <[email protected]> wrote:
Quoted 2 lines · Jason Kridner

Counter TI-EQEP was tested on TDA4VM/J721E SoC.

Thanks for doing this patch,
You could drop the example - This is an example which is probably better addressed in Documentation/devicetree/bindings/counter/ti-eqep.yaml or in the actual device tree for j721e itself.

Instead, I would suggest to keep the commit message short:

Enable TI-QEP for TI's K3 architecture as the driver is reusable or something of that form.

The actual devicetree dts patch should be separate and posted once the driver support is enabled.

Quoted 2 lines

Overlay used for testing EQEP0 and EQEP1:

Quoted 10 lines
Quoted 5 lines
    &cbass_main {
	#address-cells = <2>;
	#size-cells = <2>;

	eqep0: qep@3200000 {  
	[...]
Quoted 2 lines
	};
    };

Note this is perfectly reasonable detail to have in a cover letter but I agree with Nishanth that it is too much for the patch description.

Given we have very little for counter so far this cycle, please +CC [email protected] on v2. That way we can be lazy and ask him to queue it up directly if that makes sense at the time.

For background to this, as of last cycle I split the IIO and counter pull requests for the first time.

Thanks,

Jonathan

Quoted 23 lines
Quoted 22 lines
---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
index 2de53ab0dd25..453490059c88 100644
@@ -51,7 +51,7 @@ config STM32_LPTIMER_CNT
 
 config TI_EQEP
 	tristate "TI eQEP counter driver"
-	depends on (SOC_AM33XX || COMPILE_TEST)
+	depends on (SOC_AM33XX || ARCH_K3 || COMPILE_TEST)
 	select REGMAP_MMIO
 	help
 	  Select this option to enable the Texas Instruments Enhanced Quadrature
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#3 lore raw
In reply to Jason Kridner
Quoted 63 lines · Jason Kridner

Counter TI-EQEP was tested on TDA4VM/J721E SoC.

Overlay used for testing EQEP0 and EQEP1:

    &cbass_main {
	#address-cells = <2>;
	#size-cells = <2>;

	eqep0: qep@3200000 {
		compatible = "ti,am3352-eqep";
		reg = <0 0x3200000 0 0x100>;
		power-domains = <&k3_pds 94 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 94 0>;
		clock-names = "eqep0-ficlk";
		interrupts = <GIC_SPI 322 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep0";
		symlink = "bone/eQEP0"; /* A - P9_42, B - P9_27 */

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};

	eqep1: qep@3210000 {
		compatible = "ti,am3352-eqep";
		reg = <0 0x3210000 0 0x100>;
		power-domains = <&k3_pds 95 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 95 0>;
		clock-names = "eqep1-ficlk";
		interrupts = <GIC_SPI 323 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep1";
		symlink = "bone/eQEP1"; /* A - P8_35, B - P8_33 */

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};

	eqep2: qep@3220000 {
		status = "disabled";
		compatible = "ti,am3352-eqep";
		reg = <0 0x3220000 0 0x100>;
		power-domains = <&k3_pds 96 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 96 0>;
		clock-names = "eqep2-ficlk";
		interrupts = <GIC_SPI 324 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "eqep2";

		count_mode = <0>;
		swap_input = <0>;
		invert_qa = <1>;
		invert_qb = <1>;
		invert_qi = <0>;
		invert_qs = <0>;
	};
    };
Quoted 1 line

Hello Jason,

The change in this patch is a simple architecture enablement so I don't have a problem with it given that it's been tested. However, I would like the commit message simplified as Nishanth recommends before we merge this patch, so please resubmit it to clean that up. Regardless, for the code change itself I'll give my ack.

Quoted 20 lines
---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
index 2de53ab0dd25..453490059c88 100644
@@ -51,7 +51,7 @@ config STM32_LPTIMER_CNT
 
 config TI_EQEP
 	tristate "TI eQEP counter driver"
-	depends on (SOC_AM33XX || COMPILE_TEST)
+	depends on (SOC_AM33XX || ARCH_K3 || COMPILE_TEST)
 	select REGMAP_MMIO
 	help
 	  Select this option to enable the Texas Instruments Enhanced Quadrature
Signature · 1 line
2.30.2