/* $Id: plugin_i2c_sensors.c,v 1.14 2004/05/09 05:41:42 reinelt Exp $ * * I2C sensors plugin * * Copyright 2003,2004 Xavier Vello * Copyright 2004 The LCD4Linux Team * * This file is part of LCD4Linux. * * LCD4Linux is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * LCD4Linux is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * $Log: plugin_i2c_sensors.c,v $ * Revision 1.14 2004/05/09 05:41:42 reinelt * * i2c fix for kernel 2.6.5 (temp_input1 vs. temp1_input) from Xavier * * Revision 1.13 2004/03/03 03:47:04 reinelt * big patch from Martin Hejl: * - use qprintf() where appropriate * - save CPU cycles on gettimeofday() * - add quit() functions to free allocated memory * - fixed lots of memory leaks * * Revision 1.12 2004/02/16 08:19:44 reinelt * i2c_sensors patch from Xavier * * Revision 1.11 2004/02/15 21:43:43 reinelt * T6963 driver nearly finished * framework for graphic displays done * i2c_sensors patch from Xavier * some more old generation files removed * * Revision 1.10 2004/02/14 12:07:27 nicowallmeier * minor bugfix * * Revision 1.9 2004/02/14 11:56:17 reinelt * M50530 driver ported * changed lots of 'char' to 'unsigned char' * * Revision 1.8 2004/02/14 10:09:50 reinelt * I2C Sensors for 2.4 kernels (/proc instead of /sysfs) * * Revision 1.7 2004/01/30 20:57:56 reinelt * HD44780 patch from Martin Hejl * dmalloc integrated * * Revision 1.6 2004/01/30 07:12:35 reinelt * HD44780 busy-flag support from Martin Hejl * loadavg() uClibc replacement from Martin Heyl * round() uClibc replacement from Martin Hejl * warning in i2c_sensors fixed * * Revision 1.5 2004/01/29 05:55:30 reinelt * check for /sys mounted * * Revision 1.4 2004/01/29 04:40:02 reinelt * every .c file includes "config.h" now * * Revision 1.3 2004/01/27 08:13:39 reinelt * ported PPP token to plugin_ppp * * Revision 1.2 2004/01/27 05:06:10 reinelt * i2c update from Xavier * * Revision 1.1 2004/01/10 17:36:56 reinelt * * I2C Sensors plugin from Xavier added * */ /* * exported functions: * * int plugin_init_i2c_sensors (void) * adds function i2c_sensors() to retrieve informations from * the i2c sensors via sysfs or procfs interface * * -- WARNING -- * This plugin should detect where your sensors are at startup. * If you can't get any token to work, ensure you don't get * an error message with "lcd4linux -Fvvv". * * If so, try to force the path to your sensors in the conf like this : * for sysfs: i2c_sensors-path '/sys/bus/i2c/devices/0-6000/' * for procfs: i2c_sensors-path '/proc/sys/dev/sensors/via686a-isa-6000' * /!\ these path are for my system, change the last dir according to yours */ /* * Available tokens : # represents an int from 1 to 3 (or more) * temp_input# -> temperature of sensor # (in °C) * temp_max# and temp_hyst# -> max and min of sensor # * in_input#, in_min# and in_max# -> voltages * fan_input# -> speed (in RPM) of fan # * fan_min# and fan_div# * * Tokens avaible only via sysfs if suported by your sensors: * curr_input#, curr_min# and curr_max# -> value of current (in amps) * pwm# * temp_crit# -> critical value of sensor # * vid -> cpu core voltage * and maybe others * (see /usr/src/linux/Documentation/i2c/sysfs-interface on linux 2.6) */ #include "config.h" #include #include #include #include #include #include #include "debug.h" #include "plugin.h" #include "cfg.h" #include "hash.h" #ifdef WITH_DMALLOC #include #endif static char *path=NULL; static HASH I2Csensors = { 0, }; static const char *procfs_tokens[4][3] = { {"temp_hyst", "temp_max", "temp_input"}, // for temp# {"in_min", "in_max", "in_input"}, // for in# {"fan_div1", "fan_div2", "fan_div3"}, // for fan_div {"fan_min", "fan_input", ""} // for fan# }; static int (*parse_i2c_sensors)(char *key); /***********************************************\ * Parsing for new 2.6 kernels 'sysfs' interface * \**********************************
# 2014-03-08 Olli Salonen <olli.salonen@iki.fi>
# generated from http://www.dna.fi/tuki-antenniverkon-nakyvyysalueet
[CHANNEL]
	DELIVERY_SYSTEM = DVBT2
	FREQUENCY = 184500000
	BANDWIDTH_HZ = 7000000
	CODE_RATE_HP = AUTO
	CODE_RATE_LP = AUTO
	MODULATION = QAM/AUTO
	TRANSMISSION_MODE = 32K
	GUARD_INTERVAL = 19/256
	HIERARCHY = AUTO
	INVERSION = AUTO

[CHANNEL]
	DELIVERY_SYSTEM = DVBT2
	FREQUENCY = 191500000
	BANDWIDTH_HZ = 7000000
	CODE_RATE_HP = AUTO
	CODE_RATE_LP = AUTO
	MODULATION = QAM/AUTO
	TRANSMISSION_MODE = 32K
	GUARD_INTERVAL = 19/256
	HIERARCHY = AUTO
	INVERSION = AUTO

[CHANNEL]
	DELIVERY_SYSTEM = DVBT2
	FREQUENCY = 198500000
	BANDWIDTH_HZ = 7000000
	CODE_RATE_HP = AUTO
	CODE_RATE_LP = AUTO
	MODULATION = QAM/AUTO
	TRANSMISSION_MODE = 32K
	GUARD_INTERVAL = 19/256
	HIERARCHY = AUTO
	INVERSION = AUTO