Source
* Finally, construct an array of pointers to members of the above objects,
/*
* Driver for Linear Technology LTC4151 High Voltage I2C Current
* and Voltage Monitor
*
* Copyright (C) 2011 AppearTV AS
*
* Derived from:
*
* Driver for Linear Technology LTC4261 I2C Negative Voltage Hot
* Swap Controller
* Copyright (C) 2010 Ericsson AB.
*
* Datasheet: http://www.linear.com/docs/Datasheet/4151fc.pdf
*
* 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.
*
* 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.
*
*/
/* chip registers */
struct ltc4151_data {
struct i2c_client *client;
struct mutex update_lock;
bool valid;
unsigned long last_updated; /* in jiffies */
unsigned int shunt; /* in micro ohms */
/* Registers */
u8 regs[6];
};
static struct ltc4151_data *ltc4151_update_device(struct device *dev)
{