projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[platform/kernel/u-boot.git]
/
drivers
/
rtc
/
mc13xxx-rtc.c
diff --git
a/drivers/rtc/mc13xxx-rtc.c
b/drivers/rtc/mc13xxx-rtc.c
index
70ea8a1
..
e79f462
100644
(file)
--- a/
drivers/rtc/mc13xxx-rtc.c
+++ b/
drivers/rtc/mc13xxx-rtc.c
@@
-23,16
+23,18
@@
#include <common.h>
#include <rtc.h>
#include <spi.h>
#include <common.h>
#include <rtc.h>
#include <spi.h>
-#include <pmic.h>
+#include <p
ower/p
mic.h>
#include <fsl_pmic.h>
int rtc_get(struct rtc_time *rtc)
{
u32 day1, day2, time;
int tim, i = 0;
#include <fsl_pmic.h>
int rtc_get(struct rtc_time *rtc)
{
u32 day1, day2, time;
int tim, i = 0;
- struct pmic *p =
get_pmic(
);
+ struct pmic *p =
pmic_get("FSL_PMIC"
);
int ret;
int ret;
+ if (!p)
+ return -1;
do {
ret = pmic_reg_read(p, REG_RTC_DAY, &day1);
if (ret < 0)
do {
ret = pmic_reg_read(p, REG_RTC_DAY, &day1);
if (ret < 0)
@@
-61,7
+63,9
@@
int rtc_get(struct rtc_time *rtc)
int rtc_set(struct rtc_time *rtc)
{
u32 time, day;
int rtc_set(struct rtc_time *rtc)
{
u32 time, day;
- struct pmic *p = get_pmic();
+ struct pmic *p = pmic_get("FSL_PMIC");
+ if (!p)
+ return -1;
time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
rtc->tm_hour, rtc->tm_min, rtc->tm_sec);
time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
rtc->tm_hour, rtc->tm_min, rtc->tm_sec);