max8688.c (9a64e8e0ace51b309fdcff4b4754b3649250382a) max8688.c (2c052d4280ca48fddc7a9ffd2329ada3628cab86)
1/*
2 * Hardware monitoring driver for Maxim MAX8688
3 *
4 * Copyright (c) 2011 Ericsson AB.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 4 unchanged lines hidden (view full) ---

13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
1/*
2 * Hardware monitoring driver for Maxim MAX8688
3 *
4 * Copyright (c) 2011 Ericsson AB.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 4 unchanged lines hidden (view full) ---

13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#include <linux/bitops.h>
21#include <linux/kernel.h>
22#include <linux/module.h>
23#include <linux/init.h>
24#include <linux/err.h>
25#include <linux/i2c.h>
26#include "pmbus.h"
27
28#define MAX8688_MFR_VOUT_PEAK 0xd4
29#define MAX8688_MFR_IOUT_PEAK 0xd5
30#define MAX8688_MFR_TEMPERATURE_PEAK 0xd6
31#define MAX8688_MFG_STATUS 0xd8
32
22#include <linux/kernel.h>
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/err.h>
26#include <linux/i2c.h>
27#include "pmbus.h"
28
29#define MAX8688_MFR_VOUT_PEAK 0xd4
30#define MAX8688_MFR_IOUT_PEAK 0xd5
31#define MAX8688_MFR_TEMPERATURE_PEAK 0xd6
32#define MAX8688_MFG_STATUS 0xd8
33
33#define MAX8688_STATUS_OC_FAULT (1 << 4)
34#define MAX8688_STATUS_OV_FAULT (1 << 5)
35#define MAX8688_STATUS_OV_WARNING (1 << 8)
36#define MAX8688_STATUS_UV_FAULT (1 << 9)
37#define MAX8688_STATUS_UV_WARNING (1 << 10)
38#define MAX8688_STATUS_UC_FAULT (1 << 11)
39#define MAX8688_STATUS_OC_WARNING (1 << 12)
40#define MAX8688_STATUS_OT_FAULT (1 << 13)
41#define MAX8688_STATUS_OT_WARNING (1 << 14)
34#define MAX8688_STATUS_OC_FAULT BIT(4)
35#define MAX8688_STATUS_OV_FAULT BIT(5)
36#define MAX8688_STATUS_OV_WARNING BIT(8)
37#define MAX8688_STATUS_UV_FAULT BIT(9)
38#define MAX8688_STATUS_UV_WARNING BIT(10)
39#define MAX8688_STATUS_UC_FAULT BIT(11)
40#define MAX8688_STATUS_OC_WARNING BIT(12)
41#define MAX8688_STATUS_OT_FAULT BIT(13)
42#define MAX8688_STATUS_OT_WARNING BIT(14)
42
43static int max8688_read_word_data(struct i2c_client *client, int page, int reg)
44{
45 int ret;
46
47 if (page)
48 return -ENXIO;
49

--- 155 unchanged lines hidden ---
43
44static int max8688_read_word_data(struct i2c_client *client, int page, int reg)
45{
46 int ret;
47
48 if (page)
49 return -ENXIO;
50

--- 155 unchanged lines hidden ---