€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ*/translations/zh_CN/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/zh_TW/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/it_IT/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ja_JP/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ko_KR/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/pt_BR/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/sp_SP/hwmon/hwmon-kernel-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ(The Linux Hardware Monitoring kernel API”h]”hŒ(The Linux Hardware Monitoring kernel API”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒD/var/lib/git/docbuild/linux/Documentation/hwmon/hwmon-kernel-api.rst”h´KubhŒ paragraph”“”)�”}”(hŒ Guenter Roeck”h]”hŒ Guenter Roeck”…”�”}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ Introduction”h]”hŒ Introduction”…”�”}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhÛh²hh³hÊh´KubhÌ)�”}”(hŒƒThis document describes the API that can be used by hardware monitoring drivers that want to use the hardware monitoring framework.”h]”hŒƒThis document describes the API that can be used by hardware monitoring drivers that want to use the hardware monitoring framework.”…”�”}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hhÛh²hubhÌ)�”}”(hX2This document does not describe what a hardware monitoring (hwmon) Driver or Device is. It also does not describe the API which can be used by user space to communicate with a hardware monitoring device. If you want to know this then please read the following file: Documentation/hwmon/sysfs-interface.rst.”h]”hX2This document does not describe what a hardware monitoring (hwmon) Driver or Device is. It also does not describe the API which can be used by user space to communicate with a hardware monitoring device. If you want to know this then please read the following file: Documentation/hwmon/sysfs-interface.rst.”…”�”}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hhÛh²hubhÌ)�”}”(hŒ�For additional guidelines on how to write and improve hwmon drivers, please also read Documentation/hwmon/submitting-patches.rst.”h]”hŒ�For additional guidelines on how to write and improve hwmon drivers, please also read Documentation/hwmon/submitting-patches.rst.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhhÛh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒThe API”h]”hŒThe API”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KubhÌ)�”}”(hŒ­Each hardware monitoring driver must #include and, in some cases, . linux/hwmon.h declares the following register/unregister functions::”h]”hŒ¬Each hardware monitoring driver must #include and, in some cases, . linux/hwmon.h declares the following register/unregister functions:”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubhŒ literal_block”“”)�”}”(hXÕstruct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, const struct attribute_group **extra_groups); struct device * devm_hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, const struct attribute_group **extra_groups); void hwmon_device_unregister(struct device *dev); char *hwmon_sanitize_name(const char *name); char *devm_hwmon_sanitize_name(struct device *dev, const char *name); int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel); void hwmon_lock(struct device *dev); void hwmon_unlock(struct device *dev);”h]”hXÕstruct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, const struct attribute_group **extra_groups); struct device * devm_hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, const struct attribute_group **extra_groups); void hwmon_device_unregister(struct device *dev); char *hwmon_sanitize_name(const char *name); char *devm_hwmon_sanitize_name(struct device *dev, const char *name); int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel); void hwmon_lock(struct device *dev); void hwmon_unlock(struct device *dev);”…”�”}”hj?sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j=h³hÊh´Khjh²hubhÌ)�”}”(hX„hwmon_device_register_with_info registers a hardware monitoring device. It creates the standard sysfs attributes in the hardware monitoring core, letting the driver focus on reading from and writing to the chip instead of having to bother with sysfs attributes. The parent device parameter as well as the chip parameter must not be NULL. Its parameters are described in more detail below.”h]”hX„hwmon_device_register_with_info registers a hardware monitoring device. It creates the standard sysfs attributes in the hardware monitoring core, letting the driver focus on reading from and writing to the chip instead of having to bother with sysfs attributes. The parent device parameter as well as the chip parameter must not be NULL. Its parameters are described in more detail below.”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K3hjh²hubhÌ)�”}”(hŒËdevm_hwmon_device_register_with_info is similar to hwmon_device_register_with_info. However, it is device managed, meaning the hwmon device does not have to be removed explicitly by the removal function.”h]”hŒËdevm_hwmon_device_register_with_info is similar to hwmon_device_register_with_info. However, it is device managed, meaning the hwmon device does not have to be removed explicitly by the removal function.”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K:hjh²hubhÌ)�”}”(hŒoAll other hardware monitoring device registration functions are deprecated and must not be used in new drivers.”h]”hŒoAll other hardware monitoring device registration functions are deprecated and must not be used in new drivers.”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K>hjh²hubhÌ)�”}”(hXFhwmon_device_unregister deregisters a registered hardware monitoring device. The parameter of this function is the pointer to the registered hardware monitoring device structure. This function must be called from the driver remove function if the hardware monitoring device was registered with hwmon_device_register_with_info.”h]”hXFhwmon_device_unregister deregisters a registered hardware monitoring device. The parameter of this function is the pointer to the registered hardware monitoring device structure. This function must be called from the driver remove function if the hardware monitoring device was registered with hwmon_device_register_with_info.”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KAhjh²hubhÌ)�”}”(hXAll supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, '*', or '-') will be rejected. If NULL is passed as name parameter, the hardware monitoring device name will be derived from the parent device name.”h]”hX%All supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, ‘*’, or ‘-‘) will be rejected. If NULL is passed as name parameter, the hardware monitoring device name will be derived from the parent device name.”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KGhjh²hubhÌ)�”}”(hX¬If the driver doesn't use a static device name (for example it uses dev_name()), and therefore cannot make sure the name only contains valid characters, hwmon_sanitize_name can be used. This convenience function will duplicate the string and replace any invalid characters with an underscore. It will allocate memory for the new string and it is the responsibility of the caller to release the memory when the device is removed.”h]”hX®If the driver doesn’t use a static device name (for example it uses dev_name()), and therefore cannot make sure the name only contains valid characters, hwmon_sanitize_name can be used. This convenience function will duplicate the string and replace any invalid characters with an underscore. It will allocate memory for the new string and it is the responsibility of the caller to release the memory when the device is removed.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KLhjh²hubhÌ)�”}”(hŒŠdevm_hwmon_sanitize_name is the resource managed version of hwmon_sanitize_name; the memory will be freed automatically on device removal.”h]”hŒŠdevm_hwmon_sanitize_name is the resource managed version of hwmon_sanitize_name; the memory will be freed automatically on device removal.”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KThjh²hubhÌ)�”}”(hXþWhen using ``[devm_]hwmon_device_register_with_info()`` to register the hardware monitoring device, accesses using the associated access functions are serialised by the hardware monitoring core. If a driver needs locking for other functions such as interrupt handlers, attributes which are fully implemented in the driver, or debugfs functions, hwmon_lock() and hwmon_unlock() can be used to ensure that calls to those functions are serialized. Those functions also support guard() and scoped_guard() variants.”h]”(hŒ When using ”…”�”}”(hj±h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ,``[devm_]hwmon_device_register_with_info()``”h]”hŒ([devm_]hwmon_device_register_with_info()”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj±ubhXÇ to register the hardware monitoring device, accesses using the associated access functions are serialised by the hardware monitoring core. If a driver needs locking for other functions such as interrupt handlers, attributes which are fully implemented in the driver, or debugfs functions, hwmon_lock() and hwmon_unlock() can be used to ensure that calls to those functions are serialized. Those functions also support guard() and scoped_guard() variants.”…”�”}”(hj±h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KXhjh²hubhÌ)�”}”(hX Drivers can call hwmon_notify_event() to notify userspace and the thermal subsystem when a hardware monitoring event (such as an alarm or a fault condition) occurs or clears. The parameters are the hwmon device, the sensor type, the attribute identifier associated with the event (such as hwmon_temp_max_alarm or hwmon_fan_fault), and the sensor channel number. hwmon_notify_event() generates a sysfs event (calling sysfs_notify()) and a udev event with the attribute name passed in the NAME environment property (e.g., "NAME=temp1_max_alarm"). If the event is for a temperature sensor and the sensor is attached to a thermal zone, it also notifies the thermal subsystem to update the thermal zone. hwmon_notify_event() returns 0 on success or a negative error code on failure.”h]”hX Drivers can call hwmon_notify_event() to notify userspace and the thermal subsystem when a hardware monitoring event (such as an alarm or a fault condition) occurs or clears. The parameters are the hwmon device, the sensor type, the attribute identifier associated with the event (such as hwmon_temp_max_alarm or hwmon_fan_fault), and the sensor channel number. hwmon_notify_event() generates a sysfs event (calling sysfs_notify()) and a udev event with the attribute name passed in the NAME environment property (e.g., “NAME=temp1_max_alarmâ€�). If the event is for a temperature sensor and the sensor is attached to a thermal zone, it also notifies the thermal subsystem to update the thermal zone. hwmon_notify_event() returns 0 on success or a negative error code on failure.”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K`hjh²hubeh}”(h]”Œthe-api”ah ]”h"]”Œthe api”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒ,Using devm_hwmon_device_register_with_info()”h]”hŒ,Using devm_hwmon_device_register_with_info()”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjéh²hh³hÊh´KmubhÌ)�”}”(hŒmhwmon_device_register_with_info() registers a hardware monitoring device. The parameters to this function are”h]”hŒmhwmon_device_register_with_info() registers a hardware monitoring device. The parameters to this function are”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kohjéh²hubhŒtable”“”)�”}”(hhh]”hŒtgroup”“”)�”}”(hhh]”(hŒcolspec”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K/uh1jhjubj)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K/uh1jhjubhŒtbody”“”)�”}”(hhh]”(hŒrow”“”)�”}”(hhh]”(hŒentry”“”)�”}”(hhh]”hÌ)�”}”(hŒ`struct device *dev`”h]”hŒtitle_reference”“”)�”}”(hj9h]”hŒstruct device *dev”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kshj4ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubj3)�”}”(hhh]”hÌ)�”}”(hŒPointer to parent device”h]”hŒPointer to parent device”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KshjVubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj*ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ`const char *name`”h]”j<)�”}”(hj{h]”hŒconst char *name”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hjyubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kthjvubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjsubj3)�”}”(hhh]”hÌ)�”}”(hŒ Device name”h]”hŒ Device name”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kthj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjsubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj*ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ`void *drvdata`”h]”j<)�”}”(hj»h]”hŒ void *drvdata”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kuhj¶ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj³ubj3)�”}”(hhh]”hÌ)�”}”(hŒDriver private data”h]”hŒDriver private data”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KuhjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj³ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj*ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ$`const struct hwmon_chip_info *info`”h]”j<)�”}”(hjûh]”hŒ"const struct hwmon_chip_info *info”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hjùubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kvhjöubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjóubj3)�”}”(hhh]”hÌ)�”}”(hŒPointer to chip description.”h]”hŒPointer to chip description.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kvhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjóubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj*ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ-`const struct attribute_group **extra_groups`”h]”j<)�”}”(hj;h]”hŒ+const struct attribute_group **extra_groups”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kwhj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj3ubj3)�”}”(hhh]”hÌ)�”}”(hŒGNull-terminated list of additional non-standard sysfs attribute groups.”h]”hŒGNull-terminated list of additional non-standard sysfs attribute groups.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KwhjVubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj3ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j(hjubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjéh²hh³hÊh´NubhÌ)�”}”(hŒ{This function returns a pointer to the created hardware monitoring device on success and a negative error code for failure.”h]”hŒ{This function returns a pointer to the created hardware monitoring device on success and a negative error code for failure.”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K{hjéh²hubhÌ)�”}”(hŒ0The hwmon_chip_info structure looks as follows::”h]”hŒ/The hwmon_chip_info structure looks as follows:”…”�”}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K~hjéh²hubj>)�”}”(hŒwstruct hwmon_chip_info { const struct hwmon_ops *ops; const struct hwmon_channel_info * const *info; };”h]”hŒwstruct hwmon_chip_info { const struct hwmon_ops *ops; const struct hwmon_channel_info * const *info; };”…”�”}”hj¢sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´K€hjéh²hubhÌ)�”}”(hŒ!It contains the following fields:”h]”hŒ!It contains the following fields:”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K…hjéh²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ(ops: Pointer to device operations.”h]”hŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hŒ"ops: Pointer to device operations.”h]”(hŒterm”“”)�”}”(hŒops:”h]”hŒops:”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´K‡hjÐubhŒ definition”“”)�”}”(hhh]”hÌ)�”}”(hŒPointer to device operations.”h]”hŒPointer to device operations.”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kˆhjæubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÐubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´K‡hjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÅubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhjÀh²hh³Nh´NubjÄ)�”}”(hŒ@info: NULL-terminated list of device channel descriptors. ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hŒ:info: NULL-terminated list of device channel descriptors. ”h]”(jÕ)�”}”(hŒinfo:”h]”hŒinfo:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´KŠhjubjå)�”}”(hhh]”hÌ)�”}”(hŒ3NULL-terminated list of device channel descriptors.”h]”hŒ3NULL-terminated list of device channel descriptors.”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŠhj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´KŠhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhjÀh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1j¾h³hÊh´K‡hjéh²hubhÌ)�”}”(hŒ,The list of hwmon operations is defined as::”h]”hŒ+The list of hwmon operations is defined as:”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhjéh²hubj>)�”}”(hX_struct hwmon_ops { umode_t (*is_visible)(const void *, enum hwmon_sensor_types type, u32 attr, int); int (*read)(struct device *, enum hwmon_sensor_types type, u32 attr, int, long *); int (*write)(struct device *, enum hwmon_sensor_types type, u32 attr, int, long); };”h]”hX_struct hwmon_ops { umode_t (*is_visible)(const void *, enum hwmon_sensor_types type, u32 attr, int); int (*read)(struct device *, enum hwmon_sensor_types type, u32 attr, int, long *); int (*write)(struct device *, enum hwmon_sensor_types type, u32 attr, int, long); };”…”�”}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´KŽhjéh²hubhÌ)�”}”(hŒ$It defines the following operations.”h]”hŒ$It defines the following operations.”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K—hjéh²hubj¿)�”}”(hhh]”(jÄ)�”}”(hŒxis_visible: Pointer to a function to return the file mode for each supported attribute. This function is mandatory. ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hŒtis_visible: Pointer to a function to return the file mode for each supported attribute. This function is mandatory. ”h]”(jÕ)�”}”(hŒ is_visible:”h]”hŒ is_visible:”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´K›hj�ubjå)�”}”(hhh]”hÌ)�”}”(hŒgPointer to a function to return the file mode for each supported attribute. This function is mandatory.”h]”hŒgPointer to a function to return the file mode for each supported attribute. This function is mandatory.”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KšhjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´K›hjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhjƒh²hh³Nh´NubjÄ)�”}”(hŒ•read: Pointer to a function for reading a value from the chip. This function is optional, but must be provided if any readable attributes exist. ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hŒ‘read: Pointer to a function for reading a value from the chip. This function is optional, but must be provided if any readable attributes exist. ”h]”(jÕ)�”}”(hŒread:”h]”hŒread:”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´KŸhjÏubjå)�”}”(hhh]”hÌ)�”}”(hŒŠPointer to a function for reading a value from the chip. This function is optional, but must be provided if any readable attributes exist.”h]”hŒŠPointer to a function for reading a value from the chip. This function is optional, but must be provided if any readable attributes exist.”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kžhjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÏubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´KŸhjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhjƒh²hh³Nh´NubjÄ)�”}”(hŒ•write: Pointer to a function for writing a value to the chip. This function is optional, but must be provided if any writeable attributes exist. ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hŒ‘write: Pointer to a function for writing a value to the chip. This function is optional, but must be provided if any writeable attributes exist. ”h]”(jÕ)�”}”(hŒwrite:”h]”hŒwrite:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´K£hjubjå)�”}”(hhh]”hÌ)�”}”(hŒ‰Pointer to a function for writing a value to the chip. This function is optional, but must be provided if any writeable attributes exist.”h]”hŒ‰Pointer to a function for writing a value to the chip. This function is optional, but must be provided if any writeable attributes exist.”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¢hj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´K£hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhjƒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jWjXuh1j¾h³hÊh´K™hjéh²hubhÌ)�”}”(hŒ^Each sensor channel is described with struct hwmon_channel_info, which is defined as follows::”h]”hŒ]Each sensor channel is described with struct hwmon_channel_info, which is defined as follows:”…”�”}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¥hjéh²hubj>)�”}”(hŒYstruct hwmon_channel_info { enum hwmon_sensor_types type; u32 *config; };”h]”hŒYstruct hwmon_channel_info { enum hwmon_sensor_types type; u32 *config; };”…”�”}”hj`sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´K¨hjéh²hubhÌ)�”}”(hŒIt contains following fields:”h]”hŒIt contains following fields:”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K­hjéh²hubj¿)�”}”(hhh]”(jÄ)�”}”(hXåtype: The hardware monitoring sensor type. Supported sensor types are ================== ================================================== hwmon_chip A virtual sensor type, used to describe attributes which are not bound to a specific input or output hwmon_temp Temperature sensor hwmon_in Voltage sensor hwmon_curr Current sensor hwmon_power Power sensor hwmon_energy Energy sensor hwmon_energy64 Energy sensor, reported as 64-bit signed value hwmon_humidity Humidity sensor hwmon_fan Fan speed sensor hwmon_pwm PWM control ================== ================================================== ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hXÇtype: The hardware monitoring sensor type. Supported sensor types are ================== ================================================== hwmon_chip A virtual sensor type, used to describe attributes which are not bound to a specific input or output hwmon_temp Temperature sensor hwmon_in Voltage sensor hwmon_curr Current sensor hwmon_power Power sensor hwmon_energy Energy sensor hwmon_energy64 Energy sensor, reported as 64-bit signed value hwmon_humidity Humidity sensor hwmon_fan Fan speed sensor hwmon_pwm PWM control ================== ================================================== ”h]”(jÕ)�”}”(hŒtype:”h]”hŒtype:”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´KÀhj†ubjå)�”}”(hhh]”(hÌ)�”}”(hŒ$The hardware monitoring sensor type.”h]”hŒ$The hardware monitoring sensor type.”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K°hj˜ubhÌ)�”}”(hŒSupported sensor types are”h]”hŒSupported sensor types are”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hj˜ubhŒ block_quote”“”)�”}”(hXr================== ================================================== hwmon_chip A virtual sensor type, used to describe attributes which are not bound to a specific input or output hwmon_temp Temperature sensor hwmon_in Voltage sensor hwmon_curr Current sensor hwmon_power Power sensor hwmon_energy Energy sensor hwmon_energy64 Energy sensor, reported as 64-bit signed value hwmon_humidity Humidity sensor hwmon_fan Fan speed sensor hwmon_pwm PWM control ================== ================================================== ”h]”j )�”}”(hhh]”j)�”}”(hhh]”(j)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jhjÀubj)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K2uh1jhjÀubj))�”}”(hhh]”(j.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_chip”h]”hŒ hwmon_chip”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KµhjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÚubj3)�”}”(hhh]”hÌ)�”}”(hŒdA virtual sensor type, used to describe attributes which are not bound to a specific input or output”h]”hŒdA virtual sensor type, used to describe attributes which are not bound to a specific input or output”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kµhjôubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÚubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_temp”h]”hŒ hwmon_temp”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K·hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjubj3)�”}”(hhh]”hÌ)�”}”(hŒTemperature sensor”h]”hŒTemperature sensor”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K·hj+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒhwmon_in”h]”hŒhwmon_in”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¸hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjHubj3)�”}”(hhh]”hÌ)�”}”(hŒVoltage sensor”h]”hŒVoltage sensor”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¸hjbubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_curr”h]”hŒ hwmon_curr”…”�”}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¹hj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjubj3)�”}”(hhh]”hÌ)�”}”(hŒCurrent sensor”h]”hŒCurrent sensor”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¹hj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_power”h]”hŒ hwmon_power”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kºhj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj¶ubj3)�”}”(hhh]”hÌ)�”}”(hŒ Power sensor”h]”hŒ Power sensor”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KºhjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj¶ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_energy”h]”hŒ hwmon_energy”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K»hjðubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjíubj3)�”}”(hhh]”hÌ)�”}”(hŒ Energy sensor”h]”hŒ Energy sensor”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K»hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjíubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒhwmon_energy64”h]”hŒhwmon_energy64”…”�”}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¼hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj$ubj3)�”}”(hhh]”hÌ)�”}”(hŒ.Energy sensor, reported as 64-bit signed value”h]”hŒ.Energy sensor, reported as 64-bit signed value”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¼hj>ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj$ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒhwmon_humidity”h]”hŒhwmon_humidity”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K½hj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj[ubj3)�”}”(hhh]”hÌ)�”}”(hŒHumidity sensor”h]”hŒHumidity sensor”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K½hjuubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj[ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_fan”h]”hŒ hwmon_fan”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj’ubj3)�”}”(hhh]”hÌ)�”}”(hŒFan speed sensor”h]”hŒFan speed sensor”…”�”}”(hj¯h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ hwmon_pwm”h]”hŒ hwmon_pwm”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¿hjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÉubj3)�”}”(hhh]”hÌ)�”}”(hŒ PWM control”h]”hŒ PWM control”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¿hjãubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÉubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj×ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j(hjÀubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j hj½ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1j·h³hÊh´K´hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähj†ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´KÀhjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhj|h²hh³Nh´NubjÄ)�”}”(hŒÉconfig: Pointer to a 0-terminated list of configuration values for each sensor of the given type. Each value is a combination of bit values describing the attributes supposed by a single sensor. ”h]”jÊ)�”}”(hhh]”jÏ)�”}”(hŒÃconfig: Pointer to a 0-terminated list of configuration values for each sensor of the given type. Each value is a combination of bit values describing the attributes supposed by a single sensor. ”h]”(jÕ)�”}”(hŒconfig:”h]”hŒconfig:”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´KÅhj8ubjå)�”}”(hhh]”hÌ)�”}”(hŒºPointer to a 0-terminated list of configuration values for each sensor of the given type. Each value is a combination of bit values describing the attributes supposed by a single sensor.”h]”hŒºPointer to a 0-terminated list of configuration values for each sensor of the given type. Each value is a combination of bit values describing the attributes supposed by a single sensor.”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÃhjJubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj8ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´KÅhj5ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÃhj|h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jWjXuh1j¾h³hÊh´K¯hjéh²hubhÌ)�”}”(hXÒAs an example, here is the complete description file for a LM75 compatible sensor chip. The chip has a single temperature sensor. The driver wants to register with the thermal subsystem (HWMON_C_REGISTER_TZ), and it supports the update_interval attribute (HWMON_C_UPDATE_INTERVAL). The chip supports reading the temperature (HWMON_T_INPUT), it has a maximum temperature register (HWMON_T_MAX) as well as a maximum temperature hysteresis register (HWMON_T_MAX_HYST)::”h]”hXÑAs an example, here is the complete description file for a LM75 compatible sensor chip. The chip has a single temperature sensor. The driver wants to register with the thermal subsystem (HWMON_C_REGISTER_TZ), and it supports the update_interval attribute (HWMON_C_UPDATE_INTERVAL). The chip supports reading the temperature (HWMON_T_INPUT), it has a maximum temperature register (HWMON_T_MAX) as well as a maximum temperature hysteresis register (HWMON_T_MAX_HYST):”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÇhjéh²hubj>)�”}”(hXstatic const u32 lm75_chip_config[] = { HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL, 0 }; static const struct hwmon_channel_info lm75_chip = { .type = hwmon_chip, .config = lm75_chip_config, }; static const u32 lm75_temp_config[] = { HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST, 0 }; static const struct hwmon_channel_info lm75_temp = { .type = hwmon_temp, .config = lm75_temp_config, }; static const struct hwmon_channel_info * const lm75_info[] = { &lm75_chip, &lm75_temp, NULL }; The HWMON_CHANNEL_INFO() macro can and should be used when possible. With this macro, the above example can be simplified to static const struct hwmon_channel_info * const lm75_info[] = { HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST), NULL }; The remaining declarations are as follows. static const struct hwmon_ops lm75_hwmon_ops = { .is_visible = lm75_is_visible, .read = lm75_read, .write = lm75_write, }; static const struct hwmon_chip_info lm75_chip_info = { .ops = &lm75_hwmon_ops, .info = lm75_info, };”h]”hXstatic const u32 lm75_chip_config[] = { HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL, 0 }; static const struct hwmon_channel_info lm75_chip = { .type = hwmon_chip, .config = lm75_chip_config, }; static const u32 lm75_temp_config[] = { HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST, 0 }; static const struct hwmon_channel_info lm75_temp = { .type = hwmon_temp, .config = lm75_temp_config, }; static const struct hwmon_channel_info * const lm75_info[] = { &lm75_chip, &lm75_temp, NULL }; The HWMON_CHANNEL_INFO() macro can and should be used when possible. With this macro, the above example can be simplified to static const struct hwmon_channel_info * const lm75_info[] = { HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST), NULL }; The remaining declarations are as follows. static const struct hwmon_ops lm75_hwmon_ops = { .is_visible = lm75_is_visible, .read = lm75_read, .write = lm75_write, }; static const struct hwmon_chip_info lm75_chip_info = { .ops = &lm75_hwmon_ops, .info = lm75_info, };”…”�”}”hj‡sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´KÏhjéh²hubhÌ)�”}”(hŒŽA complete list of bit values indicating individual attribute support is defined in include/linux/hwmon.h. Definition prefixes are as follows.”h]”hŒŽA complete list of bit values indicating individual attribute support is defined in include/linux/hwmon.h. Definition prefixes are as follows.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjéh²hubj )�”}”(hhh]”j)�”}”(hhh]”(j)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jhj¦ubj)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K1uh1jhj¦ubj))�”}”(hhh]”(j.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_C_xxxx”h]”hŒ HWMON_C_xxxx”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÃubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÀubj3)�”}”(hhh]”hÌ)�”}”(hŒ)Chip attributes, for use with hwmon_chip.”h]”hŒ)Chip attributes, for use with hwmon_chip.”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÚubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÀubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_T_xxxx”h]”hŒ HWMON_T_xxxx”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjúubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj÷ubj3)�”}”(hhh]”hÌ)�”}”(hŒ0Temperature attributes, for use with hwmon_temp.”h]”hŒ0Temperature attributes, for use with hwmon_temp.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj÷ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_I_xxxx”h]”hŒ HWMON_I_xxxx”…”�”}”(hj4 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj1 ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj. ubj3)�”}”(hhh]”hÌ)�”}”(hŒ*Voltage attributes, for use with hwmon_in.”h]”hŒ*Voltage attributes, for use with hwmon_in.”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjH ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj. ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_C_xxxx”h]”hŒ HWMON_C_xxxx”…”�”}”(hjk h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjh ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hje ubj3)�”}”(hhh]”hÌ)�”}”(hŒ\Current attributes, for use with hwmon_curr. Notice the prefix overlap with chip attributes.”h]”hŒ\Current attributes, for use with hwmon_curr. Notice the prefix overlap with chip attributes.”…”�”}”(hj‚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hje ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_P_xxxx”h]”hŒ HWMON_P_xxxx”…”�”}”(hj¢ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjŸ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjœ ubj3)�”}”(hhh]”hÌ)�”}”(hŒ+Power attributes, for use with hwmon_power.”h]”hŒ+Power attributes, for use with hwmon_power.”…”�”}”(hj¹ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj¶ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjœ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_E_xxxx”h]”hŒ HWMON_E_xxxx”…”�”}”(hjÙ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjÖ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÓ ubj3)�”}”(hhh]”hÌ)�”}”(hŒ-Energy attributes, for use with hwmon_energy.”h]”hŒ-Energy attributes, for use with hwmon_energy.”…”�”}”(hjð h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjí ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjÓ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_H_xxxx”h]”hŒ HWMON_H_xxxx”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj ubj3)�”}”(hhh]”hÌ)�”}”(hŒ1Humidity attributes, for use with hwmon_humidity.”h]”hŒ1Humidity attributes, for use with hwmon_humidity.”…”�”}”(hj' h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj$ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒ HWMON_F_xxxx”h]”hŒ HWMON_F_xxxx”…”�”}”(hjG h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjD ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjA ubj3)�”}”(hhh]”hÌ)�”}”(hŒ-Fan speed attributes, for use with hwmon_fan.”h]”hŒ-Fan speed attributes, for use with hwmon_fan.”…”�”}”(hj^ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj[ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjA ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubj.)�”}”(hhh]”(j3)�”}”(hhh]”hÌ)�”}”(hŒHWMON_PWM_xxxx”h]”hŒHWMON_PWM_xxxx”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj{ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjx ubj3)�”}”(hhh]”hÌ)�”}”(hŒ/PWM control attributes, for use with hwmon_pwm.”h]”hŒ/PWM control attributes, for use with hwmon_pwm.”…”�”}”(hj• h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj’ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjx ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j-hj½ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j(hj¦ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j hj£ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjéh²hh³hÊh´Nubeh}”(h]”Œ*using-devm-hwmon-device-register-with-info”ah ]”h"]”Œ,using devm_hwmon_device_register_with_info()”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kmubh¶)�”}”(hhh]”(h»)�”}”(hŒDriver callback functions”h]”hŒDriver callback functions”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÊ h²hh³hÊh´MubhÌ)�”}”(hŒ}Each driver provides is_visible, read, and write functions. Parameters and return values for those functions are as follows::”h]”hŒ|Each driver provides is_visible, read, and write functions. Parameters and return values for those functions are as follows:”…”�”}”(hjÛ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÊ h²hubj>)�”}”(hŒvumode_t is_visible_func(const void *data, enum hwmon_sensor_types type, u32 attr, int channel)”h]”hŒvumode_t is_visible_func(const void *data, enum hwmon_sensor_types type, u32 attr, int channel)”…”�”}”hjé sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´MhjÊ h²hubjÊ)�”}”(hhh]”(jÏ)�”}”(hX˜Parameters: data: Pointer to device private data structure. type: The sensor type. attr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings of bit fields to attribute values please see include/linux/hwmon.h. channel: The sensor channel number. ”h]”(jÕ)�”}”(hŒ Parameters:”h]”hŒ Parameters:”…”�”}”(hjþ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M%hjú ubjå)�”}”(hhh]”jÊ)�”}”(hhh]”(jÏ)�”}”(hŒ/data: Pointer to device private data structure.”h]”(jÕ)�”}”(hŒdata:”h]”hŒdata:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´Mhj ubjå)�”}”(hhh]”hÌ)�”}”(hŒ)Pointer to device private data structure.”h]”hŒ)Pointer to device private data structure.”…”�”}”(hj' h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj$ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´Mhj ubjÏ)�”}”(hŒtype: The sensor type.”h]”(jÕ)�”}”(hŒtype:”h]”hŒtype:”…”�”}”(hjE h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MhjA ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor type.”h]”hŒThe sensor type.”…”�”}”(hjV h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjS ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjA ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´Mhj ubjÏ)�”}”(hŒèattr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings of bit fields to attribute values please see include/linux/hwmon.h.”h]”(jÕ)�”}”(hŒattr:”h]”hŒattr:”…”�”}”(hjt h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M"hjp ubjå)�”}”(hhh]”hÌ)�”}”(hŒâAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings of bit fields to attribute values please see include/linux/hwmon.h.”h]”hŒâAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings of bit fields to attribute values please see include/linux/hwmon.h.”…”�”}”(hj… h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj‚ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjp ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M"hj ubjÏ)�”}”(hŒ$channel: The sensor channel number. ”h]”(jÕ)�”}”(hŒchannel:”h]”hŒchannel:”…”�”}”(hj£ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M%hjŸ ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor channel number.”h]”hŒThe sensor channel number.”…”�”}”(hj´ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M%hj± ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjŸ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M%hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjú ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M%hj÷ ubjÏ)�”}”(hŒ~Return value: The file mode for this attribute. Typically, this will be 0 (the attribute will not be created), 0444, or 0644. ”h]”(jÕ)�”}”(hŒ Return value:”h]”hŒ Return value:”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M)hjà ubjå)�”}”(hhh]”hÌ)�”}”(hŒoThe file mode for this attribute. Typically, this will be 0 (the attribute will not be created), 0444, or 0644.”h]”hŒoThe file mode for this attribute. Typically, this will be 0 (the attribute will not be created), 0444, or 0644.”…”�”}”(hjõ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M(hjò ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjà ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M)hj÷ h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÊ h²hh³Nh´Nubj>)�”}”(hŒoint read_func(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long *val)”h]”hŒoint read_func(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long *val)”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´M-hjÊ h²hubjÊ)�”}”(hhh]”(jÏ)�”}”(hXParameters: dev: Pointer to the hardware monitoring device. type: The sensor type. attr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h. channel: The sensor channel number. val: Pointer to attribute value. For hwmon_energy64, `'val`' is passed as `long *` but needs a typecast to `s64 *`. ”h]”(jÕ)�”}”(hŒ Parameters:”h]”hŒ Parameters:”…”�”}”(hj* h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M?hj& ubjå)�”}”(hhh]”jÊ)�”}”(hhh]”(jÏ)�”}”(hŒ/dev: Pointer to the hardware monitoring device.”h]”(jÕ)�”}”(hŒdev:”h]”hŒdev:”…”�”}”(hjB h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M1hj> ubjå)�”}”(hhh]”hÌ)�”}”(hŒ*Pointer to the hardware monitoring device.”h]”hŒ*Pointer to the hardware monitoring device.”…”�”}”(hjS h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M2hjP ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj> ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M1hj; ubjÏ)�”}”(hŒtype: The sensor type.”h]”(jÕ)�”}”(hŒtype:”h]”hŒtype:”…”�”}”(hjq h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M3hjm ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor type.”h]”hŒThe sensor type.”…”�”}”(hj‚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M4hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjm ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M3hj; ubjÏ)�”}”(hŒÆattr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”h]”(jÕ)�”}”(hŒattr:”h]”hŒattr:”…”�”}”(hj  h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M8hjœ ubjå)�”}”(hhh]”hÌ)�”}”(hŒÀAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”h]”hŒÀAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”…”�”}”(hj± h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M6hj® ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjœ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M8hj; ubjÏ)�”}”(hŒ#channel: The sensor channel number.”h]”(jÕ)�”}”(hŒchannel:”h]”hŒchannel:”…”�”}”(hjÏ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M:hjË ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor channel number.”h]”hŒThe sensor channel number.”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M;hjÝ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjË ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M:hj; ubjÏ)�”}”(hŒtval: Pointer to attribute value. For hwmon_energy64, `'val`' is passed as `long *` but needs a typecast to `s64 *`. ”h]”(jÕ)�”}”(hŒval:”h]”hŒval:”…”�”}”(hjþ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´M?hjú ubjå)�”}”(hhh]”hÌ)�”}”(hŒnPointer to attribute value. For hwmon_energy64, `'val`' is passed as `long *` but needs a typecast to `s64 *`.”h]”(hŒ0Pointer to attribute value. For hwmon_energy64, ”…”�”}”(hj h²hh³Nh´Nubj<)�”}”(hŒ`'val`”h]”hŒ‘val”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj ubhŒ’ is passed as ”…”�”}”(hj h²hh³Nh´Nubj<)�”}”(hŒ`long *`”h]”hŒlong *”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj ubhŒ but needs a typecast to ”…”�”}”(hj h²hh³Nh´Nubj<)�”}”(hŒ`s64 *`”h]”hŒs64 *”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj ubhŒ.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M=hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjú ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M?hj; ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhj8 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj& ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´M?hj# ubjÏ)�”}”(hŒ?Return value: 0 on success, a negative error number otherwise. ”h]”(jÕ)�”}”(hŒ Return value:”h]”hŒ Return value:”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MBhjq ubjå)�”}”(hhh]”hÌ)�”}”(hŒ00 on success, a negative error number otherwise.”h]”hŒ00 on success, a negative error number otherwise.”…”�”}”(hj† h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MBhjƒ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjq ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MBhj# h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÊ h²hh³Nh´Nubj>)�”}”(hŒpint write_func(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long val)”h]”hŒpint write_func(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, long val)”…”�”}”hj¦ sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´MFhjÊ h²hubjÊ)�”}”(hhh]”(jÏ)�”}”(hX£Parameters: dev: Pointer to the hardware monitoring device. type: The sensor type. attr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h. channel: The sensor channel number. val: The value to write to the chip. ”h]”(jÕ)�”}”(hŒ Parameters:”h]”hŒ Parameters:”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MVhj· ubjå)�”}”(hhh]”jÊ)�”}”(hhh]”(jÏ)�”}”(hŒ/dev: Pointer to the hardware monitoring device.”h]”(jÕ)�”}”(hŒdev:”h]”hŒdev:”…”�”}”(hjÓ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MJhjÏ ubjå)�”}”(hhh]”hÌ)�”}”(hŒ*Pointer to the hardware monitoring device.”h]”hŒ*Pointer to the hardware monitoring device.”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MKhjá ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÏ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MJhjÌ ubjÏ)�”}”(hŒtype: The sensor type.”h]”(jÕ)�”}”(hŒtype:”h]”hŒtype:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MLhjþ ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor type.”h]”hŒThe sensor type.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MMhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjþ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MLhjÌ ubjÏ)�”}”(hŒÆattr: Attribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”h]”(jÕ)�”}”(hŒattr:”h]”hŒattr:”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MQhj-ubjå)�”}”(hhh]”hÌ)�”}”(hŒÀAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”h]”hŒÀAttribute identifier associated with a specific attribute. For example, the attribute value for HWMON_T_INPUT would be hwmon_temp_input. For complete mappings please see include/linux/hwmon.h.”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MOhj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj-ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MQhjÌ ubjÏ)�”}”(hŒ#channel: The sensor channel number.”h]”(jÕ)�”}”(hŒchannel:”h]”hŒchannel:”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MShj\ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe sensor channel number.”h]”hŒThe sensor channel number.”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MThjnubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj\ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MShjÌ ubjÏ)�”}”(hŒ%val: The value to write to the chip. ”h]”(jÕ)�”}”(hŒval:”h]”hŒval:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MVhj‹ubjå)�”}”(hhh]”hÌ)�”}”(hŒThe value to write to the chip.”h]”hŒThe value to write to the chip.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MVhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj‹ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MVhjÌ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÉ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj· ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MVhj´ ubjÏ)�”}”(hŒ@Return value: 0 on success, a negative error number otherwise. ”h]”(jÕ)�”}”(hŒ Return value:”h]”hŒ Return value:”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´MZhjÌubjå)�”}”(hhh]”hÌ)�”}”(hŒ00 on success, a negative error number otherwise.”h]”hŒ00 on success, a negative error number otherwise.”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MYhjÞubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÌubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎh³hÊh´MZhj´ h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÉhjÊ h²hh³Nh´Nubeh}”(h]”Œdriver-callback-functions”ah ]”h"]”Œdriver callback functions”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubh¶)�”}”(hhh]”(h»)�”}”(hŒ Driver-provided sysfs attributes”h]”hŒ Driver-provided sysfs attributes”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´M]ubhÌ)�”}”(hŒÖIn most situations it should not be necessary for a driver to provide sysfs attributes since the hardware monitoring core creates those internally. Only additional non-standard sysfs attributes need to be provided.”h]”hŒÖIn most situations it should not be necessary for a driver to provide sysfs attributes since the hardware monitoring core creates those internally. Only additional non-standard sysfs attributes need to be provided.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M_hj h²hubhÌ)�”}”(hŒThe header file linux/hwmon-sysfs.h provides a number of useful macros to declare and use hardware monitoring sysfs attributes.”h]”hŒThe header file linux/hwmon-sysfs.h provides a number of useful macros to declare and use hardware monitoring sysfs attributes.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mchj h²hubhÌ)�”}”(hXSIn many cases, you can use the existing define DEVICE_ATTR or its variants DEVICE_ATTR_{RW,RO,WO} to declare such attributes. This is feasible if an attribute has no additional context. However, in many cases there will be additional information such as a sensor index which will need to be passed to the sysfs attribute handling function.”h]”hXSIn many cases, you can use the existing define DEVICE_ATTR or its variants DEVICE_ATTR_{RW,RO,WO} to declare such attributes. This is feasible if an attribute has no additional context. However, in many cases there will be additional information such as a sensor index which will need to be passed to the sysfs attribute handling function.”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mfhj h²hubhÌ)�”}”(hŒÔSENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 can be used to define attributes which need such additional context information. SENSOR_DEVICE_ATTR requires one additional argument, SENSOR_DEVICE_ATTR_2 requires two.”h]”hŒÔSENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 can be used to define attributes which need such additional context information. SENSOR_DEVICE_ATTR requires one additional argument, SENSOR_DEVICE_ATTR_2 requires two.”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mlhj h²hubhÌ)�”}”(hX¤Simplified variants of SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 are available and should be used if standard attribute permissions and function names are feasible. Standard permissions are 0644 for SENSOR_DEVICE_ATTR[_2]_RW, 0444 for SENSOR_DEVICE_ATTR[_2]_RO, and 0200 for SENSOR_DEVICE_ATTR[_2]_WO. Standard functions, similar to DEVICE_ATTR_{RW,RO,WO}, have _show and _store appended to the provided function name.”h]”hX¤Simplified variants of SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 are available and should be used if standard attribute permissions and function names are feasible. Standard permissions are 0644 for SENSOR_DEVICE_ATTR[_2]_RW, 0444 for SENSOR_DEVICE_ATTR[_2]_RO, and 0200 for SENSOR_DEVICE_ATTR[_2]_WO. Standard functions, similar to DEVICE_ATTR_{RW,RO,WO}, have _show and _store appended to the provided function name.”…”�”}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mphj h²hubhÌ)�”}”(hŒSENSOR_DEVICE_ATTR and its variants define a struct sensor_device_attribute variable. This structure has the following fields::”h]”hŒ~SENSOR_DEVICE_ATTR and its variants define a struct sensor_device_attribute variable. This structure has the following fields:”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mwhj h²hubj>)�”}”(hŒ`struct sensor_device_attribute { struct device_attribute dev_attr; int index; };”h]”hŒ`struct sensor_device_attribute { struct device_attribute dev_attr; int index; };”…”�”}”hjnsbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´Mzhj h²hubhÌ)�”}”(hŒ®You can use to_sensor_dev_attr to get the pointer to this structure from the attribute read or write function. Its parameter is the device to which the attribute is attached.”h]”hŒ®You can use to_sensor_dev_attr to get the pointer to this structure from the attribute read or write function. Its parameter is the device to which the attribute is attached.”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj h²hubhÌ)�”}”(hŒwSENSOR_DEVICE_ATTR_2 and its variants define a struct sensor_device_attribute_2 variable, which is defined as follows::”h]”hŒvSENSOR_DEVICE_ATTR_2 and its variants define a struct sensor_device_attribute_2 variable, which is defined as follows:”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mƒhj h²hubj>)�”}”(hŒpstruct sensor_device_attribute_2 { struct device_attribute dev_attr; u8 index; u8 nr; };”h]”hŒpstruct sensor_device_attribute_2 { struct device_attribute dev_attr; u8 index; u8 nr; };”…”�”}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=h³hÊh´M†hj h²hubhÌ)�”}”(hŒ~Use to_sensor_dev_attr_2 to get the pointer to this structure. Its parameter is the device to which the attribute is attached.”h]”hŒ~Use to_sensor_dev_attr_2 to get the pointer to this structure. Its parameter is the device to which the attribute is attached.”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MŒhj h²hubeh}”(h]”Œ driver-provided-sysfs-attributes”ah ]”h"]”Œ driver-provided sysfs attributes”ah$]”h&]”uh1hµhh·h²hh³hÊh´M]ubeh}”(h]”Œ(the-linux-hardware-monitoring-kernel-api”ah ]”h"]”Œ(the linux hardware monitoring kernel api”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”j2Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jæŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jÁj¾jjjæjãjÇ jÄ jjj¹j¶uŒ nametypes”}”(jÁ‰j‰jæ‰jÇ ‰j‰j¹‰uh}”(j¾h·jhÛjãjjÄ jéjjÊ j¶j uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”•6]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.