Jetson AGX PWM1 is occupied by default

root@localhost:/sys/devices/platform/pwm-fan/hwmon/hwmon4# cd /sys/class/pwm/pwmchip1
root@localhost:/sys/class/pwm/pwmchip1# echo 0 > export
bash: echo: write error: Device or resource busy
root@localhost:/sys/class/pwm/pwmchip1#

I can find the the occupied place:
pwm_fan_shared_data_1: pfsd_1 {
num_resources = <0>;
secret = <47>;
active_steps = <10>;
active_rpm = <0 1000 2000 3000 4000 5000 6000 7000 10000 11000>;
rpm_diff_tolerance = <2>;
active_rru = <40 2 1 1 1 1 1 1 1 1>;
active_rrd = <40 2 1 1 1 1 1 1 1 1>;
state_cap_lookup = <2 2 2 2 3 3 3 4 4 4>;
pwm_period = <45334>;
/* TODO: Check correctness of PWM controller ID when pinmux sheet is available /
pwm_id = <3>;
pwm_polarity = <PWM_POLARITY_INVERTED>;
suspend_state = <1>;
step_time = <100>; /
mesecs /
state_cap = <7>;
active_pwm_max = <256>;
tach_period = <1000>;
/
TODO: Fix when pinmux sheet is available */
//pwm_gpio = <&tegra_aon_gpio TEGRA234_AON_GPIO(CC, 4) GPIO_ACTIVE_LOW>;
};

pwm_fan_shared_data_2: pfsd-2 {
	num_resources = <0>;
	secret = <47>;
	active_steps = <10>;
	active_rpm = <0 1000 2000 3000 4000 5000 6000 7000 10000 11000>;
	rpm_diff_tolerance = <2>;
	active_rru = <40 2 1 1 1 1 1 1 1 1>;
	active_rrd = <40 2 1 1 1 1 1 1 1 1>;
	state_cap_lookup = <2 2 2 2 3 3 3 4 4 4>;
	pwm_period = <45334>;
	/* TODO: Check correctness of PWM controller ID when pinmux sheet is available */
	pwm_id = <1>;
	pwm_polarity = <PWM_POLARITY_INVERTED>;
	suspend_state = <1>;
	step_time = <100>; /* mesecs */
	state_cap = <7>;
	active_pwm_max = <256>;
	tach_period = <1000>;
	/* TODO: Fix when pinmux sheet is available */
	//pwm_gpio = <&tegra_aon_gpio TEGRA234_AON_GPIO(CC, 4) GPIO_ACTIVE_LOW>;
};

/* PWM FAN on J16 */
pwm-fan-1 {
	compatible = "pwm-fan";
	status = "okay";
	#pwm-cells = <1>;
	/* TODO: Check correctness of PWM controller ID when pinmux sheet is available */
	pwms = <&tegra_pwm3 0 45334>;
	shared_data = <&pwm_fan_shared_data_1>;
	vdd-fan-supply = <&p3711_vdd_12v0_cvb>;
	profiles {
		default = "quiet";
		quiet {
			state_cap = <4>;

#if TEGRA_PWM_FAN_DT_VERSION == DT_VERSION_2
cooling-levels = <255 178 135 95 0 0 0 0 0 0>;
#else
active_pwm = <0 77 120 160 255 255 255 255 255 255>;
#endif
};
cool {
state_cap = <4>;
#if TEGRA_PWM_FAN_DT_VERSION == DT_VERSION_2
cooling-levels = <255 178 135 95 0 0 0 0 0 0>;
#else
active_pwm = <0 77 120 160 255 255 255 255 255 255>;
#endif
};
};
};

/* PWM FAN on J17 */
pwm-fan-2 {
	compatible = "pwm-fan";
	status = "okay";
	#pwm-cells = <1>;
	/* TODO: Check correctness of PWM controller ID when pinmux sheet is available */
	pwms = <&tegra_pwm1 0 45334>;
	shared_data = <&pwm_fan_shared_data_2>;
	vdd-fan-supply = <&p3711_vdd_12v0_cvb>;
	profiles {
		default = "quiet";
		quiet {
			state_cap = <4>;

#if TEGRA_PWM_FAN_DT_VERSION == DT_VERSION_2
cooling-levels = <255 178 135 95 0 0 0 0 0 0>;
#else
active_pwm = <0 77 120 160 255 255 255 255 255 255>;
#endif
};
cool {
state_cap = <4>;
#if TEGRA_PWM_FAN_DT_VERSION == DT_VERSION_2
cooling-levels = <255 178 135 95 0 0 0 0 0 0>;
#else
active_pwm = <0 77 120 160 255 255 255 255 255 255>;
#endif
};
};
};
};

Below is the search result:
root@localhost:/sys/class/pwm/pwmchip1# cat /sys/kernel/debug/pwm
platform/39c0000.tachometer, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal

platform/32f0000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal

platform/32c0000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal

platform/32a0000.pwm, 1 PWM device
pwm-0 (pwm-fan ): requested enabled period: 45334 ns duty: 45333 ns polarity: normal

platform/3280000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal
root@localhost:/sys/class/pwm/pwmchip1#

hello fengzan.zhang,

please also check pinmux spreadsheets. may I also know which GP_PWM* you’re going to used?

The Orin GPIO is GPIO3_PX.03

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