요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
The Silicon Labs Si4713 FM Radio Transmitter Driver
===================================================
Copyright |copy| 2009 Nokia Corporation
Contact: Eduardo Valentin <eduardo.valentin@nokia.com>
Information about the Device
----------------------------
This chip is a Silicon Labs product. It is an I2C device, currently on 0x63 address.
Basically, it has transmission and signal noise level measurement features.
The Si4713 integrates transmit functions for FM broadcast stereo transmission.
The chip also allows integrated receive power scanning to identify low signal
power FM channels.
The chip is programmed using commands and responses. There are also several
properties which can change the behavior of this chip.
Users must comply with local regulations on radio frequency (RF) transmission.
Device driver description
-------------------------
There are two modules to handle this device. One is an I2C device driver
and the other is a platform driver.
The I2C device driver exports a v4l2-subdev interface to the kernel.
All properties can also be accessed by v4l2 extended controls interface, by
using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
The platform device driver exports a v4l2 radio device interface to user land.
So, it uses the I2C device driver as a sub device in order to send the user
commands to the actual device. Basically it is a wrapper to the I2C device driver.
Applications can use v4l2 radio API to specify frequency of operation, mute state,
etc. But mostly of its properties will be present in the extended controls.
When the v4l2 mute property is set to 1 (true), the driver will turn the chip off.
Properties description
----------------------
The properties can be accessed using v4l2 extended controls.
Here is an output from v4l2-ctl util:
.. code-block:: none
/ # v4l2-ctl -d /dev/radio0 --all -L
Driver Info:
Driver name : radio-si4713
Card type : Silicon Labs Si4713 Modulator
Bus info :
Driver version: 0
Capabilities : 0x00080800
RDS Output
Modulator
Audio output: 0 (FM Modulator Audio Out)
Frequency: 1408000 (88.000000 MHz)
Video Standard = 0x00000000
Modulator:
Name : FM Modulator
Capabilities : 62.5 Hz stereo rds
Frequency range : 76.0 MHz - 108.0 MHz
Subchannel modulation: stereo+rds
User Controls
mute (bool) : default=1 value=0
FM Radio Modulator Controls
rds_signal_deviation (int) : min=0 max=90000 step=10 default=200 value=200 flags=slider
rds_program_id (int) : min=0 max=65535 step=1 default=0 value=0
rds_program_type (int) : min=0 max=31 step=1 default=0 value=0
rds_ps_name (str) : min=0 max=96 step=8 value='si4713 '
rds_radio_text (str) : min=0 max=384 step=32 value=''
audio_limiter_feature_enabled (bool) : default=1 value=1
audio_limiter_release_time (int) : min=250 max=102390 step=50 default=5010 value=5010 flags=slider
audio_limiter_deviation (int) : min=0 max=90000 step=10 default=66250 value=66250 flags=slider
audio_compression_feature_enabl (bool) : default=1 value=1
audio_compression_gain (int) : min=0 max=20 step=1 default=15 value=15 flags=slider
audio_compression_threshold (int) : min=-40 max=0 step=1 default=-40 value=-40 flags=slider
audio_compression_attack_time (int) : min=0 max=5000 step=500 default=0 value=0 flags=slider
audio_compression_release_time (int) : min=100000 max=1000000 step=100000 default=1000000 value=1000000 flags=slider
pilot_tone_feature_enabled (bool) : default=1 value=1
pilot_tone_deviation (int) : min=0 max=90000 step=10 default=6750 value=6750 flags=slider
pilot_tone_frequency (int) : min=0 max=19000 step=1 default=19000 value=19000 flags=slider
pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
tune_power_level (int) : min=0 max=120 step=1 default=88 value=88 flags=slider
tune_antenna_capacitor (int) : min=0 max=191 step=1 default=0 value=110 flags=slider
Here is a summary of them:
* Pilot is an audible tone sent by the device.
- pilot_frequency - Configures the frequency of the stereo pilot tone.
- pilot_deviation - Configures pilot tone frequency deviation level.
- pilot_enabled - Enables or disables the pilot tone feature.
* The si4713 device is capable of applying audio compression to the
transmitted signal.
- acomp_enabled - Enables or disables the audio dynamic range control feature.
- acomp_gain - Sets the gain for audio dynamic range control.
- acomp_threshold - Sets the threshold level for audio dynamic range control.
- acomp_attack_time - Sets the attack time for audio dynamic range control.
- acomp_release_time - Sets the release time for audio dynamic range control.
* Limiter sets up the audio deviation limiter feature. Once an over deviation occurs,
it is possible to adjust the front-end gain of the audio input and always
prevent over deviation.
- limiter_enabled - Enables or disables the limiter feature.
- limiter_deviation - Configures audio frequency deviation level.
- limiter_release_time - Sets the limiter release time.
* Tuning power
- power_level - Sets the output power level for signal transmission.
antenna_capacitor - This selects the value of antenna tuning capacitor
manually or automatically if set to zero.
* RDS related
- rds_ps_name - Sets the RDS ps name field for transmission.
- rds_radio_text - Sets the RDS radio text for transmission.
- rds_pi - Sets the RDS PI field for transmission.
- rds_pty - Sets the RDS PTY field for transmission.
* Region related
- preemphasis - sets the preemphasis to be applied for transmission.
RNL
---
This device also has an interface to measure received noise level. To do that, you should
ioctl the device node. Here is an code of example:
.. code-block:: none
int main (int argc, char *argv[])
{
struct si4713_rnl rnl;
int fd = open("/dev/radio0", O_RDWR);
int rval;
if (argc < 2)
return -EINVAL;
if (fd < 0)
return fd;
sscanf(argv[1], "%d", &rnl.frequency);
rval = ioctl(fd, SI4713_IOC_MEASURE_RNL, &rnl);
if (rval < 0)
return rval;
printf("received noise level: %d\n", rnl.rnl);
close(fd);
}
The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under
include/linux/platform_data/media/si4713.h.
Stereo/Mono and RDS subchannels
-------------------------------
The device can also be configured using the available sub channels for
transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly.
Refer to the V4L2 API specification for proper use of this ioctl.
Testing
-------
Testing is usually done with v4l2-ctl utility for managing FM tuner cards.
The tool can be found in v4l-dvb repository under v4l2-apps/util directory.
Example for setting rds ps name:
.. code-block:: none
# v4l2-ctl -d /dev/radio0 --set-ctrl=rds_ps_name="Dummy"
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Si4713 transmitter 소개
1-10이 문서는 GPL-2.0 라이선스를 따릅니다. Copyright |copy| 2009 Nokia Corporation. 연락처는 Eduardo Valentin <eduardo.valentin@nokia.com>입니다.
Device 정보
11-27이 chip은 Silicon Labs 제품이며 현재 address `0x63`을 사용하는 I2C device입니다. 기본적으로 FM 전송과 signal noise level 측정 기능을 제공합니다.
Si4713은 FM broadcast stereo transmission용 transmit function을 통합합니다. 또한 receive power scan 기능으로 signal power가 낮은 FM channel을 식별할 수 있습니다.
Chip은 command와 response로 programming하며, 여러 property로 동작을 변경할 수 있습니다.
사용자는 radio frequency(RF) 전송에 관한 지역 규정을 준수해야 합니다.
Device driver 구성
28-46이 device는 두 module로 처리합니다. 하나는 I2C device driver이고 다른 하나는 platform driver입니다.
I2C device driver는 kernel에 `v4l2-subdev` interface를 export합니다. 모든 property는 `v4l2-subdev` call인 `g_ext_ctrls`, `s_ext_ctrls`를 사용하는 V4L2 extended controls interface로도 접근할 수 있습니다.
Platform device driver는 user land에 V4L2 radio device interface를 export합니다. 사용자 command를 실제 device에 보내기 위해 I2C device driver를 subdevice로 사용하며, 기본적으로 I2C driver의 wrapper입니다.
Application은 V4L2 radio API로 동작 frequency와 mute 상태 등을 지정할 수 있습니다. 대부분의 property는 extended control로 제공됩니다.
V4L2 mute property를 `1`(true)로 설정하면 driver는 chip을 끕니다.
Property와 control 출력
47-98Property는 V4L2 extended control로 접근합니다. 다음은 `v4l2-ctl` utility의 출력입니다.
/ # v4l2-ctl -d /dev/radio0 --all -L
Driver Info:
Driver name : radio-si4713
Card type : Silicon Labs Si4713 Modulator
Bus info :
Driver version: 0
Capabilities : 0x00080800
RDS Output
Modulator
Audio output: 0 (FM Modulator Audio Out)
Frequency: 1408000 (88.000000 MHz)
Video Standard = 0x00000000
Modulator:
Name : FM Modulator
Capabilities : 62.5 Hz stereo rds
Frequency range : 76.0 MHz - 108.0 MHz
Subchannel modulation: stereo+rds
User Controls
mute (bool) : default=1 value=0
FM Radio Modulator Controls
rds_signal_deviation (int) : min=0 max=90000 step=10 default=200 value=200 flags=slider
rds_program_id (int) : min=0 max=65535 step=1 default=0 value=0
rds_program_type (int) : min=0 max=31 step=1 default=0 value=0
rds_ps_name (str) : min=0 max=96 step=8 value='si4713 '
rds_radio_text (str) : min=0 max=384 step=32 value=''
audio_limiter_feature_enabled (bool) : default=1 value=1
audio_limiter_release_time (int) : min=250 max=102390 step=50 default=5010 value=5010 flags=slider
audio_limiter_deviation (int) : min=0 max=90000 step=10 default=66250 value=66250 flags=slider
audio_compression_feature_enabl (bool) : default=1 value=1
audio_compression_gain (int) : min=0 max=20 step=1 default=15 value=15 flags=slider
audio_compression_threshold (int) : min=-40 max=0 step=1 default=-40 value=-40 flags=slider
audio_compression_attack_time (int) : min=0 max=5000 step=500 default=0 value=0 flags=slider
audio_compression_release_time (int) : min=100000 max=1000000 step=100000 default=1000000 value=1000000 flags=slider
pilot_tone_feature_enabled (bool) : default=1 value=1
pilot_tone_deviation (int) : min=0 max=90000 step=10 default=6750 value=6750 flags=slider
pilot_tone_frequency (int) : min=0 max=19000 step=1 default=19000 value=19000 flags=slider
pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
tune_power_level (int) : min=0 max=120 step=1 default=88 value=88 flags=slider
tune_antenna_capacitor (int) : min=0 max=191 step=1 default=0 value=110 flags=slider
Control 요약
99-140Stereo pilot
Pilot은 device가 보내는 audible tone입니다.
- `pilot_frequency` - stereo pilot tone의 frequency를 설정합니다.
- `pilot_deviation` - pilot tone frequency deviation level을 설정합니다.
- `pilot_enabled` - pilot tone 기능을 enable 또는 disable합니다.
Audio compression
Si4713 device는 전송 signal에 audio compression을 적용할 수 있습니다.
- `acomp_enabled` - audio dynamic range control을 enable 또는 disable합니다.
- `acomp_gain` - audio dynamic range control의 gain을 설정합니다.
- `acomp_threshold` - audio dynamic range control의 threshold level을 설정합니다.
- `acomp_attack_time` - audio dynamic range control의 attack time을 설정합니다.
- `acomp_release_time` - audio dynamic range control의 release time을 설정합니다.
Limiter
Limiter는 audio deviation limiter 기능을 구성합니다. Over-deviation이 발생하면 audio input의 front-end gain을 조절해 over-deviation을 계속 방지할 수 있습니다.
- `limiter_enabled` - limiter 기능을 enable 또는 disable합니다.
- `limiter_deviation` - audio frequency deviation level을 설정합니다.
- `limiter_release_time` - limiter release time을 설정합니다.
Tuning power
- `power_level` - signal 전송의 output power level을 설정합니다.
- `antenna_capacitor` - antenna tuning capacitor 값을 직접 선택하며, 0이면 자동으로 선택합니다.
RDS
- `rds_ps_name` - 전송할 RDS PS name field를 설정합니다.
- `rds_radio_text` - 전송할 RDS radio text를 설정합니다.
- `rds_pi` - 전송할 RDS PI field를 설정합니다.
- `rds_pty` - 전송할 RDS PTY field를 설정합니다.
Region
- `preemphasis` - 전송에 적용할 preemphasis를 설정합니다.
Received Noise Level 측정
141-173이 device에는 received noise level(RNL)을 측정하는 interface도 있습니다. 측정하려면 device node에 ioctl을 호출합니다. 다음은 예제 code입니다.
int main (int argc, char *argv[])
{
struct si4713_rnl rnl;
int fd = open("/dev/radio0", O_RDWR);
int rval;
if (argc < 2)
return -EINVAL;
if (fd < 0)
return fd;
sscanf(argv[1], "%d", &rnl.frequency);
rval = ioctl(fd, SI4713_IOC_MEASURE_RNL, &rnl);
if (rval < 0)
return rval;
printf("received noise level: %d\n", rnl.rnl);
close(fd);
}
`struct si4713_rnl`과 `SI4713_IOC_MEASURE_RNL`은 `include/linux/platform_data/media/si4713.h`에 정의되어 있습니다.
Stereo/Mono와 RDS subchannel
174-180전송에 사용할 subchannel로 device를 설정할 수도 있습니다. `S/G_MODULATOR` ioctl을 사용하고 `txsubchans`를 올바르게 설정하십시오. 이 ioctl의 올바른 사용법은 V4L2 API specification을 참고하십시오.
Test
181-192Test는 보통 FM tuner card 관리용 `v4l2-ctl` utility로 수행합니다. 이 도구는 v4l-dvb repository의 `v4l2-apps/util` directory에 있습니다.
RDS PS name을 설정하는 예시는 다음과 같습니다.
# v4l2-ctl -d /dev/radio0 --set-ctrl=rds_ps_name="Dummy"
Control과 data path
si4713.rst:1-192Platform radio device가 user land V4L2 API를 제공하고 I2C `v4l2-subdev`가 실제 `0x63` device에 command를 전달합니다. Extended control은 modulation, audio processing, output power와 RDS field를 관리합니다.