Source
x
static int fts_wd_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
/*
* Support for the FTS Systemmonitoring Chip "Teutates"
*
* Copyright (C) 2016 Fujitsu Technology Solutions GmbH,
* Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
*
* This program 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 of the License, or
* (at your option) any later version.
*
* This program 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.
*
*/
static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
static const struct i2c_device_id fts_id[] = {
{ "ftsteutates", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, fts_id);
enum WATCHDOG_RESOLUTION {
seconds = 1,
minutes = 60
};
struct fts_data {
struct i2c_client *client;
/* update sensor data lock */
struct mutex update_lock;
/* read/write register lock */
struct mutex access_lock;
unsigned long last_updated; /* in jiffies */
struct watchdog_device wdd;
enum WATCHDOG_RESOLUTION resolution;
bool valid; /* false until following fields are valid */
u8 volt[FTS_NO_VOLT_SENSORS];
u8 temp_input[FTS_NO_TEMP_SENSORS];
u8 temp_alarm;
u8 fan_present;
u8 fan_input[FTS_NO_FAN_SENSORS]; /* in rps */
u8 fan_source[FTS_NO_FAN_SENSORS];