← Documents Documentation/ABI/testing/rtc-cdev GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

RTC character-device ioctl ABI

RTC time·alarm·wakeup alarm·periodic/update interrupt·frequency·voltage status ioctl과 legacy /dev/rtc 및 RTC class framework의 capability 차이를 설명합니다.

Source pathDocumentation/ABI/testing/rtc-cdev
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Time·alarm·interrupt·voltage ioctls

rtc-cdev:1-42

/dev/rtcX는 Gregorian·24-hour time, alarm과 IRQ, periodic·update interrupt, periodic frequency, main·backup voltage status를 제어합니다. WKALM은 24시간을 넘어 IRQ enable까지 한 request로 처리합니다.

Legacy /dev/rtc와 RTC class compatibility

rtc-cdev:44-50

새 RTC class는 old /dev/rtc ioctls를 지원하지만 chip·system 비표준성 때문에 일부 PC/AT 기능이 없을 수 있고, ACPI 등 새 기능은 old driver가 지원할 수 없습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /dev/rtcX
2 Date: April 2005
3 KernelVersion: 2.6.12
4 Contact: linux-rtc@vger.kernel.org
5 Description:
6 The ioctl interface to drivers for real-time clocks (RTCs).
7 Following actions are supported:
8
9 * RTC_RD_TIME, RTC_SET_TIME: Read or set the RTC time. Time
10 format is a Gregorian calendar date and 24 hour wall clock
11 time.
12
13 * RTC_AIE_ON, RTC_AIE_OFF: Enable or disable the alarm interrupt
14 for RTCs that support alarms
15
16 * RTC_ALM_READ, RTC_ALM_SET: Read or set the alarm time for
17 RTCs that support alarms. Can be set upto 24 hours in the
18 future. Requires a separate RTC_AIE_ON call to enable the
19 alarm interrupt. (Prefer to use RTC_WKALM_*)
20
21 * RTC_WKALM_RD, RTC_WKALM_SET: For RTCs that support a more
22 powerful interface, which can issue alarms beyond 24 hours and
23 enable IRQs in the same request.
24
25 * RTC_PIE_ON, RTC_PIE_OFF: Enable or disable the periodic
26 interrupt for RTCs that support periodic interrupts.
27
28 * RTC_UIE_ON, RTC_UIE_OFF: Enable or disable the update
29 interrupt for RTCs that support it.
30
31 * RTC_IRQP_READ, RTC_IRQP_SET: Read or set the frequency for
32 periodic interrupts for RTCs that support periodic interrupts.
33 Requires a separate RTC_PIE_ON call to enable the periodic
34 interrupts.
35
36 * RTC_VL_READ: Read the voltage inputs status of the RTC when
37 supported. The value is a bit field of RTC_VL_*, giving the
38 status of the main and backup voltages.
39
40 * RTC_VL_CLEAR: Clear the voltage status of the RTC. Some RTCs
41 need user interaction when the backup power provider is
42 replaced or charged to be able to clear the status.
43
44 The ioctl() calls supported by the older /dev/rtc interface are
45 also supported by the newer RTC class framework. However,
46 because the chips and systems are not standardized, some PC/AT
47 functionality might not be provided. And in the same way, some
48 newer features -- including those enabled by ACPI -- are exposed
49 by the RTC class framework, but can't be supported by the older
50 driver.
51

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

/dev/rtcX ioctl actions

1-42
항목내용
What/dev/rtcX
Date2005년 4월
KernelVersion2.6.12
Contactlinux-rtc@vger.kernel.org
DescriptionReal-time clock(RTC) driver를 위한 ioctl interface입니다.
Ioctl전문 번역
RTC_RD_TIME, RTC_SET_TIMERTC time을 읽거나 설정합니다. Time format은 Gregorian calendar date와 24-hour wall-clock time입니다.
RTC_AIE_ON, RTC_AIE_OFFAlarm을 지원하는 RTC에서 alarm interrupt를 활성화하거나 비활성화합니다.
RTC_ALM_READ, RTC_ALM_SETAlarm을 지원하는 RTC의 alarm time을 읽거나 설정합니다. 최대 24시간 뒤까지 설정할 수 있습니다. Alarm interrupt를 활성화하려면 별도의 RTC_AIE_ON call이 필요합니다. RTC_WKALM_* 사용을 권장합니다.
RTC_WKALM_RD, RTC_WKALM_SET더 강력한 interface를 지원하는 RTC에서 사용합니다. 24시간을 넘는 alarm을 만들고 같은 request에서 IRQ를 활성화할 수 있습니다.
RTC_PIE_ON, RTC_PIE_OFFPeriodic interrupt를 지원하는 RTC에서 periodic interrupt를 활성화하거나 비활성화합니다.
RTC_UIE_ON, RTC_UIE_OFFUpdate interrupt를 지원하는 RTC에서 이를 활성화하거나 비활성화합니다.
RTC_IRQP_READ, RTC_IRQP_SETPeriodic interrupt를 지원하는 RTC에서 그 frequency를 읽거나 설정합니다. Periodic interrupt를 활성화하려면 별도의 RTC_PIE_ON call이 필요합니다.
RTC_VL_READ지원되는 경우 RTC의 voltage input status를 읽습니다. 값은 RTC_VL_* bit field이며 main·backup voltage의 status를 제공합니다.
RTC_VL_CLEARRTC voltage status를 지웁니다. 일부 RTC에서는 backup power provider를 교체하거나 충전한 뒤 status를 지울 수 있도록 user interaction이 필요합니다.

Old RTC interface와 class framework

44-50

이전 /dev/rtc interface가 지원하는 ioctl() call은 새 RTC class framework도 지원합니다. 그러나 chip과 system이 표준화되어 있지 않아 일부 PC/AT functionality를 제공하지 않을 수 있습니다.

마찬가지로 ACPI로 활성화되는 기능을 포함한 일부 새 feature는 RTC class framework가 노출하지만 이전 driver는 지원할 수 없습니다.

RTC alarm과 periodic IRQ 설정 경로
RTC_ALM_SET within 24 hoursRTC_AIE_ON separatelyAlarm interrupt
RTC_WKALM_SET beyond 24 hoursEnable IRQ in same requestWake alarm
RTC_IRQP_SET frequencyRTC_PIE_ON separatelyPeriodic interrupts
RTC_VL_READ bit fieldMain and backup voltage statusRTC_VL_CLEAR with possible user interaction

Legacy alarm·periodic interface는 value 설정과 IRQ enable을 분리하고 wake-alarm interface는 더 긴 범위와 IRQ enable을 결합한다.