I found that I was missing some rtc related kernel configs:
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
after adding these, I got both rtc and alarm devices.
I have another problem now... I can't find where network time is being
set?
I found that SntpClient "requestTime" is called only from
ThrottleService and GpsLocationProvider. These two modules get the
current time from Internet. "SystemClock.setCurrentTimeMillis" is only
called from GsmServiceStateTracker and AlarmManagerService but I can't
find how these functions get called after getting time from the net.
On Sep 14, 10:31 am, extrapedestrian <
extra.pedestr...@gmail.com>
wrote:
> Yes, I have slightly different:
>
> CONFIG_ANDROID_POWER_ALARM=y
>
> In kernel\drivers\staging\android\Makefile
> obj-$(CONFIG_ANDROID_POWER_ALARM) +=alarm.o
>
> and in Kconfig
>
> config ANDROID_POWER
> bool "Android power driver"
> depends on PM && RTC_CLASS
> default n
>
> config ANDROID_POWER_ALARM
> bool "Androidalarmdriver"
> depends on ANDROID_POWER
> default y
>
> Andalarm.o driver is built, and registered on kernel boot.
> > oh, you need to switch on in config file to enable androidalarm. Did you do
> > that in .config?
> > CONFIG_RTC_INTF_ALARM=y
>
> > kernel/driver/rtc/Makefile
> > rtc-core-$(CONFIG_RTC_INTF_ALARM) +=alarm.o
>
> > --lx
>
> > On Tue, Sep 13, 2011 at 9:19 PM, extrapedestrian <
extra.pedestr...@gmail.com
>
> > > wrote:
> > > im not saying android uses rtc.
> > > im saying /dev/alarmneeds rtc device. like I said in first post, i
> > > added kernel patchalarm.c andalarm.h, driver is registered on kernel
> > > boot, but I don't get /dev/alarmand /dev/rtc* device nodes. Do you
> > > know why /dev/alarmis not created?
>
> > > best regards,
> > > Petar Bajic
>
> > > On Sep 13, 1:47 pm, Liu Xin <
navy.x...@gmail.com> wrote:
> > > > no. we have /dev/rtc0
> > > > # ls -l /dev/rtc*
> > > > crw------- root root 254, 0 2011-09-13 19:32 rtc0
>
> > > > again, android doesn't use rtc directly. it sets current time by syscall
> > > > gettimeofday and /dev/alarm
>
> > > > refer to java API JNI:
> > > > dalvik/vm/native/java_lang_System.c
>
> > > > or android API JNI:
> > > > frameworks/base/core/jni/android_os_SystemClock.cpp
> > > > which calls SystemClock.cpp & Timers.cpp
>
> > > > thanks
> > > > --lx
> > > > On Mon, Sep 12, 2011 at 9:24 PM, extrapedestrian <
> > >
extra.pedestr...@gmail.com
>
> > > > > wrote:
> > > > > do you have /dev/rtc on your platform?
>
> > > > > On Sep 9, 4:30 pm, Xin Liu <
navy.x...@gmail.com> wrote:
> > > > > > I don't think so . Androidalarmdoesn't assume that your CPUs have
> > > RTC.
> > > > > we use timer to do the same job.
>
> > > > > > --lx
>
> > > > > > 在 2011-9-9,下午3:41, extrapedestrian 写道:
>
> > > > > > > I foundalarmis platform driver that needs rtc device. Our board