blob: aecf19780cc3d8bda0acf5f6a2676fc9b3f4ca22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*
* ts81001.h - Triune ts81001 driver
*
* Copyright 2015 Olio Devices
*
* Author: Mattis Fjallstrom
*
* 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.
*
*/
/* DESCRIPTION
* ===========
* This is the header for the Triune TS81001 driver.
*/
/*
* Modification History
* ====================
* 01a, 20150921, mfj Created
*/
/* DEFINES */
#ifndef _CONFIG_TS81001_H
#define _CONFIG_TS81001_H
#define TS81001_DEV_NAME "ts81001"
/* INCLUDES */
#include <linux/regmap.h>
typedef enum ts81001_state {
NOT_CHARGING,
PRECHARGE,
CHARGING_1C,
TOPOFF
} ts81001_state_t;
struct ts81001 {
struct device *dev;
struct i2c_client *client;
struct regmap *regmap;
unsigned int id;
char * name;
struct ts81001_ops * ops;
};
struct ts81001_ops {
int (*get_status) (struct ts81001 * ts);
int (*request_charge) (struct ts81001 * ts, u16 charge);
int (*charge_stop) (struct ts81001 * ts);
int (*charge_start) (struct ts81001 * ts);
};
#endif /* _CONFIG_TS81001_H */
|