Commit 8f2e6c22c751d28ac8027a7128f90b54240dcfa1
- Diff rendering mode:
- inline
- side by side
drivers/rtc/rtc-twl.c
(25 / 0)
|   | |||
| 30 | 30 | ||
| 31 | 31 | #include <linux/i2c/twl.h> | |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER) | ||
| 35 | */ | ||
| 36 | #define REG_BB_CFG 0x12 | ||
| 33 | 37 | ||
| 38 | /* PM_RECEIVER BB_CFG bitfields */ | ||
| 39 | #define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10 | ||
| 40 | #define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C | ||
| 41 | #define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00 | ||
| 42 | #define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04 | ||
| 43 | #define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08 | ||
| 44 | #define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c | ||
| 45 | #define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03 | ||
| 46 | #define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00 | ||
| 47 | #define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01 | ||
| 48 | #define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02 | ||
| 49 | #define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03 | ||
| 50 | |||
| 34 | 51 | /* | |
| 35 | 52 | * RTC block register offsets (use TWL_MODULE_RTC) | |
| 36 | 53 | */ | |
| … | … | ||
| 524 | 524 | ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG); | |
| 525 | 525 | if (ret < 0) | |
| 526 | 526 | goto out2; | |
| 527 | |||
| 528 | /* enable backup battery charging */ | ||
| 529 | /* use a conservative 25uA @ 3.1V */ | ||
| 530 | ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, | ||
| 531 | BIT_PM_RECEIVER_BB_CFG_BBCHEN | | ||
| 532 | BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 | | ||
| 533 | BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA, | ||
| 534 | REG_BB_CFG); | ||
| 527 | 535 | ||
| 528 | 536 | return ret; | |
| 529 | 537 |
Comments
Add your comment
Please log in to comment



Add a new comment:
Login or create an account to post a comment