1.. include:: ../disclaimer-zh_CN.rst
2
3:Original: Documentation/iio/iio_configfs.rst
4
5:������:
6
7 ��������� Yanteng Si <siyanteng@loongson.cn>
8
9.. _cn_iio_configfs:
10
11=====================
12������ IIO configfs������
13=====================
14
151. ������
16=======
17
18Configfs������������������������������������������������������������IIO������������������������
19configfs���������������������������������������������������������
20
21������configfs������������������������������Documentation/filesystems/configfs.rst
22���������������������
23
242. ������
25=======
26���������configfs������IIO���������������������������������config���CONFIG_IIO_CONFIGFS
27���������
28
29���������������configfs������������(��������� /config directory������������������
30
31  $ mkdir/config
32  $ mount -t configfs none/config
33
34������������������������������IIO������������������/ config / iio������������������������ ���������
35������������������IIO���������������
36
373. ���������������
38=============
39
40IIO������configfs���������������������������������������configfs������������������������������������
41������/config/iio/triggers������������
42
43IIO������������������������������������������������������������������������include/linux/iio
44/sw_trigger.h���������������������������������������������������������������������������
45::
46
47  /*
48   * drivers/iio/trigger/iio-trig-sample.c
49   * ���������������������������������������������
50   */
51  #include <linux/iio/sw_trigger.h>
52
53
54  static struct iio_sw_trigger *iio_trig_sample_probe(const char *name)
55  {
56	/*
57	 * ���������������������������IIO���������������������������������������������������������
58	 */
59  }
60
61  static int iio_trig_sample_remove(struct iio_sw_trigger *swt)
62  {
63	/*
64	 * ������������iio_trig_sample_probe������������
65	 */
66  }
67
68  static const struct iio_sw_trigger_ops iio_trig_sample_ops = {
69	.probe		= iio_trig_sample_probe,
70	.remove		= iio_trig_sample_remove,
71  };
72
73  static struct iio_sw_trigger_type iio_trig_sample = {
74	.name = "trig-sample",
75	.owner = THIS_MODULE,
76	.ops = &iio_trig_sample_ops,
77  };
78
79  module_iio_sw_trigger_driver(iio_trig_sample);
80
81������������������������/config/iio/triggers������������������������������������iio-trig-sample
82������������������trig-sample������������������������/config/iio/triggers/trig-sample.
83
84������������������������������������������������
85
86	* hrtimer,������������������������������������������
87
883.1 Hrtimer������������������������
89---------------------------
90
91������iio-trig-hrtimer���������������hrtimer���������������������������������������
92/config/iio/triggers/hrtimer���������hrtimer������������
93
94������::
95
96  $ mkdir /config/iio/triggers/hrtimer/instance1
97  $ rmdir /config/iio/triggers/hrtimer/instance1
98
99������������������������������������������������������������������������������
100
1013.2 "hrtimer" ���������������������
102----------------------------
103
104"hrtimer������������������������������/config dir���������������������������
105���������������������������������sampling_frequency���������
106������������Hz���������������������������������������mHz���