mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
rk808: rtc: set rtc stopped by default
set rtc stopped by default, start rtc in rtc device probe. add rtc node, whether RTC need to initialize. Change-Id: Ifab269786f316d33149a50a18e23af1b6206d57d Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This commit is contained in:
parent
04f65765c3
commit
6f2092beeb
|
|
@ -154,6 +154,7 @@ static const struct rk808_reg_data rk805_pre_init_reg[] = {
|
|||
{RK805_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_400MA},
|
||||
{RK805_GPIO_IO_POL_REG, SLP_SD_MSK, SLEEP_FUN},
|
||||
{RK805_THERMAL_REG, TEMP_HOTDIE_MSK, TEMP115C},
|
||||
{RK808_RTC_CTRL_REG, RTC_STOP, RTC_STOP},
|
||||
};
|
||||
|
||||
static const struct rk808_reg_data rk808_pre_init_reg[] = {
|
||||
|
|
@ -163,6 +164,7 @@ static const struct rk808_reg_data rk808_pre_init_reg[] = {
|
|||
{ RK808_BUCK1_CONFIG_REG, BUCK1_RATE_MASK, BUCK_ILMIN_200MA },
|
||||
{ RK808_BUCK2_CONFIG_REG, BUCK2_RATE_MASK, BUCK_ILMIN_200MA },
|
||||
{ RK808_DCDC_UV_ACT_REG, BUCK_UV_ACT_MASK, BUCK_UV_ACT_DISABLE},
|
||||
{ RK808_RTC_CTRL_REG, RTC_STOP, RTC_STOP},
|
||||
{ RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT |
|
||||
VB_LO_SEL_3500MV },
|
||||
};
|
||||
|
|
@ -181,6 +183,7 @@ static const struct rk808_reg_data rk818_pre_init_reg[] = {
|
|||
{ RK818_H5V_EN_REG, BIT(1), RK818_REF_RDY_CTRL },
|
||||
/* enable HDMI 5V */
|
||||
{ RK818_H5V_EN_REG, BIT(0), RK818_H5V_EN },
|
||||
{ RK808_RTC_CTRL_REG, RTC_STOP, RTC_STOP},
|
||||
{ RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT |
|
||||
VB_LO_SEL_3500MV },
|
||||
};
|
||||
|
|
|
|||
|
|
@ -375,8 +375,35 @@ static int rk808_rtc_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
|
||||
struct rk808_rtc *rk808_rtc;
|
||||
struct device_node *np;
|
||||
int ret;
|
||||
|
||||
switch (rk808->variant) {
|
||||
case RK805_ID:
|
||||
np = of_get_child_by_name(pdev->dev.parent->of_node, "rtc");
|
||||
if (np && !of_device_is_available(np)) {
|
||||
dev_info(&pdev->dev, "device is disabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case RK808_ID:
|
||||
np = of_get_child_by_name(pdev->dev.parent->of_node, "rtc");
|
||||
if (np && !of_device_is_available(np)) {
|
||||
dev_info(&pdev->dev, "device is disabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case RK818_ID:
|
||||
np = of_get_child_by_name(pdev->dev.parent->of_node, "rtc");
|
||||
if (np && !of_device_is_available(np)) {
|
||||
dev_info(&pdev->dev, "device is disabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
rk808_rtc = devm_kzalloc(&pdev->dev, sizeof(*rk808_rtc), GFP_KERNEL);
|
||||
if (rk808_rtc == NULL)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ enum rk805_reg {
|
|||
#define SWITCH1_EN BIT(5)
|
||||
#define DEV_OFF_RST BIT(3)
|
||||
#define DEV_OFF BIT(0)
|
||||
#define RTC_STOP BIT(0)
|
||||
|
||||
#define VB_LO_ACT BIT(4)
|
||||
#define VB_LO_SEL_3500MV (7 << 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user