Implementation of Tegra Tachometer driver
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest9 patches 9 repliesIn review
- v110 patches 20 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | pwm: core: Add support for PWM HW driver with pwm capture onlydrivers/ | +15 | 1 reply | |
| 2/9 | arm64: tegra: Add PWM controller on Tegra186 socarch/ | +11 | 0 replies | |
| 3/9 | dt-bindings: Tegra186 tachometer device tree bindingsDocumentation/ | +31 | 7 replies | |
| 4/9 | arm64: tegra: Add Tachometer Controller on Tegra186arch/ arch/ | +16 | 0 replies | |
| 5/9 | pwm: tegra: Add PWM based Tachometer driverdrivers/ drivers/ drivers/ | +314 | 0 replies | |
| 6/9 | arm64: tegra: Add pwm based fan support on Tegra186arch/ | +6 | 0 replies | |
| 7/9 | hwmon: pwm-fan: add sysfs node to read rpm of fandrivers/ | +23 | 1 reply | |
| 8/9 | arm64: defconfig: enable Nvidia Tegra Tachometer as a modulearch/ | +1 | 0 replies | |
| 9/9 | arm64: defconfig: enable pwm-fan as a loadable modulearch/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH V2 0/9] Implementation of Tegra Tachometer driver
The following patches adds support for PWM based Tegra Tachometer driver which implements PWM capture interface to analyze the PWM signal of a electronic fan and reports it in periods and duty cycles.
Added fan device attribute fan1_input in pwm-fan driver to monitor the speed of fan in rotations per minute using PWM interface.
RPM of Fan will be exposed to user interface through HWMON sysfs interface avialable at location: /sys/class/hwmon/hwmon0/fan1_input
Steps to validate Tachometer on Tegra186 SoC:
A. push modules pwm-tegra.ko, pwm-tegra-tachometer.ko and pwm-fan.ko to
linux device using scp command.
scp build/tegra186/drivers/pwm/pwm-tegra.ko ubuntu at 10.19.65.176:/tmp/ scp build/tegra186/drivers/pwm/pwm-tegra-tachometer.ko ubuntu at 10.19.65.176:/tmp/ scp build/tegra186/drivers/hwmon/pwm-fan.ko ubuntu at 10.19.65.176:/tmp/
B. On Linux device console, insert these modules using insmod command.
insmod /tmp/pwm-tegra.ko
insmod /tmp/pwm-tegra-tachometer.ko
insmod /tmp/pwm-fan.ko
C. Read RPM value at below sysfs node
cat /sys/calss/hwmon/hwmon0/fan1_input
D. Change the FAN speed using PWM sysfs interface. Follow below steps for the same:
a. cd /sys/class/pwm/pwmchip0
b. ls -la (make sure pwm controller is c340000.pwm)
Output should be: device -> ../../../c340000.pwm
c. echo 0 > export
d. cd pwmchip0:0
e. echo 8000 > period
f. echo 1 > enable
g. echo 8000 > duty_cycle # change duty_cycles from 0 to 8000 for FAN speed variation h. cat /sys/calss/hwmon/hwmon0/fan1_input
i. echo 4000 > duty_cycle
h. cat /sys/calss/hwmon/hwmon0/fan1_input
i. echo 2000 > duty_cycle
h. cat /sys/calss/hwmon/hwmon0/fan1_input
i. echo 0 > duty_cycle
h. cat /sys/calss/hwmon/hwmon0/fan1_input
Rajkumar Rampelli (9):
pwm: core: Add support for PWM HW driver with pwm capture only
arm64: tegra: Add PWM controller on Tegra186 soc
dt-bindings: Tegra186 tachometer device tree bindings
arm64: tegra: Add Tachometer Controller on Tegra186
pwm: tegra: Add PWM based Tachometer driver
arm64: tegra: Add pwm based fan support on Tegra186
hwmon: pwm-fan: add sysfs node to read rpm of fan
arm64: defconfig: enable Nvidia Tegra Tachometer as a module
arm64: defconfig: enable pwm-fan as a loadable module
.../bindings/pwm/pwm-tegra-tachometer.txt | 31 +++ arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 5 + arch/arm64/boot/dts/nvidia/tegra186.dtsi | 28 ++ arch/arm64/configs/defconfig | 2 + drivers/hwmon/pwm-fan.c | 23 ++ drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/core.c | 21 +- drivers/pwm/pwm-tegra-tachometer.c | 303 +++++++++++++++++++++ 9 files changed, 418 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/pwm/pwm-tegra-tachometer.txt create mode 100644 drivers/pwm/pwm-tegra-tachometer.c
Signature · 1 line
2.1.4