* [rtc-linux] [PATCH v2 0/9] Build and support rk3036 SoC platform @ 2015-09-17 8:28 Xing Zheng 2015-09-17 9:59 ` [rtc-linux] " Heiko Stübner 2015-09-17 10:39 ` [rtc-linux] [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work Xing Zheng 0 siblings, 2 replies; 6+ messages in thread From: Xing Zheng @ 2015-09-17 8:28 UTC (permalink / raw) To: heiko Cc: linux-rockchip, Xing Zheng, Russell King, Michael Turquette, Alessandro Zummo, devicetree, Stephen Boyd, linux-gpio, Linus Walleij, Alexandre Belloni, Kumar Gala, linux-kernel, Ian Campbell, Rob Herring, Pawel Moll, rtc-linux, Mark Rutland, linux-clk, linux-arm-kernel Hi, we need to support rk3036 soc platform via upstream, there are 3 primary parts for the initial release of minimum system: dts, pinctrl, and clock tree for rk3036, and additional, add a rtc hym8563 patch to fix initial invaild, we can use these startup and run to init processs. Thanks. changed in v2: - based on v1, add clock controller documentation - enable timer5 startup - add smp for cpu1 - initial set time for rtc-hym8563 changes since v1: - add dts, pinctrl and clock tree for rk3036 soc platform The patchset (9): 9) rtc: hym8563: make sure hym8563 can be normal work 8) ARM: rockchip: add support smp for rk3036 7) rockchip: make sure timer5 is enabled on rk3036 platforms 6) pinctrl: rockchip: add support for the rk3036 5) dt-bindings: add documentation of rk3036 clock controller 4) clk: rockchip: add new clock type and controller for rk3036 3) clk: rockchip: add clock controller for rk3036 2) clk: rockchip: add dt-binding header for rk3036 1) ARM: dts: rockchip: add core rk3036 dts Changes in v2: Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Xing Zheng (9): ARM: dts: rockchip: add core rk3036 dts clk: rockchip: add dt-binding header for rk3036 clk: rockchip: add clock controller for rk3036 clk: rockchip: add new clock type and controller for rk3036 dt-bindings: add documentation of rk3036 clock controller pinctrl: rockchip: add support for the rk3036 rockchip: make sure timer5 is enabled on rk3036 platforms ARM: rockchip: add support smp for rk3036 rtc: hym8563: make sure hym8563 can be normal work .../bindings/clock/rockchip,rk3036-cru.txt | 60 +++ .../bindings/pinctrl/rockchip,pinctrl.txt | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/rk3036-sdk.dts | 62 +++ arch/arm/boot/dts/rk3036.dtsi | 381 +++++++++++++++ arch/arm/mach-rockchip/platsmp.c | 121 +++++ arch/arm/mach-rockchip/rockchip.c | 22 + drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk-pll.c | 262 +++++++++- drivers/clk/rockchip/clk-rk3036.c | 504 ++++++++++++++++++++ drivers/clk/rockchip/clk.h | 30 ++ drivers/pinctrl/pinctrl-rockchip.c | 17 + drivers/rtc/rtc-hym8563.c | 93 ++++ include/dt-bindings/clock/rk3036-cru.h | 198 ++++++++ 14 files changed, 1752 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3036-cru.txt create mode 100644 arch/arm/boot/dts/rk3036-sdk.dts create mode 100644 arch/arm/boot/dts/rk3036.dtsi create mode 100644 drivers/clk/rockchip/clk-rk3036.c create mode 100644 include/dt-bindings/clock/rk3036-cru.h -- 1.7.9.5 -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH v2 0/9] Build and support rk3036 SoC platform 2015-09-17 8:28 [rtc-linux] [PATCH v2 0/9] Build and support rk3036 SoC platform Xing Zheng @ 2015-09-17 9:59 ` Heiko Stübner 2015-09-17 10:39 ` [rtc-linux] [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work Xing Zheng 1 sibling, 0 replies; 6+ messages in thread From: Heiko Stübner @ 2015-09-17 9:59 UTC (permalink / raw) To: Xing Zheng Cc: linux-rockchip, Russell King, Michael Turquette, Alessandro Zummo, devicetree, Stephen Boyd, linux-gpio, Linus Walleij, Alexandre Belloni, Kumar Gala, linux-kernel, Ian Campbell, Rob Herring, Pawel Moll, rtc-linux, Mark Rutland, linux-clk, linux-arm-kernel Hi, Am Donnerstag, 17. September 2015, 16:28:51 schrieb Xing Zheng: > we need to support rk3036 soc platform via upstream, there are > 3 primary parts for the initial release of minimum system: dts, > pinctrl, and clock tree for rk3036, and additional, add a rtc > hym8563 patch to fix initial invaild, we can use these startup > and run to init processs. > > Thanks. > > changed in v2: > - based on v1, add clock controller documentation > - enable timer5 startup > - add smp for cpu1 > - initial set time for rtc-hym8563 > > changes since v1: > - add dts, pinctrl and clock tree for rk3036 soc platform > > The patchset (9): > 9) rtc: hym8563: make sure hym8563 can be normal work > 8) ARM: rockchip: add support smp for rk3036 > 7) rockchip: make sure timer5 is enabled on rk3036 platforms > 6) pinctrl: rockchip: add support for the rk3036 > 5) dt-bindings: add documentation of rk3036 clock controller > 4) clk: rockchip: add new clock type and controller for rk3036 > 3) clk: rockchip: add clock controller for rk3036 > 2) clk: rockchip: add dt-binding header for rk3036 > 1) ARM: dts: rockchip: add core rk3036 dts > > > Changes in v2: > Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> > > Xing Zheng (9): > ARM: dts: rockchip: add core rk3036 dts > clk: rockchip: add dt-binding header for rk3036 > clk: rockchip: add clock controller for rk3036 > clk: rockchip: add new clock type and controller for rk3036 > dt-bindings: add documentation of rk3036 clock controller > pinctrl: rockchip: add support for the rk3036 > rockchip: make sure timer5 is enabled on rk3036 platforms > ARM: rockchip: add support smp for rk3036 > rtc: hym8563: make sure hym8563 can be normal work am I missing some patches? I only got patches 1-4. Anyway, you should reorder a bit - whatever other patches are necessary before - dt-bindings: add documentation of rk3036 clock controller - clk: rockchip: add dt-binding header for rk3036 - clk: rockchip: add new pll type for rk3036 - clk: rockchip: add clock controller for rk3036 - ARM: dts: rockchip: add core rk3036 dts The dts patch for example depends on the clock-header, so it really should come after its addition. Heiko > > .../bindings/clock/rockchip,rk3036-cru.txt | 60 +++ > .../bindings/pinctrl/rockchip,pinctrl.txt | 1 + > arch/arm/boot/dts/Makefile | 1 + > arch/arm/boot/dts/rk3036-sdk.dts | 62 +++ > arch/arm/boot/dts/rk3036.dtsi | 381 +++++++++++++++ > arch/arm/mach-rockchip/platsmp.c | 121 +++++ > arch/arm/mach-rockchip/rockchip.c | 22 + > drivers/clk/rockchip/Makefile | 1 + > drivers/clk/rockchip/clk-pll.c | 262 +++++++++- > drivers/clk/rockchip/clk-rk3036.c | 504 > ++++++++++++++++++++ drivers/clk/rockchip/clk.h | > 30 ++ > drivers/pinctrl/pinctrl-rockchip.c | 17 + > drivers/rtc/rtc-hym8563.c | 93 ++++ > include/dt-bindings/clock/rk3036-cru.h | 198 ++++++++ > 14 files changed, 1752 insertions(+), 1 deletion(-) > create mode 100644 > Documentation/devicetree/bindings/clock/rockchip,rk3036-cru.txt create mode > 100644 arch/arm/boot/dts/rk3036-sdk.dts > create mode 100644 arch/arm/boot/dts/rk3036.dtsi > create mode 100644 drivers/clk/rockchip/clk-rk3036.c > create mode 100644 include/dt-bindings/clock/rk3036-cru.h -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work 2015-09-17 8:28 [rtc-linux] [PATCH v2 0/9] Build and support rk3036 SoC platform Xing Zheng 2015-09-17 9:59 ` [rtc-linux] " Heiko Stübner @ 2015-09-17 10:39 ` Xing Zheng 2015-09-17 12:07 ` [rtc-linux] " Heiko Stübner 1 sibling, 1 reply; 6+ messages in thread From: Xing Zheng @ 2015-09-17 10:39 UTC (permalink / raw) To: heiko; +Cc: a.zummo, alexandre.belloni, rtc-linux, linux-kernel, zhengxing The rtc hym8563 maybe failed to register if first startup or rtc powerdown: [ 0.988540 ] rtc-hym8563 1-0051: no valid clock/calendar values available [ 0.995642 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 [ 1.078985 ] rtc-hym8563 1-0051: no valid clock/calendar values available [ 1.085698 ] rtc-hym8563 1-0051: hctosys: unable to read the hardware clock We can set initial time for rtc and register it: [ 0.995678 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 [ 1.080313 ] rtc-hym8563 1-0051: setting system clock to 2000-01-01 00:02:00 UTC (946684920) --- Changes in v2: Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> drivers/rtc/rtc-hym8563.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index 097325d..ea37fdf 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -83,6 +83,8 @@ #define HYM8563_TMR_CNT 0x0f +#define HYM8563_RTC_SECTION_LEN 0x07 + struct hym8563 { struct i2c_client *client; struct rtc_device *rtc; @@ -527,9 +529,77 @@ static int hym8563_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(hym8563_pm_ops, hym8563_suspend, hym8563_resume); +static int hym8563_set_time(struct i2c_client *client, struct rtc_time *tm) +{ + u8 regs[HYM8563_RTC_SECTION_LEN] = {0}; + u8 mon_day; + int ret = 0; + + dev_dbg(&client->dev, "%s -- %4d-%02d-%02d(%d) %02d:%02d:%02d\n", __func__, + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + mon_day = rtc_month_days((tm->tm_mon), tm->tm_year + 1900); + + if (tm->tm_sec >= 60 || tm->tm_sec < 0) + regs[0x00] = bin2bcd(0x00); + else + regs[0x00] = bin2bcd(tm->tm_sec); + + if (tm->tm_min >= 60 || tm->tm_min < 0) + regs[0x01] = bin2bcd(0x00); + else + regs[0x01] = bin2bcd(tm->tm_min); + + if (tm->tm_hour >= 24 || tm->tm_hour < 0) + regs[0x02] = bin2bcd(0x00); + else + regs[0x02] = bin2bcd(tm->tm_hour); + + if ((tm->tm_mday) > mon_day) + regs[0x03] = bin2bcd(mon_day); + else if ((tm->tm_mday) > 0) + regs[0x03] = bin2bcd(tm->tm_mday); + else if ((tm->tm_mday) <= 0) + regs[0x03] = bin2bcd(0x01); + + if (tm->tm_year >= 200) + regs[0x06] = bin2bcd(99); + else if (tm->tm_year >= 100) + regs[0x06] = bin2bcd(tm->tm_year - 100); + else if (tm->tm_year >= 0) { + regs[0x06] = bin2bcd(tm->tm_year); + regs[0x05] |= 0x80; + } else { + regs[0x06] = bin2bcd(0); + regs[0x05] |= 0x80; + } + + regs[0x04] = bin2bcd(tm->tm_wday); + regs[0x05] = (regs[0x05] & 0x80) | (bin2bcd(tm->tm_mon + 1) & 0x7F); + + ret = i2c_smbus_write_byte_data(client, HYM8563_SEC, *regs); + if (ret < 0) { + dev_err(&client->dev, "%s: error writing i2c data %d\n", + __func__, ret); + return ret; + } + + return 0; +} + static int hym8563_probe(struct i2c_client *client, const struct i2c_device_id *id) { + struct rtc_time tm_read, tm = { + .tm_sec = 0, + .tm_min = 0, + .tm_hour = 12, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 111, + .tm_wday = 6, + }; struct hym8563 *hym8563; int ret; @@ -562,6 +632,7 @@ static int hym8563_probe(struct i2c_client *client, /* check state of calendar information */ ret = i2c_smbus_read_byte_data(client, HYM8563_SEC); + if (ret < 0) return ret; @@ -569,6 +640,28 @@ static int hym8563_probe(struct i2c_client *client, dev_dbg(&client->dev, "rtc information is %s\n", hym8563->valid ? "valid" : "invalid"); + if (!hym8563->valid) { + ret = hym8563_set_time(client, &tm); + if (ret < 0) { + dev_err(&client->dev, "rtc set time failed, %d\n", ret); + return ret; + } + + hym8563->valid = true; + } + + /* read current time */ + ret = hym8563_rtc_read_time(&client->dev, &tm_read); + if (ret < 0) { + dev_err(&client->dev, "rtc read time failed, %d\n", ret); + return ret; + } + + dev_dbg(&client->dev, "tm_sec = %d, tm_min = %d, tm_hour = %d,tm_mday = %d\n", + tm_read.tm_sec, tm_read.tm_min, tm_read.tm_hour, tm_read.tm_mday); + dev_dbg(&client->dev, "tm_mon = %d, tm_year = %d, tm_wday = %d\n", + tm_read.tm_mon, tm_read.tm_year, tm_read.tm_wday); + hym8563->rtc = devm_rtc_device_register(&client->dev, client->name, &hym8563_rtc_ops, THIS_MODULE); if (IS_ERR(hym8563->rtc)) -- 1.7.9.5 -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work 2015-09-17 10:39 ` [rtc-linux] [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work Xing Zheng @ 2015-09-17 12:07 ` Heiko Stübner 2015-09-17 12:31 ` Alexandre Belloni 0 siblings, 1 reply; 6+ messages in thread From: Heiko Stübner @ 2015-09-17 12:07 UTC (permalink / raw) To: Xing Zheng; +Cc: a.zummo, alexandre.belloni, rtc-linux, linux-kernel Am Donnerstag, 17. September 2015, 18:39:28 schrieb Xing Zheng: > The rtc hym8563 maybe failed to register if first startup or rtc > powerdown: > [ 0.988540 ] rtc-hym8563 1-0051: no valid clock/calendar values available > [ 0.995642 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 [ > 1.078985 ] rtc-hym8563 1-0051: no valid clock/calendar values available [ > 1.085698 ] rtc-hym8563 1-0051: hctosys: unable to read the hardware > clock > > We can set initial time for rtc and register it: > [ 0.995678 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 > [ 1.080313 ] rtc-hym8563 1-0051: setting system clock to 2000-01-01 > 00:02:00 UTC (946684920) hmm, not setting a false date was actually intentional when I did the driver. In my mind it is better to shout and keep programs from using wrong values than to set some arbitary date and let programs silently use this wrong value. But I guess we'll let the rtc maintainers decide what is actually the better approach. Heiko > > --- > > Changes in v2: > Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> > > drivers/rtc/rtc-hym8563.c | 93 > +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 > insertions(+) > > diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c > index 097325d..ea37fdf 100644 > --- a/drivers/rtc/rtc-hym8563.c > +++ b/drivers/rtc/rtc-hym8563.c > @@ -83,6 +83,8 @@ > > #define HYM8563_TMR_CNT 0x0f > > +#define HYM8563_RTC_SECTION_LEN 0x07 > + > struct hym8563 { > struct i2c_client *client; > struct rtc_device *rtc; > @@ -527,9 +529,77 @@ static int hym8563_resume(struct device *dev) > > static SIMPLE_DEV_PM_OPS(hym8563_pm_ops, hym8563_suspend, hym8563_resume); > > +static int hym8563_set_time(struct i2c_client *client, struct rtc_time *tm) > +{ > + u8 regs[HYM8563_RTC_SECTION_LEN] = {0}; > + u8 mon_day; > + int ret = 0; > + > + dev_dbg(&client->dev, "%s -- %4d-%02d-%02d(%d) %02d:%02d:%02d\n", > __func__, + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm- >tm_wday, > + tm->tm_hour, tm->tm_min, tm->tm_sec); > + > + mon_day = rtc_month_days((tm->tm_mon), tm->tm_year + 1900); > + > + if (tm->tm_sec >= 60 || tm->tm_sec < 0) > + regs[0x00] = bin2bcd(0x00); > + else > + regs[0x00] = bin2bcd(tm->tm_sec); > + > + if (tm->tm_min >= 60 || tm->tm_min < 0) > + regs[0x01] = bin2bcd(0x00); > + else > + regs[0x01] = bin2bcd(tm->tm_min); > + > + if (tm->tm_hour >= 24 || tm->tm_hour < 0) > + regs[0x02] = bin2bcd(0x00); > + else > + regs[0x02] = bin2bcd(tm->tm_hour); > + > + if ((tm->tm_mday) > mon_day) > + regs[0x03] = bin2bcd(mon_day); > + else if ((tm->tm_mday) > 0) > + regs[0x03] = bin2bcd(tm->tm_mday); > + else if ((tm->tm_mday) <= 0) > + regs[0x03] = bin2bcd(0x01); > + > + if (tm->tm_year >= 200) > + regs[0x06] = bin2bcd(99); > + else if (tm->tm_year >= 100) > + regs[0x06] = bin2bcd(tm->tm_year - 100); > + else if (tm->tm_year >= 0) { > + regs[0x06] = bin2bcd(tm->tm_year); > + regs[0x05] |= 0x80; > + } else { > + regs[0x06] = bin2bcd(0); > + regs[0x05] |= 0x80; > + } > + > + regs[0x04] = bin2bcd(tm->tm_wday); > + regs[0x05] = (regs[0x05] & 0x80) | (bin2bcd(tm->tm_mon + 1) & 0x7F); > + > + ret = i2c_smbus_write_byte_data(client, HYM8563_SEC, *regs); > + if (ret < 0) { > + dev_err(&client->dev, "%s: error writing i2c data %d\n", > + __func__, ret); > + return ret; > + } > + > + return 0; > +} > + > static int hym8563_probe(struct i2c_client *client, > const struct i2c_device_id *id) > { > + struct rtc_time tm_read, tm = { > + .tm_sec = 0, > + .tm_min = 0, > + .tm_hour = 12, > + .tm_mday = 1, > + .tm_mon = 0, > + .tm_year = 111, > + .tm_wday = 6, > + }; > struct hym8563 *hym8563; > int ret; > > @@ -562,6 +632,7 @@ static int hym8563_probe(struct i2c_client *client, > > /* check state of calendar information */ > ret = i2c_smbus_read_byte_data(client, HYM8563_SEC); > + > if (ret < 0) > return ret; > > @@ -569,6 +640,28 @@ static int hym8563_probe(struct i2c_client *client, > dev_dbg(&client->dev, "rtc information is %s\n", > hym8563->valid ? "valid" : "invalid"); > > + if (!hym8563->valid) { > + ret = hym8563_set_time(client, &tm); > + if (ret < 0) { > + dev_err(&client->dev, "rtc set time failed, %d\n", ret); > + return ret; > + } > + > + hym8563->valid = true; > + } > + > + /* read current time */ > + ret = hym8563_rtc_read_time(&client->dev, &tm_read); > + if (ret < 0) { > + dev_err(&client->dev, "rtc read time failed, %d\n", ret); > + return ret; > + } > + > + dev_dbg(&client->dev, "tm_sec = %d, tm_min = %d, tm_hour = %d,tm_mday = > %d\n", + tm_read.tm_sec, tm_read.tm_min, tm_read.tm_hour, > tm_read.tm_mday); + dev_dbg(&client->dev, "tm_mon = %d, tm_year = %d, > tm_wday = %d\n", + tm_read.tm_mon, tm_read.tm_year, tm_read.tm_wday); > + > hym8563->rtc = devm_rtc_device_register(&client->dev, client->name, > &hym8563_rtc_ops, THIS_MODULE); > if (IS_ERR(hym8563->rtc)) -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work 2015-09-17 12:07 ` [rtc-linux] " Heiko Stübner @ 2015-09-17 12:31 ` Alexandre Belloni 2015-09-17 12:44 ` Xing Zheng 0 siblings, 1 reply; 6+ messages in thread From: Alexandre Belloni @ 2015-09-17 12:31 UTC (permalink / raw) To: Heiko Stübner; +Cc: Xing Zheng, a.zummo, rtc-linux, linux-kernel Hi, On 17/09/2015 at 14:07:47 +0200, Heiko St=C3=BCbner wrote : > Am Donnerstag, 17. September 2015, 18:39:28 schrieb Xing Zheng: > > The rtc hym8563 maybe failed to register if first startup or rtc > > powerdown: > > [ 0.988540 ] rtc-hym8563 1-0051: no valid clock/calendar values avai= lable > > [ 0.995642 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc= 0 [=20 > > 1.078985 ] rtc-hym8563 1-0051: no valid clock/calendar values availab= le [ > > 1.085698 ] rtc-hym8563 1-0051: hctosys: unable to read the hardware > > clock > >=20 > > We can set initial time for rtc and register it: > > [ 0.995678 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc= 0 > > [ 1.080313 ] rtc-hym8563 1-0051: setting system clock to 2000-01-01 > > 00:02:00 UTC (946684920) >=20 > hmm, not setting a false date was actually intentional when I did the dri= ver. >=20 > In my mind it is better to shout and keep programs from using wrong value= s=20 > than to set some arbitary date and let programs silently use this wrong v= alue. >=20 Indeed, I find it worse to set a wrong value instead of returning an error. Userspace has to define its policy when reading the time fails. --=20 Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --=20 --=20 You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. ---=20 You received this message because you are subscribed to the Google Groups "= rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work 2015-09-17 12:31 ` Alexandre Belloni @ 2015-09-17 12:44 ` Xing Zheng 0 siblings, 0 replies; 6+ messages in thread From: Xing Zheng @ 2015-09-17 12:44 UTC (permalink / raw) To: Alexandre Belloni; +Cc: Heiko Stübner, a.zummo, rtc-linux, linux-kernel On 2015=E5=B9=B409=E6=9C=8817=E6=97=A5 20:31, Alexandre Belloni wrote: > Hi, > > On 17/09/2015 at 14:07:47 +0200, Heiko St=C3=BCbner wrote : >> Am Donnerstag, 17. September 2015, 18:39:28 schrieb Xing Zheng: >>> The rtc hym8563 maybe failed to register if first startup or rtc >>> powerdown: >>> [ 0.988540 ] rtc-hym8563 1-0051: no valid clock/calendar values avai= lable >>> [ 0.995642 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc= 0 [ >>> 1.078985 ] rtc-hym8563 1-0051: no valid clock/calendar values availa= ble [ >>> 1.085698 ] rtc-hym8563 1-0051: hctosys: unable to read the hardware >>> clock >>> >>> We can set initial time for rtc and register it: >>> [ 0.995678 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc= 0 >>> [ 1.080313 ] rtc-hym8563 1-0051: setting system clock to 2000-01-01 >>> 00:02:00 UTC (946684920) >> hmm, not setting a false date was actually intentional when I did the dr= iver. >> >> In my mind it is better to shout and keep programs from using wrong valu= es >> than to set some arbitary date and let programs silently use this wrong = value. >> > Indeed, I find it worse to set a wrong value instead of returning an > error. Userspace has to define its policy when reading the time fails. > OK, I got it, this patch will be abandoned at next version. Thanks. --=20 --=20 You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. ---=20 You received this message because you are subscribed to the Google Groups "= rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-17 12:44 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-09-17 8:28 [rtc-linux] [PATCH v2 0/9] Build and support rk3036 SoC platform Xing Zheng 2015-09-17 9:59 ` [rtc-linux] " Heiko Stübner 2015-09-17 10:39 ` [rtc-linux] [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work Xing Zheng 2015-09-17 12:07 ` [rtc-linux] " Heiko Stübner 2015-09-17 12:31 ` Alexandre Belloni 2015-09-17 12:44 ` Xing Zheng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox