요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
================================================================
I2C device driver binding control from user-space in old kernels
================================================================
.. NOTE::
Note: this section is only relevant if you are handling some old code
found in kernel 2.6. If you work with more recent kernels, you can
safely skip this section.
Up to kernel 2.6.32, many I2C drivers used helper macros provided by
<linux/i2c.h> which created standard module parameters to let the user
control how the driver would probe I2C buses and attach to devices. These
parameters were known as ``probe`` (to let the driver probe for an extra
address), ``force`` (to forcibly attach the driver to a given device) and
``ignore`` (to prevent a driver from probing a given address).
With the conversion of the I2C subsystem to the standard device driver
binding model, it became clear that these per-module parameters were no
longer needed, and that a centralized implementation was possible. The new,
sysfs-based interface is described in
Documentation/i2c/instantiating-devices.rst, section
"Method 4: Instantiate from user-space".
Below is a mapping from the old module parameters to the new interface.
Attaching a driver to an I2C device
-----------------------------------
Old method (module parameters)::
# modprobe <driver> probe=1,0x2d
# modprobe <driver> force=1,0x2d
# modprobe <driver> force_<device>=1,0x2d
New method (sysfs interface)::
# echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device
Preventing a driver from attaching to an I2C device
---------------------------------------------------
Old method (module parameters)::
# modprobe <driver> ignore=1,0x2f
New method (sysfs interface)::
# echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device
# modprobe <driver>
Of course, it is important to instantiate the ``dummy`` device before loading
the driver. The dummy device will be handled by i2c-core itself, preventing
other drivers from binding to it later on. If there is a real device at the
problematic address, and you want another driver to bind to it, then simply
pass the name of the device in question instead of ``dummy``.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
오래된 커널의 I2C 바인딩 제어
1-24이 절은 커널 2.6에서 발견한 오래된 코드를 다룰 때만 관련됩니다. 최신 커널로 작업한다면 건너뛰어도 됩니다.
커널 2.6.32까지 많은 I2C 드라이버는 `<linux/i2c.h>`가 제공하는 도우미 매크로로 표준 모듈 매개변수를 만들었습니다. 사용자는 이 매개변수로 드라이버가 I2C 버스를 probe하고 장치에 연결하는 방식을 제어했습니다.
`probe`는 드라이버가 추가 주소를 probe하게 하고, `force`는 지정 장치에 드라이버를 강제로 연결하며, `ignore`는 드라이버가 지정 주소를 probe하지 못하게 했습니다.
I2C 하위 시스템이 표준 장치 드라이버 바인딩 모델로 전환되면서 모듈별 매개변수는 더 이상 필요하지 않게 되었고 중앙 구현이 가능해졌습니다.
새 sysfs 기반 인터페이스는 `Documentation/i2c/instantiating-devices.rst`의 "Method 4: Instantiate from user-space" 절에 설명되어 있습니다.
2.6.32까지의 사용자 공간 제어 항목입니다.
드라이버별 매개변수가 i2c-core의 공통 sysfs로 대체되었습니다.
================================================================
I2C device driver binding control from user-space in old kernels
================================================================
.. NOTE::
Note: this section is only relevant if you are handling some old code
found in kernel 2.6. If you work with more recent kernels, you can
safely skip this section.
Up to kernel 2.6.32, many I2C drivers used helper macros provided by
<linux/i2c.h> which created standard module parameters to let the user
control how the driver would probe I2C buses and attach to devices. These
parameters were known as ``probe`` (to let the driver probe for an extra
address), ``force`` (to forcibly attach the driver to a given device) and
``ignore`` (to prevent a driver from probing a given address).
With the conversion of the I2C subsystem to the standard device driver
binding model, it became clear that these per-module parameters were no
longer needed, and that a centralized implementation was possible. The new,
sysfs-based interface is described in
Documentation/i2c/instantiating-devices.rst, section
"Method 4: Instantiate from user-space".
Below is a mapping from the old module parameters to the new interface.
장치 연결 방식의 변환
25-38과거에는 `modprobe <driver> probe=1,0x2d`, `force=1,0x2d`, 또는 `force_<device>=1,0x2d`로 버스 1의 주소 `0x2d`에 드라이버를 연결했습니다.
새 방식은 `echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device`로 i2c-core에 장치를 생성하도록 요청합니다.
동일한 버스·주소 작업을 비교합니다.
Attaching a driver to an I2C device
-----------------------------------
Old method (module parameters)::
# modprobe <driver> probe=1,0x2d
# modprobe <driver> force=1,0x2d
# modprobe <driver> force_<device>=1,0x2d
New method (sysfs interface)::
# echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device
특정 주소의 드라이버 연결 방지
39-55과거에는 `modprobe <driver> ignore=1,0x2f`로 버스 1의 주소 `0x2f`를 probe하지 않도록 했습니다.
새 방식에서는 먼저 `echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device`로 해당 주소에 `dummy` 장치를 만든 뒤 실제 드라이버를 로드합니다.
반드시 드라이버를 로드하기 전에 `dummy` 장치를 생성해야 합니다. `dummy`는 i2c-core가 직접 처리하므로 이후 다른 드라이버가 그 주소에 바인딩하지 못합니다.
문제가 되는 주소에 실제 장치가 있고 다른 드라이버를 연결하려면 `dummy` 대신 해당 장치 이름을 전달하면 됩니다.
dummy 장치가 주소를 먼저 점유하게 합니다.
주소를 막거나 실제 장치에 넘기는 방법입니다.
Preventing a driver from attaching to an I2C device
---------------------------------------------------
Old method (module parameters)::
# modprobe <driver> ignore=1,0x2f
New method (sysfs interface)::
# echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device
# modprobe <driver>
Of course, it is important to instantiate the ``dummy`` device before loading
the driver. The dummy device will be handled by i2c-core itself, preventing
other drivers from binding to it later on. If there is a real device at the
problematic address, and you want another driver to bind to it, then simply
pass the name of the device in question instead of ``dummy``.
요약·해설
old-module-parameters.rst:1-55오래된 드라이버의 probe·force·ignore 매개변수는 i2c-core의 new_device 인터페이스로 대체되었습니다. 특정 주소를 막으려면 실제 드라이버보다 먼저 dummy 장치를 생성합니다.
원문 분량과 핵심 검토 대상을 요약합니다.
문서의 주요 생성·구성 순서를 압축합니다.