Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f4388ca7
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f4388ca7
编写于
9月 02, 2013
作者:
S
Samuel Ortiz
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/for-asoc'
上级
62282180
c6f39257
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
46 addition
and
24 deletion
+46
-24
drivers/mfd/davinci_voicecodec.c
drivers/mfd/davinci_voicecodec.c
+13
-10
drivers/mfd/twl6040.c
drivers/mfd/twl6040.c
+30
-13
include/linux/mfd/davinci_voicecodec.h
include/linux/mfd/davinci_voicecodec.h
+3
-0
include/linux/mfd/twl6040.h
include/linux/mfd/twl6040.h
+0
-1
未找到文件。
drivers/mfd/davinci_voicecodec.c
浏览文件 @
f4388ca7
...
...
@@ -27,21 +27,16 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/regmap.h>
#include <sound/pcm.h>
#include <linux/mfd/davinci_voicecodec.h>
u32
davinci_vc_read
(
struct
davinci_vc
*
davinci_vc
,
int
reg
)
{
return
__raw_readl
(
davinci_vc
->
base
+
reg
);
}
void
davinci_vc_write
(
struct
davinci_vc
*
davinci_vc
,
int
reg
,
u32
val
)
{
__raw_writel
(
val
,
davinci_vc
->
base
+
reg
);
}
static
struct
regmap_config
davinci_vc_regmap
=
{
.
reg_bits
=
32
,
.
val_bits
=
32
,
};
static
int
__init
davinci_vc_probe
(
struct
platform_device
*
pdev
)
{
...
...
@@ -74,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
goto
fail
;
}
davinci_vc
->
regmap
=
devm_regmap_init_mmio
(
&
pdev
->
dev
,
davinci_vc
->
base
,
&
davinci_vc_regmap
);
if
(
IS_ERR
(
davinci_vc
->
regmap
))
{
ret
=
PTR_ERR
(
davinci_vc
->
regmap
);
goto
fail
;
}
res
=
platform_get_resource
(
pdev
,
IORESOURCE_DMA
,
0
);
if
(
!
res
)
{
dev_err
(
&
pdev
->
dev
,
"no DMA resource
\n
"
);
...
...
drivers/mfd/twl6040.c
浏览文件 @
f4388ca7
...
...
@@ -58,15 +58,9 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
int
ret
;
unsigned
int
val
;
/* Vibra control registers from cache */
if
(
unlikely
(
reg
==
TWL6040_REG_VIBCTLL
||
reg
==
TWL6040_REG_VIBCTLR
))
{
val
=
twl6040
->
vibra_ctrl_cache
[
VIBRACTRL_MEMBER
(
reg
)];
}
else
{
ret
=
regmap_read
(
twl6040
->
regmap
,
reg
,
&
val
);
if
(
ret
<
0
)
return
ret
;
}
ret
=
regmap_read
(
twl6040
->
regmap
,
reg
,
&
val
);
if
(
ret
<
0
)
return
ret
;
return
val
;
}
...
...
@@ -77,9 +71,6 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val)
int
ret
;
ret
=
regmap_write
(
twl6040
->
regmap
,
reg
,
val
);
/* Cache the vibra control registers */
if
(
reg
==
TWL6040_REG_VIBCTLL
||
reg
==
TWL6040_REG_VIBCTLR
)
twl6040
->
vibra_ctrl_cache
[
VIBRACTRL_MEMBER
(
reg
)]
=
val
;
return
ret
;
}
...
...
@@ -456,9 +447,20 @@ EXPORT_SYMBOL(twl6040_get_sysclk);
/* Get the combined status of the vibra control register */
int
twl6040_get_vibralr_status
(
struct
twl6040
*
twl6040
)
{
unsigned
int
reg
;
int
ret
;
u8
status
;
status
=
twl6040
->
vibra_ctrl_cache
[
0
]
|
twl6040
->
vibra_ctrl_cache
[
1
];
ret
=
regmap_read
(
twl6040
->
regmap
,
TWL6040_REG_VIBCTLL
,
&
reg
);
if
(
ret
!=
0
)
return
ret
;
status
=
reg
;
ret
=
regmap_read
(
twl6040
->
regmap
,
TWL6040_REG_VIBCTLR
,
&
reg
);
if
(
ret
!=
0
)
return
ret
;
status
|=
reg
;
status
&=
(
TWL6040_VIBENA
|
TWL6040_VIBSEL
);
return
status
;
...
...
@@ -485,12 +487,27 @@ static bool twl6040_readable_reg(struct device *dev, unsigned int reg)
return
true
;
}
static
bool
twl6040_volatile_reg
(
struct
device
*
dev
,
unsigned
int
reg
)
{
switch
(
reg
)
{
case
TWL6040_REG_VIBCTLL
:
case
TWL6040_REG_VIBCTLR
:
case
TWL6040_REG_INTMR
:
return
false
;
default:
return
true
;
}
}
static
struct
regmap_config
twl6040_regmap_config
=
{
.
reg_bits
=
8
,
.
val_bits
=
8
,
.
max_register
=
TWL6040_REG_STATUS
,
/* 0x2e */
.
readable_reg
=
twl6040_readable_reg
,
.
volatile_reg
=
twl6040_volatile_reg
,
.
cache_type
=
REGCACHE_RBTREE
,
};
static
const
struct
regmap_irq
twl6040_irqs
[]
=
{
...
...
include/linux/mfd/davinci_voicecodec.h
浏览文件 @
f4388ca7
...
...
@@ -30,6 +30,8 @@
#include <mach/hardware.h>
struct
regmap
;
/*
* Register values.
*/
...
...
@@ -113,6 +115,7 @@ struct davinci_vc {
/* Memory resources */
void
__iomem
*
base
;
struct
regmap
*
regmap
;
/* MFD cells */
struct
mfd_cell
cells
[
DAVINCI_VC_CELLS
];
...
...
include/linux/mfd/twl6040.h
浏览文件 @
f4388ca7
...
...
@@ -230,7 +230,6 @@ struct twl6040 {
int
audpwron
;
int
power_count
;
int
rev
;
u8
vibra_ctrl_cache
[
2
];
/* PLL configuration */
int
pll
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录