aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mediatek/power/mt6735/max77819_pmic.h
blob: b73a9e4a6f8924a7e5fa1a2ed5dbe7dcccd02856 (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* linux/drivers/hwmon/lis33de.c
 *
 * (C) Copyright 2008 
 * MediaTek <www.mediatek.com>
 *
 * MAX77819_CH driver for MT6516
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef MAX77819_CH_H
#define MAX77819_CH_H 
	 
#include <linux/ioctl.h>
#include <mach/mt_typedefs.h>

#define MAX77819_CH_I2C_SLAVE_ADDR		0x90


#define WLED_MAX_BRIGHTNESS     0xFF

/* registers */
#define MAX77819_CH_WLED_INT		0x9B
#define MAX77819_CH_WLED_INT_MASK	0x9C
#define MAX77819_CH_WLEDBSTCNTL	0x98
#define MAX77819_CH_IWLED			0x99

/* MAX77819_CH_WLED_INT */
#define MAX77819_CH_WLEDOL			0x10
#define MAX77819_CH_WLEDOVP_I		0x80

/* MAX77819_CH_WLED_INT_MASK */
#define MAX77819_CH_WLEDOL_M		0x10
#define MAX77819_CH_WLEDOVP_M		0x80

/* MAX77819_CH_WLEDBSTCNTL */
#define MAX77819_CH_WLEDOVP		0x02
#define MAX77819_CH_WLEDFOSC		0x0C
#define MAX77819_CH_WLEDPWM2EN		0x10
#define MAX77819_CH_WLEDPWM1EN		0x20
#define MAX77819_CH_WLED2EN		0x40
#define MAX77819_CH_WLED1EN		0x80

/* MAX77819_CH_IWLED */
#define MAX77819_CH_CUR			0xFF

	 
	 
#define MAX77819_CH_SUCCESS						0
#define MAX77819_CH_ERR_I2C						-1
#define MAX77819_CH_ERR_STATUS					-3
#define MAX77819_CH_ERR_SETUP_FAILURE			-4
#define MAX77819_CH_ERR_GETGSENSORDATA			-5
#define MAX77819_CH_ERR_IDENTIFICATION			-6
	 
	 
	 
#define MAX77819_CH_BUFSIZE				256

extern int max77819_pmic_reg_write(kal_uint8 reg, kal_uint8 val);
extern int max77819_pmic_reg_read(kal_uint8 reg, kal_uint8 *val);
extern int max77819_pmic_reg_update_bits(kal_uint8 reg, kal_uint8 mask, kal_uint8 val);

extern void max77819_flash_deinit(void);
extern void max77819_flash_disable(void);
extern void max77819_flash_enable(void);
extern void max77819_flash_init(void);
extern void max77819_flash_preOn(void);
extern void max77819_flash_set_duty(unsigned char duty);

#endif