요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
========================
Kernel driver w1_ds28e17
========================
Supported chips:
* Maxim DS28E17 1-Wire-to-I2C Master Bridge
supported family codes:
================= ====
W1_FAMILY_DS28E17 0x19
================= ====
Author: Jan Kandziora <[email protected]>
Description
-----------
The DS28E17 is a Onewire slave device which acts as an I2C bus master.
This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
come and go as the DS28E17 devices come and go. I2C slave devices connected to
a DS28E17 can be accessed by the kernel or userspace tools as if they were
connected to a "native" I2C bus master.
An udev rule like the following::
SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
SYMLINK+="i2c-$attr{name}"
may be used to create stable /dev/i2c- entries based on the unique id of the
DS28E17 chip.
Driver parameters are:
speed:
This sets up the default I2C speed a DS28E17 get configured for as soon
it is connected. The power-on default of the DS28E17 is 400kBaud, but
chips may come and go on the Onewire bus without being de-powered and
as soon the "w1_ds28e17" driver notices a freshly connected, or
reconnected DS28E17 device on the Onewire bus, it will re-apply this
setting.
Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
alone the current DS28E17 setting on detect. The default value is 100.
stretch:
This sets up the default stretch value used for freshly connected
DS28E17 devices. It is a multiplier used on the calculation of the busy
wait time for an I2C transfer. This is to account for I2C slave devices
which make heavy use of the I2C clock stretching feature and thus, the
needed timeout cannot be pre-calculated correctly. As the w1_ds28e17
driver checks the DS28E17's busy flag in a loop after the precalculated
wait time, it should be hardly needed to tweak this setting.
Leave it at 1 unless you get ETIMEDOUT errors and a "w1_slave_driver
19-00000002dbd8: busy timeout" in the kernel log.
Valid values are 1 to 9. The default is 1.
The driver creates sysfs files /sys/bus/w1/devices/19-<id>/speed and
/sys/bus/w1/devices/19-<id>/stretch for each device, preloaded with the default
settings from the driver parameters. They may be changed anytime. In addition a
directory /sys/bus/w1/devices/19-<id>/i2c-<nnn> for the I2C bus master sysfs
structure is created.
See https://github.com/ianka/w1_ds28e17 for even more information.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
1-Wire-to-I2C 브리지
1-25`w1_ds28e17`은 Maxim DS28E17 1-Wire-to-I2C Master Bridge를 지원합니다. family symbol은 `W1_FAMILY_DS28E17`, 코드는 `0x19`이며 작성자는 Jan Kandziora입니다.
DS28E17은 1-Wire 슬레이브로 동작하면서 I2C 버스의 마스터가 됩니다. 드라이버는 감지한 DS28E17마다 새 I2C 버스를 만들고 장치 연결·분리에 따라 버스도 생성·제거합니다.
DS28E17에 연결된 I2C 슬레이브는 네이티브 I2C 마스터에 연결된 것처럼 커널이나 사용자 공간 도구에서 접근할 수 있습니다.
두 버스에서 장치가 맡는 역할입니다.
========================
Kernel driver w1_ds28e17
========================
Supported chips:
* Maxim DS28E17 1-Wire-to-I2C Master Bridge
supported family codes:
================= ====
W1_FAMILY_DS28E17 0x19
================= ====
Author: Jan Kandziora <[email protected]>
Description
-----------
The DS28E17 is a Onewire slave device which acts as an I2C bus master.
This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
come and go as the DS28E17 devices come and go. I2C slave devices connected to
a DS28E17 can be accessed by the kernel or userspace tools as if they were
connected to a "native" I2C bus master.
고유 ID 기반 장치 이름
26-36문서의 udev 규칙은 `i2c-dev` 하위 시스템에서 이름이 `w1-19-*`인 I2C 버스를 찾아 DS28E17의 고유 ID에 기반한 안정적인 `/dev/i2c-` 심볼릭 링크를 만듭니다.
규칙의 줄 연속과 `$attr{name}` 표현은 원문 코드 블록에 그대로 보존되어 있습니다.
동적 버스 번호 대신 칩 고유 ID를 사용합니다.
An udev rule like the following::
SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
SYMLINK+="i2c-$attr{name}"
may be used to create stable /dev/i2c- entries based on the unique id of the
DS28E17 chip.
speed와 stretch 매개변수
37-61`speed`는 DS28E17이 연결되는 즉시 적용할 기본 I2C 속도를 정합니다. 전원 투입 기본값은 400 kBaud지만, 1-Wire 버스에서 전원이 끊기지 않은 채 사라졌다 다시 나타날 수 있으므로 드라이버는 새 연결이나 재연결을 감지할 때 설정을 다시 적용합니다.
유효한 속도는 100, 400, 900 kBaud입니다. 다른 값은 감지 시 현재 DS28E17 설정을 그대로 두라는 뜻이며 드라이버 기본값은 100입니다.
`stretch`는 새 장치의 기본 clock-stretch 보정값입니다. I2C 전송 busy 대기 시간을 계산할 때 사용하는 배수로, clock stretching을 많이 쓰는 슬레이브 때문에 timeout을 미리 정확히 계산하기 어려운 경우를 보완합니다.
드라이버가 사전 계산 대기 뒤에도 DS28E17 busy flag를 반복 검사하므로 보통 조정할 필요가 없습니다. `ETIMEDOUT`과 `busy timeout` 커널 로그가 함께 나타날 때만 변경하며 유효 범위는 1~9, 기본값은 1입니다.
연결 시 적용되는 기본값과 유효 범위입니다.
Driver parameters are:
speed:
This sets up the default I2C speed a DS28E17 get configured for as soon
it is connected. The power-on default of the DS28E17 is 400kBaud, but
chips may come and go on the Onewire bus without being de-powered and
as soon the "w1_ds28e17" driver notices a freshly connected, or
reconnected DS28E17 device on the Onewire bus, it will re-apply this
setting.
Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
alone the current DS28E17 setting on detect. The default value is 100.
stretch:
This sets up the default stretch value used for freshly connected
DS28E17 devices. It is a multiplier used on the calculation of the busy
wait time for an I2C transfer. This is to account for I2C slave devices
which make heavy use of the I2C clock stretching feature and thus, the
needed timeout cannot be pre-calculated correctly. As the w1_ds28e17
driver checks the DS28E17's busy flag in a loop after the precalculated
wait time, it should be hardly needed to tweak this setting.
Leave it at 1 unless you get ETIMEDOUT errors and a "w1_slave_driver
19-00000002dbd8: busy timeout" in the kernel log.
장치별 sysfs와 참고 자료
62-72드라이버는 장치마다 `/sys/bus/w1/devices/19-<id>/speed`와 `stretch`를 만들고 모듈 매개변수의 기본값으로 채웁니다. 두 값은 언제든 변경할 수 있습니다.
같은 위치에 I2C 마스터 sysfs 구조를 위한 `i2c-<nnn>` 디렉터리도 생성합니다. 문서 끝의 GitHub URL은 추가 정보를 제공하는 외부 참고 자료입니다.
family 0x19 장치 아래 생성되는 항목입니다.
Valid values are 1 to 9. The default is 1.
The driver creates sysfs files /sys/bus/w1/devices/19-<id>/speed and
/sys/bus/w1/devices/19-<id>/stretch for each device, preloaded with the default
settings from the driver parameters. They may be changed anytime. In addition a
directory /sys/bus/w1/devices/19-<id>/i2c-<nnn> for the I2C bus master sysfs
structure is created.
See https://github.com/ianka/w1_ds28e17 for even more information.
요약·해설
w1_ds28e17.rst:1-72DS28E17 1-Wire-to-I2C 브리지의 동적 버스, 속도와 stretch 설정을 설명합니다.