1 /* $NetBSD: emcfanctlutil.h,v 1.1 2025/03/11 13:56:48 brad Exp $ */ 2 3 /* 4 * Copyright (c) 2025 Brad Spencer <brad (at) anduin.eldar.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef _EMCFANCTLUTIL_H_ 20 #define _EMCFANCTLUTIL_H_ 21 22 EXTERN int emcfan_read_register(int, uint8_t, uint8_t *, bool); 23 EXTERN int emcfan_write_register(int, uint8_t, uint8_t, bool); 24 EXTERN int emcfan_rmw_register(int, uint8_t, uint8_t, const struct emcfan_bits_translate *, long unsigned int, int, bool); 25 EXTERN int emcfan_product_to_family(uint8_t); 26 EXTERN char *emcfan_product_to_name(uint8_t); 27 EXTERN void emcfan_family_to_name(int, char *, int); 28 EXTERN int emcfan_find_info(uint8_t); 29 EXTERN bool emcfan_reg_is_real(int, uint8_t); 30 EXTERN int emcfan_reg_by_name(uint8_t, int, char*); 31 EXTERN const char *emcfan_regname_by_reg(uint8_t, int, uint8_t); 32 EXTERN int find_translated_blob_by_bits_instance(const struct emcfan_bits_translate *, long unsigned int, uint8_t, int); 33 EXTERN int find_translated_bits_by_hint_instance(const struct emcfan_bits_translate *, long unsigned int, int, int); 34 EXTERN int find_translated_bits_by_hint(const struct emcfan_bits_translate *, long unsigned int, int); 35 EXTERN int find_translated_bits_by_str(const struct emcfan_bits_translate *,long unsigned int,char *); 36 EXTERN int find_translated_bits_by_str_instance(const struct emcfan_bits_translate *,long unsigned int,char *, int); 37 EXTERN int find_human_int(const struct emcfan_bits_translate *, long unsigned int, uint8_t); 38 EXTERN char *find_human_str(const struct emcfan_bits_translate *, long unsigned int, uint8_t); 39 40 #endif 41