色哟哟视频在线观看-色哟哟视频在线-色哟哟欧美15最新在线-色哟哟免费在线观看-国产l精品国产亚洲区在线观看-国产l精品国产亚洲区久久

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
創作
電子發燒友網>電子資料下載>類型>參考設計>SSM4567音頻放大器Linux驅動程序

SSM4567音頻放大器Linux驅動程序

2021-05-14 | pdf | 75.24KB | 次下載 | 2積分

資料介紹

This version (08 Jun 2016 20:13) was approved by Lars-Peter Clausen.The Previously approved version (14 Apr 2015 09:59) is available.Diff

SSM4567 Audio Amplifier Linux Driver

Supported Devices

Evaluation Boards

Source Code

Status

Source Mainlined?
git yes

Files

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.

21 Oct 2010 16:10

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

21 Oct 2010 16:10

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

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1HFSS電磁仿真設計應用詳解PDF電子教程免費下載
  2. 24.30 MB   |  128次下載  |  1 積分
  3. 2雷達的基本分類方法
  4. 1.25 MB   |  4次下載  |  4 積分
  5. 3電感技術講解
  6. 827.73 KB  |  2次下載  |  免費
  7. 4從 MSP430? MCU 到 MSPM0 MCU 的遷移指南
  8. 1.17MB   |  2次下載  |  免費
  9. 5有源低通濾波器設計應用說明
  10. 1.12MB   |  2次下載  |  免費
  11. 6RA-Eco-RA2E1-48PIN-V1.0開發板資料
  12. 35.59 MB  |  2次下載  |  免費
  13. 7面向熱插拔應用的 I2C 解決方案
  14. 685.57KB   |  1次下載  |  免費
  15. 8愛普生有源晶體振蕩器SG3225EEN應用于儲能NPC、新能源
  16. 317.46 KB  |  1次下載  |  免費

本月

  1. 12024年工控與通信行業上游發展趨勢和熱點解讀
  2. 2.61 MB   |  763次下載  |  免費
  3. 2HFSS電磁仿真設計應用詳解PDF電子教程免費下載
  4. 24.30 MB   |  128次下載  |  1 積分
  5. 3繼電保護原理
  6. 2.80 MB   |  36次下載  |  免費
  7. 4正激、反激、推挽、全橋、半橋區別和特點
  8. 0.91 MB   |  32次下載  |  1 積分
  9. 5labview實現DBC在界面加載配置
  10. 0.57 MB   |  21次下載  |  5 積分
  11. 6在設計中使用MOSFET瞬態熱阻抗曲線
  12. 1.57MB   |  15次下載  |  免費
  13. 7GBT 4706.1-2024家用和類似用途電器的安全第1部分:通用要求
  14. 7.43 MB   |  14次下載  |  免費
  15. 8AD18學習筆記
  16. 14.47 MB   |  8次下載  |  2 積分

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935113次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關降壓/升壓雙向直流/直流轉換器 PCB layout 設計
  4. 1.48MB  |  420061次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233084次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費下載
  8. 340992  |  191360次下載  |  10 積分
  9. 5十天學會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183329次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81578次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73804次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65985次下載  |  10 積分
主站蜘蛛池模板: 一本道色播| 色婷婷AV99XX| 久久视热频国只有精品| 韩国伦理片2018在线播放免费观看 | 国产精品女上位在线观看| 补课H湿 1V1 PLAY| 爆操日本美女| 超碰在线视频公开| 俄罗斯大白屁股| 国产成人 免费观看| 国产成人精品久久一区二区三区| 成年色黄APP下载| 成人在线免费看片| 国产av在线看的| 国产伦精品一区二区三区免费| 国产传媒18精品免费观看| 囯产少妇BBBBBB高潮喷水一| 国产99在线视频| 国产露脸A片国语露对白| 国产最新进精品视频| 红色机尾快播| 久久婷婷五月综合色精品首页| 老鸭窝毛片| 青草久久影院| 色婷婷综合久久久中文字幕| 天天狠狠弄夜夜狠狠躁·太爽了| 午夜天堂一区人妻| 一本久道久久综合狠狠躁AV| 中文字幕a有搜索网站| 99久久久无码国产精品不卡按摩| 爱如潮水3免费观看日本| 国产交换丝雨巅峰| 交换年轻夫妇HD中文字幕| 久久秋霞理伦片| 琪琪的色原网站| 忘忧草在线| 曰本女人牲交视频免费| 九九热综合| 国产免费福利在线视频| FREEXXX性乌克兰XXX| 成人亚洲视频|