[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54067674.3040007@rock-chips.com>
Date: Wed, 03 Sep 2014 10:01:24 +0800
From: Chris Zhong <zyw@...k-chips.com>
To: Doug Anderson <dianders@...omium.org>
CC: Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Lee Jones <lee.jones@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Mike Turquette <mturquette@...aro.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
rtc-linux@...glegroups.com, Grant Likely <grant.likely@...aro.org>,
Lin Huang <hl@...k-chips.com>,
Tao Huang <huangtao@...k-chips.com>,
Eddie Cai <cf@...k-chips.com>,
zhangqing <zhangqing@...k-chips.com>, xxx <xxx@...k-chips.com>,
Heiko Stübner <heiko@...ech.de>,
Olof Johansson <olof@...om.net>,
Sonny Rao <sonnyrao@...omium.org>,
Dmitry Torokhov <dtor@...omium.org>,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
Kever Yang <kever.yang@...k-chips.com>
Subject: Re: [PATCH v7 3/5] RTC: RK808: add RTC driver for RK808
On 09/02/2014 11:58 AM, Doug Anderson wrote:
>> +static int rk808_rtc_probe(struct platform_device *pdev)
>> >+{
>> >+ struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
>> >+ struct rk808_rtc *rk808_rtc;
>> >+ struct rtc_time tm;
>> >+ int ret;
>> >+
>> >+ rk808_rtc = devm_kzalloc(&pdev->dev, sizeof(*rk808_rtc), GFP_KERNEL);
>> >+ if (rk808_rtc == NULL)
>> >+ return -ENOMEM;
>> >+
>> >+ platform_set_drvdata(pdev, rk808_rtc);
>> >+ rk808_rtc->rk808 = rk808;
>> >+
>> >+ /* start rtc running by default, and use shadowed timer. */
>> >+ ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG,
>> >+ BIT_RTC_CTRL_REG_STOP_RTC_M |
>> >+ BIT_RTC_CTRL_REG_RTC_READSEL_M,
>> >+ BIT_RTC_CTRL_REG_RTC_READSEL_M);
> I think this should still be setting to 0, not to
> BIT_RTC_CTRL_REG_RTC_READSEL_M. Otherwise the first read of the time
> will return that time that was frozen at probe time, right? AKA: if
> probe happens at 11:00:00 and then we read the time at 11:00:05 we'll
> still read 11:00:00 the first time.
>
Sorry, I did not describe correctly, in the previous mail.
Actually, RK808 has a "GET_TIME" switch bit. When "GET_TIME" bit rising thansiton to 1,
the current time will save in a shadowed register.
If "READSEL" = 1, read rtc time register, return the frozen time.
If we need the real time, clr this "READSEL" bit.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists