Pwm控制器

官方你好,我想通过pwm控制风扇
现在我在设备树节新增了两个gpio个节点,想把他们复用为pwm输出,现在我在linux系统中找不到控制他们输出的地方,soc_gpio37_pr0 可以在/sys/class/pwm/pwmchip3中控制,但这个是我一个一个试出来的,现在我找不到soc_gpio21_ph0 的控制节点,

pinmux@2430000 {
		compatible = "nvidia,tegra234-pinmux";
		reg = <0x00 0x2430000 0x00 0x19100 0x00 0xc300000 0x00 0x4000>;
		#gpio-range-cells = <0x03>;
		status = "okay";
		phandle = <0x2e5>;

		soc_gpio37_pr0 {
    		nvidia,pins = "soc_gpio37_pr0";
			nvidia,function = "gp";
    		nvidia,pull = <0x00>;
    		nvidia,tristate = <0x01>;
    		nvidia,enable-input = <0x01>;
    		nvidia,io-high-voltage = <0x01>;
    		nvidia,lpdr = <0x00>;
   		};

		soc_gpio21_ph0 {
			nvidia,pins = "soc_gpio21_ph0";
			nvidia,function = "rsvd0";
			nvidia,pull = <0x00>;
			nvidia,tristate = <0x01>;
			nvidia,enable-input = <0x01>;
			nvidia,lpdr = <0x00>;
   		};

		pex_rst_c5_in {
			phandle = <0x2c>;

			pex_rst {
				nvidia,pins = "pex_l5_rst_n_paf1";
				nvidia,function = "rsvd1";
				nvidia,pull = <0x00>;
				nvidia,tristate = <0x01>;
				nvidia,enable-input = <0x01>;
				nvidia,lpdr = <0x00>;
			};
		};

Hi 1132492539,

Are you using the devkit or custom board for AGX Orin?
What’s your Jetpack version in use?

There should be sysfs node available for your use case.
Please share the result of the following command on your board.

$ ls -l /sys/class/hwmon/

您好,我现在使用的是AGX Orin的定制板
版本:Jetson Linux 35.2.1
现在我有4个风扇接口,可以通过/sys/class/hwmon/hwmon4控制一个,通过/sys/class/pwm/pwmchip3控制一个,还有两个找不到对应关系,分别是gpio433(PN.01)和gpio391(PH.00)

test@tegra-ubuntu:~$ ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Sep  8  2022 hwmon0 -> ../../devices/platform/39c0000.tachometer/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Sep  8  2022 hwmon1 -> ../../devices/platform/soctherm-oc-event/hwmon/hwmon1
lrwxrwxrwx 1 root root 0 Jan 24 08:14 hwmon2 -> ../../devices/platform/c240000.i2c/i2c-1/1-0040/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Jan 24 08:14 hwmon3 -> ../../devices/platform/c240000.i2c/i2c-1/1-0041/hwmon/hwmon3
lrwxrwxrwx 1 root root 0 Jan 24 08:14 hwmon4 -> ../../devices/platform/pwm-fan/hwmon/hwmon4
lrwxrwxrwx 1 root root 0 Jan 24 08:14 hwmon5 -> ../../devices/platform/6810000.ethernet/mdio_bus/6810000.ethernet/6810000.ethernet:00/hwmon/hwmon5
lrwxrwxrwx 1 root root 0 Jan 24 08:14 hwmon6 -> ../../devices/platform/6910000.ethernet/mdio_bus/6910000.ethernet/6910000.ethernet:00/hwmon/hwmon6

如果你使用的是Custom carrier board for AGX Orin, 我們這邊不知道你板子的設計是如何的
hwmon4是預設enable可以用來控制風扇轉速的

看起來你的板子上有另外三個風扇也要透過PWM來控制
PN.01:


PH.00:

以上兩根pin看起來都從40-expansion header上接出來的
你必須先從pinmux spreadsheet上將"Customer Usage"那欄改為GP_PWM*

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.