Skip to content

Commit

Permalink
Phytium Fan tach and capture counter driver
Browse files Browse the repository at this point in the history
This driver provides support for Phytium Fan Tacho and capture
counter controllers.

Signed-off-by: xu yan <[email protected]>
Signed-off-by: Zhang Yiqun <[email protected]>
Signed-off-by: Chen Zhenhua <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
  • Loading branch information
xu yan authored and MingcongBai committed May 29, 2024
1 parent 70ad6fc commit 90eabcd
Show file tree
Hide file tree
Showing 4 changed files with 507 additions and 0 deletions.
81 changes: 81 additions & 0 deletions Documentation/devicetree/bindings/hwmon/phytium,tacho.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/phytium,tacho.yaml
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Phytium Fan Tacho and capture counter controller device driver

maintainers:
- Chen Baozi <[email protected]>

description: |
The controller can support one input signal. The function of controller is to
measure the speed of fan and the edge number of input signal. The function
can be selected by devicetree setting. The edging mode and anti-jitter level
can also setted in devicetree.
properties:
compatible:
const: phytium,tacho

reg:
maxItems: 1

clocks:
maxItems: 1

'#address-cells':
const: 1

'#size-cells':
const: 1

tacho:
$ref: /schemas/types.yaml#/definitions/flag
description:
set the controller work as fan tachometer, which is a default option.

capture:
$ref: /schemas/types.yaml#/definitions/flag
description:
set the controller work as capture counter.

up:
$ref: /schemas/types.yaml#/definitions/flag
description:
set the input edging mode as ascending, which is a default option.

down:
$ref: /schemas/types.yaml#/definitions/flag
description:
set the input edging mode as descending.

double:
$ref: /schemas/types.yaml#/definitions/flag
description:
set the input edging mode as doule-edging.

debounce-level:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]

required:
- compatible
- reg
- clocks
- '#address-cells'
- '#size-cells'

examples:
- |
tacho: tacho@28054000 {
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x28054000 0x0 0x1000>;
compatible = "phytium,tacho";
clocks = <&sysclk>;
tacho;
up;
debounce-level = <2>;
};
9 changes: 9 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ config SENSORS_ASPEED
This driver can also be built as a module. If so, the module
will be called aspeed_pwm_tacho.

config SENSORS_PHYTIUM
tristate "Phytium Fan tach and capture counter driver"
help
This driver provides support for Phytium Fan Tacho and capture
counter controllers.

This driver can also be built as a module. If so, the module
will be called tacho-phytium.

config SENSORS_ATXP1
tristate "Attansic ATXP1 VID controller"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ obj-$(CONFIG_MAX31827) += max31827.o
obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
obj-$(CONFIG_SENSORS_MC34VR500) += mc34vr500.o
obj-$(CONFIG_SENSORS_MCP3021) += mcp3021.o
obj-$(CONFIG_SENSORS_PHYTIUM) += tacho-phytium.o
obj-$(CONFIG_SENSORS_TC654) += tc654.o
obj-$(CONFIG_SENSORS_TPS23861) += tps23861.o
obj-$(CONFIG_SENSORS_MLXREG_FAN) += mlxreg-fan.o
Expand Down
Loading

0 comments on commit 90eabcd

Please sign in to comment.