1*32e2eae2SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0 2*32e2eae2SMauro Carvalho Chehab 3*32e2eae2SMauro Carvalho Chehab.. include:: <isonum.txt> 4*32e2eae2SMauro Carvalho Chehab 5*32e2eae2SMauro Carvalho ChehabThe Silicon Labs Si4713 FM Radio Transmitter Driver 6*32e2eae2SMauro Carvalho Chehab=================================================== 7*32e2eae2SMauro Carvalho Chehab 8*32e2eae2SMauro Carvalho ChehabCopyright |copy| 2009 Nokia Corporation 9*32e2eae2SMauro Carvalho Chehab 10*32e2eae2SMauro Carvalho ChehabContact: Eduardo Valentin <eduardo.valentin@nokia.com> 11*32e2eae2SMauro Carvalho Chehab 12*32e2eae2SMauro Carvalho Chehab 13*32e2eae2SMauro Carvalho ChehabInformation about the Device 14*32e2eae2SMauro Carvalho Chehab---------------------------- 15*32e2eae2SMauro Carvalho Chehab 16*32e2eae2SMauro Carvalho ChehabThis chip is a Silicon Labs product. It is a I2C device, currently on 0x63 address. 17*32e2eae2SMauro Carvalho ChehabBasically, it has transmission and signal noise level measurement features. 18*32e2eae2SMauro Carvalho Chehab 19*32e2eae2SMauro Carvalho ChehabThe Si4713 integrates transmit functions for FM broadcast stereo transmission. 20*32e2eae2SMauro Carvalho ChehabThe chip also allows integrated receive power scanning to identify low signal 21*32e2eae2SMauro Carvalho Chehabpower FM channels. 22*32e2eae2SMauro Carvalho Chehab 23*32e2eae2SMauro Carvalho ChehabThe chip is programmed using commands and responses. There are also several 24*32e2eae2SMauro Carvalho Chehabproperties which can change the behavior of this chip. 25*32e2eae2SMauro Carvalho Chehab 26*32e2eae2SMauro Carvalho ChehabUsers must comply with local regulations on radio frequency (RF) transmission. 27*32e2eae2SMauro Carvalho Chehab 28*32e2eae2SMauro Carvalho ChehabDevice driver description 29*32e2eae2SMauro Carvalho Chehab------------------------- 30*32e2eae2SMauro Carvalho Chehab 31*32e2eae2SMauro Carvalho ChehabThere are two modules to handle this device. One is a I2C device driver 32*32e2eae2SMauro Carvalho Chehaband the other is a platform driver. 33*32e2eae2SMauro Carvalho Chehab 34*32e2eae2SMauro Carvalho ChehabThe I2C device driver exports a v4l2-subdev interface to the kernel. 35*32e2eae2SMauro Carvalho ChehabAll properties can also be accessed by v4l2 extended controls interface, by 36*32e2eae2SMauro Carvalho Chehabusing the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls). 37*32e2eae2SMauro Carvalho Chehab 38*32e2eae2SMauro Carvalho ChehabThe platform device driver exports a v4l2 radio device interface to user land. 39*32e2eae2SMauro Carvalho ChehabSo, it uses the I2C device driver as a sub device in order to send the user 40*32e2eae2SMauro Carvalho Chehabcommands to the actual device. Basically it is a wrapper to the I2C device driver. 41*32e2eae2SMauro Carvalho Chehab 42*32e2eae2SMauro Carvalho ChehabApplications can use v4l2 radio API to specify frequency of operation, mute state, 43*32e2eae2SMauro Carvalho Chehabetc. But mostly of its properties will be present in the extended controls. 44*32e2eae2SMauro Carvalho Chehab 45*32e2eae2SMauro Carvalho ChehabWhen the v4l2 mute property is set to 1 (true), the driver will turn the chip off. 46*32e2eae2SMauro Carvalho Chehab 47*32e2eae2SMauro Carvalho ChehabProperties description 48*32e2eae2SMauro Carvalho Chehab---------------------- 49*32e2eae2SMauro Carvalho Chehab 50*32e2eae2SMauro Carvalho ChehabThe properties can be accessed using v4l2 extended controls. 51*32e2eae2SMauro Carvalho ChehabHere is an output from v4l2-ctl util: 52*32e2eae2SMauro Carvalho Chehab 53*32e2eae2SMauro Carvalho Chehab.. code-block:: none 54*32e2eae2SMauro Carvalho Chehab 55*32e2eae2SMauro Carvalho Chehab / # v4l2-ctl -d /dev/radio0 --all -L 56*32e2eae2SMauro Carvalho Chehab Driver Info: 57*32e2eae2SMauro Carvalho Chehab Driver name : radio-si4713 58*32e2eae2SMauro Carvalho Chehab Card type : Silicon Labs Si4713 Modulator 59*32e2eae2SMauro Carvalho Chehab Bus info : 60*32e2eae2SMauro Carvalho Chehab Driver version: 0 61*32e2eae2SMauro Carvalho Chehab Capabilities : 0x00080800 62*32e2eae2SMauro Carvalho Chehab RDS Output 63*32e2eae2SMauro Carvalho Chehab Modulator 64*32e2eae2SMauro Carvalho Chehab Audio output: 0 (FM Modulator Audio Out) 65*32e2eae2SMauro Carvalho Chehab Frequency: 1408000 (88.000000 MHz) 66*32e2eae2SMauro Carvalho Chehab Video Standard = 0x00000000 67*32e2eae2SMauro Carvalho Chehab Modulator: 68*32e2eae2SMauro Carvalho Chehab Name : FM Modulator 69*32e2eae2SMauro Carvalho Chehab Capabilities : 62.5 Hz stereo rds 70*32e2eae2SMauro Carvalho Chehab Frequency range : 76.0 MHz - 108.0 MHz 71*32e2eae2SMauro Carvalho Chehab Subchannel modulation: stereo+rds 72*32e2eae2SMauro Carvalho Chehab 73*32e2eae2SMauro Carvalho Chehab User Controls 74*32e2eae2SMauro Carvalho Chehab 75*32e2eae2SMauro Carvalho Chehab mute (bool) : default=1 value=0 76*32e2eae2SMauro Carvalho Chehab 77*32e2eae2SMauro Carvalho Chehab FM Radio Modulator Controls 78*32e2eae2SMauro Carvalho Chehab 79*32e2eae2SMauro Carvalho Chehab rds_signal_deviation (int) : min=0 max=90000 step=10 default=200 value=200 flags=slider 80*32e2eae2SMauro Carvalho Chehab rds_program_id (int) : min=0 max=65535 step=1 default=0 value=0 81*32e2eae2SMauro Carvalho Chehab rds_program_type (int) : min=0 max=31 step=1 default=0 value=0 82*32e2eae2SMauro Carvalho Chehab rds_ps_name (str) : min=0 max=96 step=8 value='si4713 ' 83*32e2eae2SMauro Carvalho Chehab rds_radio_text (str) : min=0 max=384 step=32 value='' 84*32e2eae2SMauro Carvalho Chehab audio_limiter_feature_enabled (bool) : default=1 value=1 85*32e2eae2SMauro Carvalho Chehab audio_limiter_release_time (int) : min=250 max=102390 step=50 default=5010 value=5010 flags=slider 86*32e2eae2SMauro Carvalho Chehab audio_limiter_deviation (int) : min=0 max=90000 step=10 default=66250 value=66250 flags=slider 87*32e2eae2SMauro Carvalho Chehab audio_compression_feature_enabl (bool) : default=1 value=1 88*32e2eae2SMauro Carvalho Chehab audio_compression_gain (int) : min=0 max=20 step=1 default=15 value=15 flags=slider 89*32e2eae2SMauro Carvalho Chehab audio_compression_threshold (int) : min=-40 max=0 step=1 default=-40 value=-40 flags=slider 90*32e2eae2SMauro Carvalho Chehab audio_compression_attack_time (int) : min=0 max=5000 step=500 default=0 value=0 flags=slider 91*32e2eae2SMauro Carvalho Chehab audio_compression_release_time (int) : min=100000 max=1000000 step=100000 default=1000000 value=1000000 flags=slider 92*32e2eae2SMauro Carvalho Chehab pilot_tone_feature_enabled (bool) : default=1 value=1 93*32e2eae2SMauro Carvalho Chehab pilot_tone_deviation (int) : min=0 max=90000 step=10 default=6750 value=6750 flags=slider 94*32e2eae2SMauro Carvalho Chehab pilot_tone_frequency (int) : min=0 max=19000 step=1 default=19000 value=19000 flags=slider 95*32e2eae2SMauro Carvalho Chehab pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1 96*32e2eae2SMauro Carvalho Chehab tune_power_level (int) : min=0 max=120 step=1 default=88 value=88 flags=slider 97*32e2eae2SMauro Carvalho Chehab tune_antenna_capacitor (int) : min=0 max=191 step=1 default=0 value=110 flags=slider 98*32e2eae2SMauro Carvalho Chehab 99*32e2eae2SMauro Carvalho ChehabHere is a summary of them: 100*32e2eae2SMauro Carvalho Chehab 101*32e2eae2SMauro Carvalho Chehab* Pilot is an audible tone sent by the device. 102*32e2eae2SMauro Carvalho Chehab 103*32e2eae2SMauro Carvalho Chehab- pilot_frequency - Configures the frequency of the stereo pilot tone. 104*32e2eae2SMauro Carvalho Chehab- pilot_deviation - Configures pilot tone frequency deviation level. 105*32e2eae2SMauro Carvalho Chehab- pilot_enabled - Enables or disables the pilot tone feature. 106*32e2eae2SMauro Carvalho Chehab 107*32e2eae2SMauro Carvalho Chehab* The si4713 device is capable of applying audio compression to the 108*32e2eae2SMauro Carvalho Chehab transmitted signal. 109*32e2eae2SMauro Carvalho Chehab 110*32e2eae2SMauro Carvalho Chehab- acomp_enabled - Enables or disables the audio dynamic range control feature. 111*32e2eae2SMauro Carvalho Chehab- acomp_gain - Sets the gain for audio dynamic range control. 112*32e2eae2SMauro Carvalho Chehab- acomp_threshold - Sets the threshold level for audio dynamic range control. 113*32e2eae2SMauro Carvalho Chehab- acomp_attack_time - Sets the attack time for audio dynamic range control. 114*32e2eae2SMauro Carvalho Chehab- acomp_release_time - Sets the release time for audio dynamic range control. 115*32e2eae2SMauro Carvalho Chehab 116*32e2eae2SMauro Carvalho Chehab* Limiter setups audio deviation limiter feature. Once a over deviation occurs, 117*32e2eae2SMauro Carvalho Chehab it is possible to adjust the front-end gain of the audio input and always 118*32e2eae2SMauro Carvalho Chehab prevent over deviation. 119*32e2eae2SMauro Carvalho Chehab 120*32e2eae2SMauro Carvalho Chehab- limiter_enabled - Enables or disables the limiter feature. 121*32e2eae2SMauro Carvalho Chehab- limiter_deviation - Configures audio frequency deviation level. 122*32e2eae2SMauro Carvalho Chehab- limiter_release_time - Sets the limiter release time. 123*32e2eae2SMauro Carvalho Chehab 124*32e2eae2SMauro Carvalho Chehab* Tuning power 125*32e2eae2SMauro Carvalho Chehab 126*32e2eae2SMauro Carvalho Chehab- power_level - Sets the output power level for signal transmission. 127*32e2eae2SMauro Carvalho Chehab antenna_capacitor - This selects the value of antenna tuning capacitor 128*32e2eae2SMauro Carvalho Chehab manually or automatically if set to zero. 129*32e2eae2SMauro Carvalho Chehab 130*32e2eae2SMauro Carvalho Chehab* RDS related 131*32e2eae2SMauro Carvalho Chehab 132*32e2eae2SMauro Carvalho Chehab- rds_ps_name - Sets the RDS ps name field for transmission. 133*32e2eae2SMauro Carvalho Chehab- rds_radio_text - Sets the RDS radio text for transmission. 134*32e2eae2SMauro Carvalho Chehab- rds_pi - Sets the RDS PI field for transmission. 135*32e2eae2SMauro Carvalho Chehab- rds_pty - Sets the RDS PTY field for transmission. 136*32e2eae2SMauro Carvalho Chehab 137*32e2eae2SMauro Carvalho Chehab* Region related 138*32e2eae2SMauro Carvalho Chehab 139*32e2eae2SMauro Carvalho Chehab- preemphasis - sets the preemphasis to be applied for transmission. 140*32e2eae2SMauro Carvalho Chehab 141*32e2eae2SMauro Carvalho ChehabRNL 142*32e2eae2SMauro Carvalho Chehab--- 143*32e2eae2SMauro Carvalho Chehab 144*32e2eae2SMauro Carvalho ChehabThis device also has an interface to measure received noise level. To do that, you should 145*32e2eae2SMauro Carvalho Chehabioctl the device node. Here is an code of example: 146*32e2eae2SMauro Carvalho Chehab 147*32e2eae2SMauro Carvalho Chehab.. code-block:: none 148*32e2eae2SMauro Carvalho Chehab 149*32e2eae2SMauro Carvalho Chehab int main (int argc, char *argv[]) 150*32e2eae2SMauro Carvalho Chehab { 151*32e2eae2SMauro Carvalho Chehab struct si4713_rnl rnl; 152*32e2eae2SMauro Carvalho Chehab int fd = open("/dev/radio0", O_RDWR); 153*32e2eae2SMauro Carvalho Chehab int rval; 154*32e2eae2SMauro Carvalho Chehab 155*32e2eae2SMauro Carvalho Chehab if (argc < 2) 156*32e2eae2SMauro Carvalho Chehab return -EINVAL; 157*32e2eae2SMauro Carvalho Chehab 158*32e2eae2SMauro Carvalho Chehab if (fd < 0) 159*32e2eae2SMauro Carvalho Chehab return fd; 160*32e2eae2SMauro Carvalho Chehab 161*32e2eae2SMauro Carvalho Chehab sscanf(argv[1], "%d", &rnl.frequency); 162*32e2eae2SMauro Carvalho Chehab 163*32e2eae2SMauro Carvalho Chehab rval = ioctl(fd, SI4713_IOC_MEASURE_RNL, &rnl); 164*32e2eae2SMauro Carvalho Chehab if (rval < 0) 165*32e2eae2SMauro Carvalho Chehab return rval; 166*32e2eae2SMauro Carvalho Chehab 167*32e2eae2SMauro Carvalho Chehab printf("received noise level: %d\n", rnl.rnl); 168*32e2eae2SMauro Carvalho Chehab 169*32e2eae2SMauro Carvalho Chehab close(fd); 170*32e2eae2SMauro Carvalho Chehab } 171*32e2eae2SMauro Carvalho Chehab 172*32e2eae2SMauro Carvalho ChehabThe struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under 173*32e2eae2SMauro Carvalho Chehabinclude/linux/platform_data/media/si4713.h. 174*32e2eae2SMauro Carvalho Chehab 175*32e2eae2SMauro Carvalho ChehabStereo/Mono and RDS subchannels 176*32e2eae2SMauro Carvalho Chehab------------------------------- 177*32e2eae2SMauro Carvalho Chehab 178*32e2eae2SMauro Carvalho ChehabThe device can also be configured using the available sub channels for 179*32e2eae2SMauro Carvalho Chehabtransmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly. 180*32e2eae2SMauro Carvalho ChehabRefer to the V4L2 API specification for proper use of this ioctl. 181*32e2eae2SMauro Carvalho Chehab 182*32e2eae2SMauro Carvalho ChehabTesting 183*32e2eae2SMauro Carvalho Chehab------- 184*32e2eae2SMauro Carvalho ChehabTesting is usually done with v4l2-ctl utility for managing FM tuner cards. 185*32e2eae2SMauro Carvalho ChehabThe tool can be found in v4l-dvb repository under v4l2-apps/util directory. 186*32e2eae2SMauro Carvalho Chehab 187*32e2eae2SMauro Carvalho ChehabExample for setting rds ps name: 188*32e2eae2SMauro Carvalho Chehab 189*32e2eae2SMauro Carvalho Chehab.. code-block:: none 190*32e2eae2SMauro Carvalho Chehab 191*32e2eae2SMauro Carvalho Chehab # v4l2-ctl -d /dev/radio0 --set-ctrl=rds_ps_name="Dummy" 192*32e2eae2SMauro Carvalho Chehab 193