Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
b04c58b
Documentation
arch
block
crypto
drivers
accessibility
acpi
acpica
apei
Kconfig
Makefile
ac.c
acpi_cmos_rtc.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c
battery.c
battery.h
bgrt.c
blacklist.c
bus.c
button.c
cm_sbs.c
container.c
custom_method.c
debugfs.c
device_pm.c
dock.c
ec.c
ec_sys.c
event.c
fan.c
glue.c
hed.c
internal.h
numa.c
nvs.c
osl.c
pci_irq.c
pci_link.c
pci_root.c
pci_slot.c
power.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
reboot.c
resource.c
sbs.c
sbshc.c
sbshc.h
scan.c
sleep.c
sleep.h
sysfs.c
tables.c
thermal.c
utils.c
video.c
video_detect.c
wakeup.c
amba
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma
edac
eisa
extcon
firewire
firmware
fmc
gpio
gpu
hid
hsi
hv
hwmon
hwspinlock
i2c
ide
idle
iio
infiniband
input
iommu
ipack
irqchip
isdn
leds
lguest
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
mtd
net
nfc
ntb
nubus
of
oprofile
parisc
parport
pci
pcmcia
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
sn
spi
spmi
ssb
staging
target
tc
thermal
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
drivers
/
acpi
/
acpi_cmos_rtc.c
Copy path
Blame
Blame
Latest commit
History
History
90 lines (73 loc) · 2.13 KB
Breadcrumbs
linux
/
drivers
/
acpi
/
acpi_cmos_rtc.c
Top
File metadata and controls
Code
Blame
90 lines (73 loc) · 2.13 KB
Raw
/* * ACPI support for CMOS RTC Address Space access * * Copyright (C) 2013, Intel Corporation * Authors: Lan Tianyu <tianyu.lan@intel.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/acpi.h> #include <linux/device.h> #include <linux/err.h> #include <linux/kernel.h> #include <linux/module.h> #include <asm-generic/rtc.h> #include "internal.h" ACPI_MODULE_NAME("cmos rtc"); static const struct acpi_device_id acpi_cmos_rtc_ids[] = { { "PNP0B00" }, { "PNP0B01" }, { "PNP0B02" }, {} }; static acpi_status acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address, u32 bits, u64 *value64, void *handler_context, void *region_context) { int i; u8 *value = (u8 *)&value64; if (address > 0xff || !value64) return AE_BAD_PARAMETER; if (function != ACPI_WRITE && function != ACPI_READ) return AE_BAD_PARAMETER; spin_lock_irq(&rtc_lock); for (i = 0; i < DIV_ROUND_UP(bits, 8); ++i, ++address, ++value) if (function == ACPI_READ) *value = CMOS_READ(address); else CMOS_WRITE(*value, address); spin_unlock_irq(&rtc_lock); return AE_OK; } static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev, const struct acpi_device_id *id) { acpi_status status; status = acpi_install_address_space_handler(adev->handle, ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler, NULL, NULL); if (ACPI_FAILURE(status)) { pr_err(PREFIX "Error installing CMOS-RTC region handler\n"); return -ENODEV; } return 1; } static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev) { if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle, ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler))) pr_err(PREFIX "Error removing CMOS-RTC region handler\n"); } static struct acpi_scan_handler cmos_rtc_handler = { .ids = acpi_cmos_rtc_ids, .attach = acpi_install_cmos_rtc_space_handler, .detach = acpi_remove_cmos_rtc_space_handler, }; void __init acpi_cmos_rtc_init(void) { acpi_scan_add_handler(&cmos_rtc_handler); }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
You can’t perform that action at this time.