blob: f38262d21ff10de7f1e84b99fa96376085e33a64 [file] [log] [blame]
Milo Kimeea6b7c2012-09-19 18:53:33 +02001/*
2 * TI LP8788 MFD - common definitions for current sinks
3 *
4 * Copyright 2012 Texas Instruments
5 *
6 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifndef __ISINK_LP8788_H__
15#define __ISINK_LP8788_H__
16
17/* register address */
18#define LP8788_ISINK_CTRL 0x99
19#define LP8788_ISINK12_IOUT 0x9A
20#define LP8788_ISINK3_IOUT 0x9B
21#define LP8788_ISINK1_PWM 0x9C
22#define LP8788_ISINK2_PWM 0x9D
23#define LP8788_ISINK3_PWM 0x9E
24
25/* mask bits */
26#define LP8788_ISINK1_IOUT_M 0x0F /* Addr 9Ah */
27#define LP8788_ISINK2_IOUT_M 0xF0
28#define LP8788_ISINK3_IOUT_M 0x0F /* Addr 9Bh */
29
30/* 6 bits used for PWM code : Addr 9C ~ 9Eh */
31#define LP8788_ISINK_MAX_PWM 63
32#define LP8788_ISINK_SCALE_OFFSET 3
33
34static const u8 lp8788_iout_addr[] = {
35 LP8788_ISINK12_IOUT,
36 LP8788_ISINK12_IOUT,
37 LP8788_ISINK3_IOUT,
38};
39
40static const u8 lp8788_iout_mask[] = {
41 LP8788_ISINK1_IOUT_M,
42 LP8788_ISINK2_IOUT_M,
43 LP8788_ISINK3_IOUT_M,
44};
45
46static const u8 lp8788_pwm_addr[] = {
47 LP8788_ISINK1_PWM,
48 LP8788_ISINK2_PWM,
49 LP8788_ISINK3_PWM,
50};
51
52#endif