資料介紹
Table of Contents
SSM4567 Audio Amplifier Linux Driver
Supported Devices
Evaluation Boards
Source Code
Status
Files
Function | File |
---|---|
driver | sound/soc/codecs/ssm4567.c |
include | sound/soc/codecs/ssm4567.h |
Example device initialization
For compile time configuration, it’s common Linux practice to keep board- and application-specific configuration out of the main driver file, instead putting it into the board support file.
For devices on custom boards, as typical of embedded and SoC-(system-on-chip) based hardware, Linux uses platform_data to point to board-specific structures describing devices and how they are connected to the SoC. This can include available ports, chip variants, preferred modes, default initialization, additional pin roles, and so on. This shrinks the board-support packages (BSPs) and minimizes board and application specific #ifdefs in drivers.
Declaring I2C devices
Unlike PCI or USB devices, I2C devices are not enumerated at the hardware level. Instead, the software must know which devices are connected on each I2C bus segment, and what address these devices are using. For this reason, the kernel code must instantiate I2C devices explicitly. There are different ways to achieve this, depending on the context and requirements. However the most common method is to declare the I2C devices by bus number.
This method is appropriate when the I2C bus is a system bus, as in many embedded systems, wherein each I2C bus has a number which is known in advance. It is thus possible to pre-declare the I2C devices that inhabit this bus. This is done with an array of struct i2c_board_info, which is registered by calling i2c_register_board_info().
So, to enable such a driver one need only edit the board support file by adding an appropriate entry to i2c_board_info.
For more information see: Documentation/i2c/instantiating-devices
The I2C address of the SSM4567 depends on the setting of the ADDR pin.
ADDR | I2C Address |
---|---|
0 | 0x34 |
1 | 0x35 |
static struct i2c_board_info __initdata bfin_i2c_board_info[] = { ? [--snip--] { I2C_BOARD_INFO("ssm4567", 0x34), }, [--snip--] }
static int __init stamp_init(void) { [--snip--] i2c_register_board_info(0, bfin_i2c_board_info, ARRAY_SIZE(bfin_i2c_board_info)); [--snip--] ? return 0; } arch_initcall(board_init);
Devicetree
i2s: i2c@41600000 { compatible = "...; ... #size-cells = <0>; #address-cells = <1>; ssm4567: ssm4567@34 { compatible = "adi,ssm4567"; reg = <0x34>; }; };
ASoC DAPM Widgets
Name | Description |
---|---|
OUT | Class-D Amplifier Output |
ALSA Controls
Name | Description |
---|---|
DAC High Pass Filter Switch | Enables/Disables the high-pass filter for the DAC |
DAC Low Power Switch | Enables/Disables low-power mode of the DAC |
Master Playback Volume | Digital output volume control. |
Low-EMI Switch | Enables/Disables low EMI mode. |
Limiter Mode | Mode the output limiter is using. |
Limiter Attack Rate | Attack rate of the output limiter. |
Limiter Release Rate | Release rate of the output limiter. |
Limiter Attack Threshold | Attack threshold for the output limiter. |
Amplifier Boost Switch | Enables/Disables the output amplifier booster |
DAI configuration
The amplifier driver registers one DAIs, one for each serial port. The DAI is named “ssm4567-hifi”
Supported DAI formats
Name | Supported by driver | Description |
---|---|---|
SND_SOC_DAIFMT_I2S | yes | I2S mode |
SND_SOC_DAIFMT_RIGHT_J | no | Right Justified mode |
SND_SOC_DAIFMT_LEFT_J | yes | Left Justified mode |
SND_SOC_DAIFMT_DSP_A | yes | data MSB after FRM LRC |
SND_SOC_DAIFMT_DSP_B | yes | data MSB during FRM LRC |
SND_SOC_DAIFMT_AC97 | no | AC97 mode |
SND_SOC_DAIFMT_PDM | yes | Pulse density modulation |
SND_SOC_DAIFMT_NB_NF | yes | Normal bit- and frameclock |
SND_SOC_DAIFMT_NB_IF | yes | Normal bitclock, inverted frameclock |
SND_SOC_DAIFMT_IB_NF | yes | Inverted frameclock, normal bitclock |
SND_SOC_DAIFMT_IB_IF | yes | Inverted bit- and frameclock |
SND_SOC_DAIFMT_CBM_CFM | no | Codec bit- and frameclock master |
SND_SOC_DAIFMT_CBS_CFM | no | Codec bitclock slave, frameclock master |
SND_SOC_DAIFMT_CBM_CFS | no | Codec bitclock master, frameclock slave |
SND_SOC_DAIFMT_CBS_CFS | yes | Codec bit- and frameclock slave |
TDM configuration
If you want to use the SSM4567 in TDM mode you can configure it using snd_soc_dai_set_tdm_slot() from you ASoC board driver.
The following restrictions apply to the parameters of snd_soc_dai_set_tdm_slot().
- tx_mask specifies the output channel mapping for the serial port. This must either be 0, or the same as rx_mask.
- rx_mask specifies the input channel mapping for the serial port. There must be exactly one bit set in this mask which selects the slot that is used.
- slots should be between 1 and 8
- width must be either 32, 48, 64
Example:
static int ssm4567_link_init(struct snd_soc_pcm_runtime *rtd) { int ret; ? ret = snd_soc_dai_set_tdm_slot(rtd->codec_dai, 0x01, 0x01, 8, 32); if (ret < 0) return ret; ? return 0; } ? static struct snd_soc_dai_link ssm4567_dai_link = { ..., .init = ssm4567_link_init, };
Example DAI configuration
static const struct snd_soc_dapm_widget ssm4567_zed_widgets[] = { SND_SOC_DAPM_SPK("Speaker", NULL), }; ? static const struct snd_soc_dapm_route ssm4567_zed_routes[] = { { "Speaker", NULL, "OUT" }, }; ? static struct snd_soc_dai_link ssm4567_zed_dai_link = { .name = "ssm4567", .stream_name = "ssm4567", .codec_dai_name = "ssm4567-hifi", .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .init = ssm4567_zed_init, }; ? static struct snd_soc_card ssm4567_zed_card = { .name = "ZED SSM4567", .owner = THIS_MODULE, .dai_link = &zed_ssm4567_dai_link, .num_links = 1, .dapm_widgets = zed_ssm4567_widgets, .num_dapm_widgets = ARRAY_SIZE(zed_ssm4567_widgets), .dapm_routes = zed_ssm4567_routes, .num_dapm_routes = ARRAY_SIZE(zed_ssm4567_routes), .fully_routed = true, };
Multi SSM4567 Example configuration
This example shows how to setup a ASoC board driver for a system with two SSM4567, one driving the left speaker and the other driving the right speaker. In this example the left SSM4567 is at I2C address 0x34 (ADDR=0) and the right SSM4567 is at I2S address 0x35 (ADDR=1).
Note support for multiple CODECs on a single DAI link requires Linux v3.17 or higher.
static int ssm4567_link_init(struct snd_soc_pcm_runtime *rtd) { int ret; ? /* Slot 0 for left */ ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[0], 0x01, 0x01, 2, 32); if (ret < 0) return ret; ? /* Slot 2 for right */ ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[1], 0x02, 0x02, 2, 32); if (ret < 0) return ret; ? return 0; } ? static const struct snd_soc_dapm_widget ssm4567_zed_widgets[] = { SND_SOC_DAPM_SPK("Left Speaker", NULL), SND_SOC_DAPM_SPK("Right Speaker", NULL), }; ? static const struct snd_soc_dapm_route ssm4567_zed_routes[] = { { "Left Speaker", NULL, "Left OUT" }, { "Right Speaker", NULL, "Right OUT" }, }; ? static const snd_soc_dai_link_component ssm4567_zed_codec_components[] = { { /* Left */ .name = "ssm4567.0-0034", .codec_dai_name = "ssm4567-hifi", }, { /* Right */ .name = "ssm4567.0-0035", .codec_dai_name = "ssm4567-hifi", }, ? }; ? /* Assign prefix to avoid name conflicts */ static const struct snd_soc_codec_conf ssm4567_zed_codec_conf[] = { { .dev_name = "ssm4567.0-0034", .name_prefix = "Left", }, { .dev_name = "ssm4567.0-0035", .name_prefix = "Right", }, }; ? static struct snd_soc_dai_link ssm4567_zed_dai_link = { .name = "ssm4567", .stream_name = "ssm4567", ? .codecs = ssm4567_zed_codec_components, .num_codecs = ARRAY_SIZE(ssm4567_zed_codec_components), .codec_conf = ssm4567_zed_codec_conf, .num_configs = ARRAY_SIZE(ssm4567_zed_codec_conf), ? .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .init = ssm4567_link_init, }; ? static struct snd_soc_card ssm4567_zed_card = { .name = "ZED SSM4567", .owner = THIS_MODULE, .dai_link = &zed_ssm4567_dai_link, .num_links = 1, .dapm_widgets = zed_ssm4567_widgets, .num_dapm_widgets = ARRAY_SIZE(zed_ssm4567_widgets), .dapm_routes = zed_ssm4567_routes, .num_dapm_routes = ARRAY_SIZE(zed_ssm4567_routes), .fully_routed = true, };
More information
- 集成音頻放大器DSP如何提高音頻放大器的效率
- SSM4567 IBIS模型
- EVL-SS4567 SSM4567評(píng)估板
- SSM2275:軌到軌輸出音頻放大器過時(shí)數(shù)據(jù)表
- SSM2315無濾波器D類音頻放大器評(píng)估板(EVAL-SSM2315)
- UG-1097:評(píng)估SSM6322高保真音頻放大器
- AD8366雙數(shù)字可變?cè)鲆?b class="flag-6" style="color: red">放大器Linux驅(qū)動(dòng)程序
- SSM2335無濾波器D類音頻放大器評(píng)估板(EVAL-SSM2335)
- SSM2305單聲道2.8 W D類音頻放大器評(píng)估板(EVAL-SSM2305)
- SSM2475:Rail to Rail音頻放大器過時(shí)數(shù)據(jù)表
- EVAL-SSM2304:無濾波器D類音頻放大器評(píng)估板
- UG-196:無濾波器D類音頻放大器SSM2375評(píng)估板
- SSM4567:帶輸出檢測(cè)的2.5 W、5.1 V數(shù)字升壓D類音頻放大器
- UG-248:評(píng)估音頻放大器SSM2380
- 電子管音頻放大器技術(shù)基礎(chǔ)(十一)-音頻放大器的信噪比
- 音頻放大器的結(jié)構(gòu)和工作原理 4237次閱讀
- 音頻放大器怎么判斷好壞 3303次閱讀
- 音頻放大器的概念、類型及主要參數(shù) 2419次閱讀
- 音頻放大器電路圖分享 2630次閱讀
- 立體聲音頻放大器電路圖分享 2159次閱讀
- 典型音頻放大器電路圖分享 5136次閱讀
- 音頻放大器電路圖分享 1463次閱讀
- 常見音頻放大器電路圖講解 4450次閱讀
- 基于SSM2211的1.5W音頻放大器電路設(shè)計(jì) 2911次閱讀
- D類音頻放大器頗具優(yōu)勢(shì) 2015次閱讀
- digilentPmodAMP2:音頻放大器簡(jiǎn)介 2181次閱讀
- 新唐科技音頻放大器介紹 1651次閱讀
- 音頻放大器重要參數(shù) 9618次閱讀
- 工程師教你如何設(shè)計(jì)一個(gè)“優(yōu)質(zhì)”D類音頻放大器! 5758次閱讀
- 音頻放大器電路圖 5581次閱讀
下載排行
本周
- 1電子電路原理第七版PDF電子教材免費(fèi)下載
- 0.00 MB | 1491次下載 | 免費(fèi)
- 2單片機(jī)典型實(shí)例介紹
- 18.19 MB | 95次下載 | 1 積分
- 3S7-200PLC編程實(shí)例詳細(xì)資料
- 1.17 MB | 27次下載 | 1 積分
- 4筆記本電腦主板的元件識(shí)別和講解說明
- 4.28 MB | 18次下載 | 4 積分
- 5開關(guān)電源原理及各功能電路詳解
- 0.38 MB | 11次下載 | 免費(fèi)
- 6100W短波放大電路圖
- 0.05 MB | 4次下載 | 3 積分
- 7基于單片機(jī)和 SG3525的程控開關(guān)電源設(shè)計(jì)
- 0.23 MB | 4次下載 | 免費(fèi)
- 8基于AT89C2051/4051單片機(jī)編程器的實(shí)驗(yàn)
- 0.11 MB | 4次下載 | 免費(fèi)
本月
- 1OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234313次下載 | 免費(fèi)
- 2PADS 9.0 2009最新版 -下載
- 0.00 MB | 66304次下載 | 免費(fèi)
- 3protel99下載protel99軟件下載(中文版)
- 0.00 MB | 51209次下載 | 免費(fèi)
- 4LabView 8.0 專業(yè)版下載 (3CD完整版)
- 0.00 MB | 51043次下載 | 免費(fèi)
- 5555集成電路應(yīng)用800例(新編版)
- 0.00 MB | 33562次下載 | 免費(fèi)
- 6接口電路圖大全
- 未知 | 30320次下載 | 免費(fèi)
- 7Multisim 10下載Multisim 10 中文版
- 0.00 MB | 28588次下載 | 免費(fèi)
- 8開關(guān)電源設(shè)計(jì)實(shí)例指南
- 未知 | 21539次下載 | 免費(fèi)
總榜
- 1matlab軟件下載入口
- 未知 | 935053次下載 | 免費(fèi)
- 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
- 78.1 MB | 537793次下載 | 免費(fèi)
- 3MATLAB 7.1 下載 (含軟件介紹)
- 未知 | 420026次下載 | 免費(fèi)
- 4OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234313次下載 | 免費(fèi)
- 5Altium DXP2002下載入口
- 未知 | 233046次下載 | 免費(fèi)
- 6電路仿真軟件multisim 10.0免費(fèi)下載
- 340992 | 191183次下載 | 免費(fèi)
- 7十天學(xué)會(huì)AVR單片機(jī)與C語言視頻教程 下載
- 158M | 183277次下載 | 免費(fèi)
- 8proe5.0野火版下載(中文版免費(fèi)下載)
- 未知 | 138039次下載 | 免費(fèi)
評(píng)論
查看更多