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
9eb16864
Commit
9eb16864
authored
Sep 10, 2008
by
Kyle McMartin
Committed by
Kyle McMartin
Oct 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parisc: add rtc platform driver
Signed-off-by:
Kyle McMartin
<
kyle@mcmartin.ca
>
parent
f0514ae3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
1 deletion
+141
-1
arch/parisc/Kconfig
arch/parisc/Kconfig
+2
-0
arch/parisc/kernel/time.c
arch/parisc/kernel/time.c
+19
-1
drivers/rtc/Kconfig
drivers/rtc/Kconfig
+8
-0
drivers/rtc/Makefile
drivers/rtc/Makefile
+1
-0
drivers/rtc/rtc-parisc.c
drivers/rtc/rtc-parisc.c
+111
-0
No files found.
arch/parisc/Kconfig
View file @
9eb16864
...
...
@@ -9,6 +9,8 @@ config PARISC
def_bool y
select HAVE_IDE
select HAVE_OPROFILE
select RTC_CLASS
select RTC_DRV_PARISC
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series,
...
...
arch/parisc/kernel/time.c
View file @
9eb16864
...
...
@@ -23,6 +23,7 @@
#include <linux/smp.h>
#include <linux/profile.h>
#include <linux/clocksource.h>
#include <linux/platform_device.h>
#include <asm/uaccess.h>
#include <asm/io.h>
...
...
@@ -215,6 +216,24 @@ void __init start_cpu_itimer(void)
cpu_data
[
cpu
].
it_value
=
next_tick
;
}
struct
platform_device
rtc_parisc_dev
=
{
.
name
=
"rtc-parisc"
,
.
id
=
-
1
,
};
static
int
__init
rtc_init
(
void
)
{
int
ret
;
ret
=
platform_device_register
(
&
rtc_parisc_dev
);
if
(
ret
<
0
)
printk
(
KERN_ERR
"unable to register rtc device...
\n
"
);
/* not necessarily an error */
return
0
;
}
module_init
(
rtc_init
);
void
__init
time_init
(
void
)
{
static
struct
pdc_tod
tod_data
;
...
...
@@ -245,4 +264,3 @@ void __init time_init(void)
xtime
.
tv_nsec
=
0
;
}
}
drivers/rtc/Kconfig
View file @
9eb16864
...
...
@@ -575,6 +575,14 @@ config RTC_DRV_RS5C313
help
If you say yes here you get support for the Ricoh RS5C313 RTC chips.
config RTC_DRV_PARISC
tristate "PA-RISC firmware RTC support"
depends on PARISC
help
Say Y or M here to enable RTC support on PA-RISC systems using
firmware calls. If you do not know what you are doing, you should
just say Y.
config RTC_DRV_PPC
tristate "PowerPC machine dependent RTC support"
depends on PPC_MERGE
...
...
drivers/rtc/Makefile
View file @
9eb16864
...
...
@@ -45,6 +45,7 @@ obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
obj-$(CONFIG_RTC_DRV_PCF8583)
+=
rtc-pcf8583.o
obj-$(CONFIG_RTC_DRV_PL030)
+=
rtc-pl030.o
obj-$(CONFIG_RTC_DRV_PL031)
+=
rtc-pl031.o
obj-$(CONFIG_RTC_DRV_PARISC)
+=
rtc-parisc.o
obj-$(CONFIG_RTC_DRV_PPC)
+=
rtc-ppc.o
obj-$(CONFIG_RTC_DRV_R9701)
+=
rtc-r9701.o
obj-$(CONFIG_RTC_DRV_RS5C313)
+=
rtc-rs5c313.o
...
...
drivers/rtc/rtc-parisc.c
0 → 100644
View file @
9eb16864
/* rtc-parisc: RTC for HP PA-RISC firmware
*
* Copyright (C) 2008 Kyle McMartin <kyle@mcmartin.ca>
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/platform_device.h>
#include <asm/rtc.h>
/* as simple as can be, and no simpler. */
struct
parisc_rtc
{
struct
rtc_device
*
rtc
;
spinlock_t
lock
;
};
static
int
parisc_get_time
(
struct
device
*
dev
,
struct
rtc_time
*
tm
)
{
struct
parisc_rtc
*
p
=
dev_get_drvdata
(
dev
);
unsigned
long
flags
,
ret
;
spin_lock_irqsave
(
&
p
->
lock
,
flags
);
ret
=
get_rtc_time
(
tm
);
spin_unlock_irqrestore
(
&
p
->
lock
,
flags
);
if
(
ret
&
RTC_BATT_BAD
)
return
-
EOPNOTSUPP
;
return
0
;
}
static
int
parisc_set_time
(
struct
device
*
dev
,
struct
rtc_time
*
tm
)
{
struct
parisc_rtc
*
p
=
dev_get_drvdata
(
dev
);
unsigned
long
flags
,
ret
;
spin_lock_irqsave
(
&
p
->
lock
,
flags
);
ret
=
set_rtc_time
(
tm
);
spin_unlock_irqrestore
(
&
p
->
lock
,
flags
);
if
(
ret
<
0
)
return
-
EOPNOTSUPP
;
return
0
;
}
static
const
struct
rtc_class_ops
parisc_rtc_ops
=
{
.
read_time
=
parisc_get_time
,
.
set_time
=
parisc_set_time
,
};
static
int
__devinit
parisc_rtc_probe
(
struct
platform_device
*
dev
)
{
struct
parisc_rtc
*
p
;
p
=
kzalloc
(
sizeof
(
*
p
),
GFP_KERNEL
);
if
(
!
p
)
return
-
ENOMEM
;
spin_lock_init
(
&
p
->
lock
);
p
->
rtc
=
rtc_device_register
(
"rtc-parisc"
,
&
dev
->
dev
,
&
parisc_rtc_ops
,
THIS_MODULE
);
if
(
IS_ERR
(
p
->
rtc
))
{
int
err
=
PTR_ERR
(
p
->
rtc
);
kfree
(
p
);
return
err
;
}
platform_set_drvdata
(
dev
,
p
);
return
0
;
}
static
int
__devexit
parisc_rtc_remove
(
struct
platform_device
*
dev
)
{
struct
parisc_rtc
*
p
=
platform_get_drvdata
(
dev
);
rtc_device_unregister
(
p
->
rtc
);
kfree
(
p
);
return
0
;
}
static
struct
platform_driver
parisc_rtc_driver
=
{
.
driver
=
{
.
name
=
"rtc-parisc"
,
.
owner
=
THIS_MODULE
,
},
.
probe
=
parisc_rtc_probe
,
.
remove
=
__devexit_p
(
parisc_rtc_remove
),
};
static
int
__init
parisc_rtc_init
(
void
)
{
return
platform_driver_register
(
&
parisc_rtc_driver
);
}
static
void
__exit
parisc_rtc_fini
(
void
)
{
platform_driver_unregister
(
&
parisc_rtc_driver
);
}
module_init
(
parisc_rtc_init
);
module_exit
(
parisc_rtc_fini
);
MODULE_AUTHOR
(
"Kyle McMartin <kyle@mcmartin.ca>"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DESCRIPTION
(
"HP PA-RISC RTC driver"
);
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