From abec95fe27d9a8ad7e1f3f485542fb64f58a68ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=83=AD=E6=AF=85?= Date: Tue, 20 May 2014 11:01:05 +0800 Subject: [PATCH] rtc: fix some bug of rtc-HYM8563 and change default rtc to HYM8563 --- arch/arm/boot/dts/rk3288-p977.dts | 8 ++++---- arch/arm/boot/dts/rk3288-p977_8846.dts | 2 +- arch/arm/boot/dts/rk3288-tb.dts | 6 +++--- arch/arm/configs/rockchip_defconfig | 3 +-- drivers/rtc/rtc-HYM8563.c | 8 +++++--- 5 files changed, 14 insertions(+), 13 deletions(-) mode change 100755 => 100644 arch/arm/configs/rockchip_defconfig diff --git a/arch/arm/boot/dts/rk3288-p977.dts b/arch/arm/boot/dts/rk3288-p977.dts index 2136f27741c9..fae1bde1bc7f 100755 --- a/arch/arm/boot/dts/rk3288-p977.dts +++ b/arch/arm/boot/dts/rk3288-p977.dts @@ -322,11 +322,11 @@ is_dc_charge = <1>; is_usb_charge = <0>; }; - - rtc@d { + + rtc@51 { compatible = "rtc,hym8563"; - reg = <0xd>; - irq_gpio = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>; + reg = <0x51>; + irq_gpio = <&gpio0 GPIO_A4 IRQ_TYPE_EDGE_FALLING>; }; }; diff --git a/arch/arm/boot/dts/rk3288-p977_8846.dts b/arch/arm/boot/dts/rk3288-p977_8846.dts index 92554209b5e6..165ddd560d55 100755 --- a/arch/arm/boot/dts/rk3288-p977_8846.dts +++ b/arch/arm/boot/dts/rk3288-p977_8846.dts @@ -381,7 +381,7 @@ rtc@51 { compatible = "rtc,hym8563"; reg = <0x51>; - irq_gpio = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>; + irq_gpio = <&gpio0 GPIO_A4 IRQ_TYPE_EDGE_FALLING>; }; }; diff --git a/arch/arm/boot/dts/rk3288-tb.dts b/arch/arm/boot/dts/rk3288-tb.dts index f1eeadb9006d..37d5dfd93cca 100755 --- a/arch/arm/boot/dts/rk3288-tb.dts +++ b/arch/arm/boot/dts/rk3288-tb.dts @@ -426,10 +426,10 @@ is_usb_charge = <0>; }; - rtc@d { + rtc@51 { compatible = "rtc,hym8563"; - reg = <0xd>; - irq_gpio = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>; + reg = <0x51>; + irq_gpio = <&gpio0 GPIO_A4 IRQ_TYPE_EDGE_FALLING>; }; }; diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig old mode 100755 new mode 100644 index a211f5651946..91288ad17107 --- a/arch/arm/configs/rockchip_defconfig +++ b/arch/arm/configs/rockchip_defconfig @@ -475,7 +475,6 @@ CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DEBUG_FILES=y CONFIG_USB_GADGET_VBUS_DRAW=500 CONFIG_USB_G_ANDROID=y -CONFIG_DWC_OTG_310=y CONFIG_USB20_HOST=y CONFIG_USB20_OTG=y CONFIG_MMC=y @@ -491,7 +490,7 @@ CONFIG_LEDS_TRIGGER_BACKLIGHT=y CONFIG_LEDS_TRIGGER_DEFAULT_ON=y CONFIG_SWITCH=y CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_HYM8563=y CONFIG_RK808_RTC=y CONFIG_RTC_DRV_RC5T619=y CONFIG_STAGING=y diff --git a/drivers/rtc/rtc-HYM8563.c b/drivers/rtc/rtc-HYM8563.c index ce088d3e497d..2c8ad214e64b 100755 --- a/drivers/rtc/rtc-HYM8563.c +++ b/drivers/rtc/rtc-HYM8563.c @@ -24,6 +24,7 @@ #include #include "rtc-HYM8563.h" #include +#include #define RTC_SPEED 200 * 1000 struct hym8563 { @@ -600,9 +601,10 @@ static int hym8563_probe(struct i2c_client *client, const struct i2c_device_id goto exit; } enable_irq_wake(hym8563->irq); - - rtc = rtc_device_register(client->name, &client->dev, - &hym8563_rtc_ops, THIS_MODULE); + device_init_wakeup(&client->dev, 1); + rtc = devm_rtc_device_register(&client->dev, + client->name, + &hym8563_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) { rc = PTR_ERR(rtc); rtc = NULL; -- 2.34.1