Skip to content

Commit a5247ca

Browse files
Elaine ZhangLee Jones
authored andcommitted
mfd: rk808: Add rk805 regs addr and ID
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 9d6105e commit a5247ca

1 file changed

Lines changed: 120 additions & 0 deletions

File tree

‎include/linux/mfd/rk808.h‎

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,97 @@ enum rk818_reg {
206206
#define RK818_USB_ILMIN_2000MA 0x7
207207
#define RK818_USB_CHG_SD_VSEL_MASK 0x70
208208

209+
/* RK805 */
210+
enum rk805_reg {
211+
RK805_ID_DCDC1,
212+
RK805_ID_DCDC2,
213+
RK805_ID_DCDC3,
214+
RK805_ID_DCDC4,
215+
RK805_ID_LDO1,
216+
RK805_ID_LDO2,
217+
RK805_ID_LDO3,
218+
};
219+
220+
/* CONFIG REGISTER */
221+
#define RK805_VB_MON_REG 0x21
222+
#define RK805_THERMAL_REG 0x22
223+
224+
/* POWER CHANNELS ENABLE REGISTER */
225+
#define RK805_DCDC_EN_REG 0x23
226+
#define RK805_SLP_DCDC_EN_REG 0x25
227+
#define RK805_SLP_LDO_EN_REG 0x26
228+
#define RK805_LDO_EN_REG 0x27
229+
230+
/* BUCK AND LDO CONFIG REGISTER */
231+
#define RK805_BUCK_LDO_SLP_LP_EN_REG 0x2A
232+
#define RK805_BUCK1_CONFIG_REG 0x2E
233+
#define RK805_BUCK1_ON_VSEL_REG 0x2F
234+
#define RK805_BUCK1_SLP_VSEL_REG 0x30
235+
#define RK805_BUCK2_CONFIG_REG 0x32
236+
#define RK805_BUCK2_ON_VSEL_REG 0x33
237+
#define RK805_BUCK2_SLP_VSEL_REG 0x34
238+
#define RK805_BUCK3_CONFIG_REG 0x36
239+
#define RK805_BUCK4_CONFIG_REG 0x37
240+
#define RK805_BUCK4_ON_VSEL_REG 0x38
241+
#define RK805_BUCK4_SLP_VSEL_REG 0x39
242+
#define RK805_LDO1_ON_VSEL_REG 0x3B
243+
#define RK805_LDO1_SLP_VSEL_REG 0x3C
244+
#define RK805_LDO2_ON_VSEL_REG 0x3D
245+
#define RK805_LDO2_SLP_VSEL_REG 0x3E
246+
#define RK805_LDO3_ON_VSEL_REG 0x3F
247+
#define RK805_LDO3_SLP_VSEL_REG 0x40
248+
249+
/* INTERRUPT REGISTER */
250+
#define RK805_PWRON_LP_INT_TIME_REG 0x47
251+
#define RK805_PWRON_DB_REG 0x48
252+
#define RK805_DEV_CTRL_REG 0x4B
253+
#define RK805_INT_STS_REG 0x4C
254+
#define RK805_INT_STS_MSK_REG 0x4D
255+
#define RK805_GPIO_IO_POL_REG 0x50
256+
#define RK805_OUT_REG 0x52
257+
#define RK805_ON_SOURCE_REG 0xAE
258+
#define RK805_OFF_SOURCE_REG 0xAF
259+
260+
#define RK805_NUM_REGULATORS 7
261+
262+
#define RK805_PWRON_FALL_RISE_INT_EN 0x0
263+
#define RK805_PWRON_FALL_RISE_INT_MSK 0x81
264+
265+
/* RK805 IRQ Definitions */
266+
#define RK805_IRQ_PWRON_RISE 0
267+
#define RK805_IRQ_VB_LOW 1
268+
#define RK805_IRQ_PWRON 2
269+
#define RK805_IRQ_PWRON_LP 3
270+
#define RK805_IRQ_HOTDIE 4
271+
#define RK805_IRQ_RTC_ALARM 5
272+
#define RK805_IRQ_RTC_PERIOD 6
273+
#define RK805_IRQ_PWRON_FALL 7
274+
275+
#define RK805_IRQ_PWRON_RISE_MSK BIT(0)
276+
#define RK805_IRQ_VB_LOW_MSK BIT(1)
277+
#define RK805_IRQ_PWRON_MSK BIT(2)
278+
#define RK805_IRQ_PWRON_LP_MSK BIT(3)
279+
#define RK805_IRQ_HOTDIE_MSK BIT(4)
280+
#define RK805_IRQ_RTC_ALARM_MSK BIT(5)
281+
#define RK805_IRQ_RTC_PERIOD_MSK BIT(6)
282+
#define RK805_IRQ_PWRON_FALL_MSK BIT(7)
283+
284+
#define RK805_PWR_RISE_INT_STATUS BIT(0)
285+
#define RK805_VB_LOW_INT_STATUS BIT(1)
286+
#define RK805_PWRON_INT_STATUS BIT(2)
287+
#define RK805_PWRON_LP_INT_STATUS BIT(3)
288+
#define RK805_HOTDIE_INT_STATUS BIT(4)
289+
#define RK805_ALARM_INT_STATUS BIT(5)
290+
#define RK805_PERIOD_INT_STATUS BIT(6)
291+
#define RK805_PWR_FALL_INT_STATUS BIT(7)
292+
293+
#define RK805_BUCK1_2_ILMAX_MASK (3 << 6)
294+
#define RK805_BUCK3_4_ILMAX_MASK (3 << 3)
295+
#define RK805_RTC_PERIOD_INT_MASK (1 << 6)
296+
#define RK805_RTC_ALARM_INT_MASK (1 << 5)
297+
#define RK805_INT_ALARM_EN (1 << 3)
298+
#define RK805_INT_TIMER_EN (1 << 2)
299+
209300
/* RK808 IRQ Definitions */
210301
#define RK808_IRQ_VOUT_LO 0
211302
#define RK808_IRQ_VB_LO 1
@@ -298,7 +389,14 @@ enum rk818_reg {
298389
#define VOUT_LO_INT BIT(0)
299390
#define CLK32KOUT2_EN BIT(0)
300391

392+
#define TEMP115C 0x0c
393+
#define TEMP_HOTDIE_MSK 0x0c
394+
#define SLP_SD_MSK (0x3 << 2)
395+
#define SHUTDOWN_FUN (0x2 << 2)
396+
#define SLEEP_FUN (0x1 << 2)
301397
#define RK8XX_ID_MSK 0xfff0
398+
#define FPWM_MODE BIT(7)
399+
302400
enum {
303401
BUCK_ILMIN_50MA,
304402
BUCK_ILMIN_100MA,
@@ -322,6 +420,28 @@ enum {
322420
};
323421

324422
enum {
423+
RK805_BUCK1_2_ILMAX_2500MA,
424+
RK805_BUCK1_2_ILMAX_3000MA,
425+
RK805_BUCK1_2_ILMAX_3500MA,
426+
RK805_BUCK1_2_ILMAX_4000MA,
427+
};
428+
429+
enum {
430+
RK805_BUCK3_ILMAX_1500MA,
431+
RK805_BUCK3_ILMAX_2000MA,
432+
RK805_BUCK3_ILMAX_2500MA,
433+
RK805_BUCK3_ILMAX_3000MA,
434+
};
435+
436+
enum {
437+
RK805_BUCK4_ILMAX_2000MA,
438+
RK805_BUCK4_ILMAX_2500MA,
439+
RK805_BUCK4_ILMAX_3000MA,
440+
RK805_BUCK4_ILMAX_3500MA,
441+
};
442+
443+
enum {
444+
RK805_ID = 0x8050,
325445
RK808_ID = 0x0000,
326446
RK818_ID = 0x8181,
327447
};

0 commit comments

Comments
 (0)