Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phytium Fan tach and capture counter driver #146

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -155,6 +155,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