Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0d7b5c93
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0d7b5c93
编写于
11月 10, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'asoc/topic/rl6231' and 'asoc/topic/rt5514' into asoc-next
上级
5b04644a
57f7feff
c5630877
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
66 addition
and
9 deletion
+66
-9
Documentation/devicetree/bindings/sound/rt5514.txt
Documentation/devicetree/bindings/sound/rt5514.txt
+9
-4
sound/soc/codecs/Kconfig
sound/soc/codecs/Kconfig
+4
-0
sound/soc/codecs/Makefile
sound/soc/codecs/Makefile
+1
-0
sound/soc/codecs/rl6231.c
sound/soc/codecs/rl6231.c
+3
-2
sound/soc/codecs/rt5514-spi.c
sound/soc/codecs/rt5514-spi.c
+46
-0
sound/soc/codecs/rt5514.c
sound/soc/codecs/rt5514.c
+3
-3
未找到文件。
Documentation/devicetree/bindings/sound/rt5514.txt
浏览文件 @
0d7b5c93
RT5514 audio CODEC
This device supports
I2C only
.
This device supports
both I2C and SPI
.
Required properties:
- compatible : "realtek,rt5514".
- reg : The I2C address of the device.
- reg : the I2C address of the device for I2C, the chip select
number for SPI.
Optional properties:
- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"
- interrupt-parent: The phandle for the interrupt controller.
- interrupts: The interrupt number to the cpu. The interrupt specifier format
depends on the interrupt controller.
- realtek,dmic-init-delay-ms
Set the DMIC initial delay (ms) to wait it ready.
Set the DMIC initial delay (ms) to wait it ready
for I2C
.
Pins on the device (for linking into audio routes) for
RT5514
:
Pins on the device (for linking into audio routes) for
I2C
:
* DMIC1L
* DMIC1R
...
...
sound/soc/codecs/Kconfig
浏览文件 @
0d7b5c93
...
...
@@ -749,6 +749,10 @@ config SND_SOC_RT5514
config SND_SOC_RT5514_SPI
tristate
config SND_SOC_RT5514_SPI_BUILTIN
bool # force RT5514_SPI to be built-in to avoid link errors
default SND_SOC_RT5514=y && SND_SOC_RT5514_SPI=m
config SND_SOC_RT5616
tristate "Realtek RT5616 CODEC"
depends on I2C
...
...
sound/soc/codecs/Makefile
浏览文件 @
0d7b5c93
...
...
@@ -360,6 +360,7 @@ obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o
obj-$(CONFIG_SND_SOC_RT298)
+=
snd-soc-rt298.o
obj-$(CONFIG_SND_SOC_RT5514)
+=
snd-soc-rt5514.o
obj-$(CONFIG_SND_SOC_RT5514_SPI)
+=
snd-soc-rt5514-spi.o
obj-$(CONFIG_SND_SOC_RT5514_SPI_BUILTIN)
+=
snd-soc-rt5514-spi.o
obj-$(CONFIG_SND_SOC_RT5616)
+=
snd-soc-rt5616.o
obj-$(CONFIG_SND_SOC_RT5631)
+=
snd-soc-rt5631.o
obj-$(CONFIG_SND_SOC_RT5640)
+=
snd-soc-rt5640.o
...
...
sound/soc/codecs/rl6231.c
浏览文件 @
0d7b5c93
...
...
@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(rl6231_get_pre_div);
*/
int
rl6231_calc_dmic_clk
(
int
rate
)
{
int
div
[]
=
{
2
,
3
,
4
,
6
,
8
,
12
};
static
const
int
div
[]
=
{
2
,
3
,
4
,
6
,
8
,
12
};
int
i
;
if
(
rate
<
1000000
*
div
[
0
])
{
...
...
@@ -189,7 +189,8 @@ EXPORT_SYMBOL_GPL(rl6231_pll_calc);
int
rl6231_get_clk_info
(
int
sclk
,
int
rate
)
{
int
i
,
pd
[]
=
{
1
,
2
,
3
,
4
,
6
,
8
,
12
,
16
};
int
i
;
static
const
int
pd
[]
=
{
1
,
2
,
3
,
4
,
6
,
8
,
12
,
16
};
if
(
sclk
<=
0
||
rate
<=
0
)
return
-
EINVAL
;
...
...
sound/soc/codecs/rt5514-spi.c
浏览文件 @
0d7b5c93
...
...
@@ -147,8 +147,13 @@ static void rt5514_spi_copy_work(struct work_struct *work)
static
void
rt5514_schedule_copy
(
struct
rt5514_dsp
*
rt5514_dsp
)
{
size_t
period_bytes
;
u8
buf
[
8
];
if
(
!
rt5514_dsp
->
substream
)
return
;
period_bytes
=
snd_pcm_lib_period_bytes
(
rt5514_dsp
->
substream
);
rt5514_dsp
->
get_size
=
0
;
/**
...
...
@@ -176,6 +181,10 @@ static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
rt5514_dsp
->
buf_size
=
rt5514_dsp
->
buf_limit
-
rt5514_dsp
->
buf_base
;
if
(
rt5514_dsp
->
buf_size
%
period_bytes
)
rt5514_dsp
->
buf_size
=
(
rt5514_dsp
->
buf_size
/
period_bytes
)
*
period_bytes
;
if
(
rt5514_dsp
->
buf_base
&&
rt5514_dsp
->
buf_limit
&&
rt5514_dsp
->
buf_rp
&&
rt5514_dsp
->
buf_size
)
schedule_delayed_work
(
&
rt5514_dsp
->
copy_work
,
0
);
...
...
@@ -447,9 +456,45 @@ static int rt5514_spi_probe(struct spi_device *spi)
return
ret
;
}
device_init_wakeup
(
&
spi
->
dev
,
true
);
return
0
;
}
static
int
__maybe_unused
rt5514_suspend
(
struct
device
*
dev
)
{
int
irq
=
to_spi_device
(
dev
)
->
irq
;
if
(
device_may_wakeup
(
dev
))
enable_irq_wake
(
irq
);
return
0
;
}
static
int
__maybe_unused
rt5514_resume
(
struct
device
*
dev
)
{
struct
snd_soc_platform
*
platform
=
snd_soc_lookup_platform
(
dev
);
struct
rt5514_dsp
*
rt5514_dsp
=
snd_soc_platform_get_drvdata
(
platform
);
int
irq
=
to_spi_device
(
dev
)
->
irq
;
u8
buf
[
8
];
if
(
device_may_wakeup
(
dev
))
disable_irq_wake
(
irq
);
if
(
rt5514_dsp
->
substream
)
{
rt5514_spi_burst_read
(
RT5514_IRQ_CTRL
,
(
u8
*
)
&
buf
,
sizeof
(
buf
));
if
(
buf
[
0
]
&
RT5514_IRQ_STATUS_BIT
)
rt5514_schedule_copy
(
rt5514_dsp
);
}
return
0
;
}
static
const
struct
dev_pm_ops
rt5514_pm_ops
=
{
SET_SYSTEM_SLEEP_PM_OPS
(
rt5514_suspend
,
rt5514_resume
)
};
static
const
struct
of_device_id
rt5514_of_match
[]
=
{
{
.
compatible
=
"realtek,rt5514"
,
},
{},
...
...
@@ -459,6 +504,7 @@ MODULE_DEVICE_TABLE(of, rt5514_of_match);
static
struct
spi_driver
rt5514_spi_driver
=
{
.
driver
=
{
.
name
=
"rt5514"
,
.
pm
=
&
rt5514_pm_ops
,
.
of_match_table
=
of_match_ptr
(
rt5514_of_match
),
},
.
probe
=
rt5514_spi_probe
,
...
...
sound/soc/codecs/rt5514.c
浏览文件 @
0d7b5c93
...
...
@@ -1143,7 +1143,7 @@ static const struct acpi_device_id rt5514_acpi_match[] = {
MODULE_DEVICE_TABLE
(
acpi
,
rt5514_acpi_match
);
#endif
static
int
rt5514_parse_d
t
(
struct
rt5514_priv
*
rt5514
,
struct
device
*
dev
)
static
int
rt5514_parse_d
p
(
struct
rt5514_priv
*
rt5514
,
struct
device
*
dev
)
{
device_property_read_u32
(
dev
,
"realtek,dmic-init-delay-ms"
,
&
rt5514
->
pdata
.
dmic_init_delay
);
...
...
@@ -1183,8 +1183,8 @@ static int rt5514_i2c_probe(struct i2c_client *i2c,
if
(
pdata
)
rt5514
->
pdata
=
*
pdata
;
else
if
(
i2c
->
dev
.
of_node
)
rt5514_parse_d
t
(
rt5514
,
&
i2c
->
dev
);
else
rt5514_parse_d
p
(
rt5514
,
&
i2c
->
dev
);
rt5514
->
i2c_regmap
=
devm_regmap_init_i2c
(
i2c
,
&
rt5514_i2c_regmap
);
if
(
IS_ERR
(
rt5514
->
i2c_regmap
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录