Skip to content

Commit c8f8f8c

Browse files
xu yanopsiff
authored andcommitted
Phytium Fan tach and capture counter driver
This driver provides support for Phytium Fan Tacho and capture counter controllers. Signed-off-by: xu yan <xuyan1481@phytium.com> Signed-off-by: Zhang Yiqun <zhangyiqun@phytium.com.cn> Signed-off-by: Chen Zhenhua <chenzhenhua@phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn> Link: deepin-community#146 (cherry picked from commit 03a4d36) Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Conflicts: drivers/hwmon/Kconfig
1 parent fe0eeef commit c8f8f8c

4 files changed

Lines changed: 507 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/hwmon/phytium,tacho.yaml
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Phytium Fan Tacho and capture counter controller device driver
8+
9+
maintainers:
10+
- Chen Baozi <chenbaozi@phytium.com.cn>
11+
12+
description: |
13+
The controller can support one input signal. The function of controller is to
14+
measure the speed of fan and the edge number of input signal. The function
15+
can be selected by devicetree setting. The edging mode and anti-jitter level
16+
can also setted in devicetree.
17+
18+
properties:
19+
compatible:
20+
const: phytium,tacho
21+
22+
reg:
23+
maxItems: 1
24+
25+
clocks:
26+
maxItems: 1
27+
28+
'#address-cells':
29+
const: 1
30+
31+
'#size-cells':
32+
const: 1
33+
34+
tacho:
35+
$ref: /schemas/types.yaml#/definitions/flag
36+
description:
37+
set the controller work as fan tachometer, which is a default option.
38+
39+
capture:
40+
$ref: /schemas/types.yaml#/definitions/flag
41+
description:
42+
set the controller work as capture counter.
43+
44+
up:
45+
$ref: /schemas/types.yaml#/definitions/flag
46+
description:
47+
set the input edging mode as ascending, which is a default option.
48+
49+
down:
50+
$ref: /schemas/types.yaml#/definitions/flag
51+
description:
52+
set the input edging mode as descending.
53+
54+
double:
55+
$ref: /schemas/types.yaml#/definitions/flag
56+
description:
57+
set the input edging mode as doule-edging.
58+
59+
debounce-level:
60+
$ref: /schemas/types.yaml#/definitions/uint32
61+
enum: [0, 1, 2, 3]
62+
63+
required:
64+
- compatible
65+
- reg
66+
- clocks
67+
- '#address-cells'
68+
- '#size-cells'
69+
70+
examples:
71+
- |
72+
tacho: tacho@28054000 {
73+
#address-cells = <1>;
74+
#size-cells = <1>;
75+
reg = <0x0 0x28054000 0x0 0x1000>;
76+
compatible = "phytium,tacho";
77+
clocks = <&sysclk>;
78+
tacho;
79+
up;
80+
debounce-level = <2>;
81+
};

drivers/hwmon/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,15 @@ config SENSORS_ASPEED_G6
443443
This driver can also be built as a module. If so, the module
444444
will be called aspeed_g6_pwm_tach.
445445

446+
config SENSORS_PHYTIUM
447+
tristate "Phytium Fan tach and capture counter driver"
448+
help
449+
This driver provides support for Phytium Fan Tacho and capture
450+
counter controllers.
451+
452+
This driver can also be built as a module. If so, the module
453+
will be called tacho-phytium.
454+
446455
config SENSORS_ATXP1
447456
tristate "Attansic ATXP1 VID controller"
448457
depends on I2C

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
169169
obj-$(CONFIG_SENSORS_MC33XS2410) += mc33xs2410_hwmon.o
170170
obj-$(CONFIG_SENSORS_MC34VR500) += mc34vr500.o
171171
obj-$(CONFIG_SENSORS_MCP3021) += mcp3021.o
172+
obj-$(CONFIG_SENSORS_PHYTIUM) += tacho-phytium.o
172173
obj-$(CONFIG_SENSORS_TC654) += tc654.o
173174
obj-$(CONFIG_SENSORS_TPS23861) += tps23861.o
174175
obj-$(CONFIG_SENSORS_MLXREG_FAN) += mlxreg-fan.o

0 commit comments

Comments
 (0)