Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
5bcb9a58
Commit
5bcb9a58
authored
Sep 01, 2005
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move genrtc.c's functions into <asm/rtc.h>
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
330cfe01
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
71 deletions
+48
-71
arch/mips/kernel/Makefile
arch/mips/kernel/Makefile
+0
-2
arch/mips/kernel/genrtc.c
arch/mips/kernel/genrtc.c
+0
-64
include/asm-mips/rtc.h
include/asm-mips/rtc.h
+48
-5
No files found.
arch/mips/kernel/Makefile
View file @
5bcb9a58
...
...
@@ -59,8 +59,6 @@ obj-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_64BIT)
+=
cpu-bugs64.o
obj-$(CONFIG_GEN_RTC)
+=
genrtc.o
CFLAGS_cpu-bugs64.o
=
$(
shell
if
$(CC)
$(CFLAGS)
-Wa
,-mdaddi
-c
-o
/dev/null
-xc
/dev/null
>
/dev/null 2>&1
;
then
echo
"-DHAVE_AS_SET_DADDI"
;
fi
)
CFLAGS_ioctl32.o
+=
-Ifs
/
...
...
arch/mips/kernel/genrtc.c
deleted
100644 → 0
View file @
330cfe01
/*
* A glue layer that provides RTC read/write to drivers/char/genrtc.c driver
* based on MIPS internal RTC routines. It does take care locking
* issues so that we are SMP/Preemption safe.
*
* Copyright (C) 2004 MontaVista Software Inc.
* Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
*
* Please read the COPYING file for all license details.
*/
#include <linux/spinlock.h>
#include <asm/rtc.h>
#include <asm/time.h>
static
DEFINE_SPINLOCK
(
mips_rtc_lock
);
unsigned
int
get_rtc_time
(
struct
rtc_time
*
time
)
{
unsigned
long
nowtime
;
spin_lock
(
&
mips_rtc_lock
);
nowtime
=
rtc_get_time
();
to_tm
(
nowtime
,
time
);
time
->
tm_year
-=
1900
;
spin_unlock
(
&
mips_rtc_lock
);
return
RTC_24H
;
}
int
set_rtc_time
(
struct
rtc_time
*
time
)
{
unsigned
long
nowtime
;
int
ret
;
spin_lock
(
&
mips_rtc_lock
);
nowtime
=
mktime
(
time
->
tm_year
+
1900
,
time
->
tm_mon
+
1
,
time
->
tm_mday
,
time
->
tm_hour
,
time
->
tm_min
,
time
->
tm_sec
);
ret
=
rtc_set_time
(
nowtime
);
spin_unlock
(
&
mips_rtc_lock
);
return
ret
;
}
unsigned
int
get_rtc_ss
(
void
)
{
struct
rtc_time
h
;
get_rtc_time
(
&
h
);
return
h
.
tm_sec
;
}
int
get_rtc_pll
(
struct
rtc_pll_info
*
pll
)
{
return
-
EINVAL
;
}
int
set_rtc_pll
(
struct
rtc_pll_info
*
pll
)
{
return
-
EINVAL
;
}
include/asm-mips/rtc.h
View file @
5bcb9a58
...
...
@@ -14,7 +14,9 @@
#ifdef __KERNEL__
#include <linux/spinlock.h>
#include <linux/rtc.h>
#include <asm/time.h>
#define RTC_PIE 0x40
/* periodic interrupt enable */
#define RTC_AIE 0x20
/* alarm interrupt enable */
...
...
@@ -27,11 +29,52 @@
#define RTC_24H 0x02
/* 24 hour mode - else hours bit 7 means pm */
#define RTC_DST_EN 0x01
/* auto switch DST - works f. USA only */
unsigned
int
get_rtc_time
(
struct
rtc_time
*
time
);
int
set_rtc_time
(
struct
rtc_time
*
time
);
unsigned
int
get_rtc_ss
(
void
);
int
get_rtc_pll
(
struct
rtc_pll_info
*
pll
);
int
set_rtc_pll
(
struct
rtc_pll_info
*
pll
);
static
DEFINE_SPINLOCK
(
mips_rtc_lock
);
static
inline
unsigned
int
get_rtc_time
(
struct
rtc_time
*
time
)
{
unsigned
long
nowtime
;
spin_lock
(
&
mips_rtc_lock
);
nowtime
=
rtc_get_time
();
to_tm
(
nowtime
,
time
);
time
->
tm_year
-=
1900
;
spin_unlock
(
&
mips_rtc_lock
);
return
RTC_24H
;
}
static
inline
int
set_rtc_time
(
struct
rtc_time
*
time
)
{
unsigned
long
nowtime
;
int
ret
;
spin_lock
(
&
mips_rtc_lock
);
nowtime
=
mktime
(
time
->
tm_year
+
1900
,
time
->
tm_mon
+
1
,
time
->
tm_mday
,
time
->
tm_hour
,
time
->
tm_min
,
time
->
tm_sec
);
ret
=
rtc_set_time
(
nowtime
);
spin_unlock
(
&
mips_rtc_lock
);
return
ret
;
}
static
inline
unsigned
int
get_rtc_ss
(
void
)
{
struct
rtc_time
h
;
get_rtc_time
(
&
h
);
return
h
.
tm_sec
;
}
static
inline
int
get_rtc_pll
(
struct
rtc_pll_info
*
pll
)
{
return
-
EINVAL
;
}
static
inline
int
set_rtc_pll
(
struct
rtc_pll_info
*
pll
)
{
return
-
EINVAL
;
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment