Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
072502a6
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
072502a6
编写于
9月 04, 2015
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'regmap/topic/lockdep' and 'regmap/topic/seq-delay' into regmap-next
上级
84fb9015
1ed81114
2de9d600
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
517 addition
and
309 deletion
+517
-309
drivers/base/regmap/internal.h
drivers/base/regmap/internal.h
+1
-1
drivers/base/regmap/regmap-ac97.c
drivers/base/regmap/regmap-ac97.c
+14
-27
drivers/base/regmap/regmap-i2c.c
drivers/base/regmap/regmap-i2c.c
+14
-27
drivers/base/regmap/regmap-mmio.c
drivers/base/regmap/regmap-mmio.c
+18
-34
drivers/base/regmap/regmap-spi.c
drivers/base/regmap/regmap-spi.c
+14
-27
drivers/base/regmap/regmap-spmi.c
drivers/base/regmap/regmap-spmi.c
+28
-50
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+79
-53
drivers/bus/vexpress-config.c
drivers/bus/vexpress-config.c
+1
-1
drivers/gpu/drm/i2c/adv7511.c
drivers/gpu/drm/i2c/adv7511.c
+1
-1
drivers/input/misc/drv260x.c
drivers/input/misc/drv260x.c
+3
-3
drivers/input/misc/drv2665.c
drivers/input/misc/drv2665.c
+1
-1
drivers/input/misc/drv2667.c
drivers/input/misc/drv2667.c
+2
-2
drivers/mfd/arizona-core.c
drivers/mfd/arizona-core.c
+1
-1
drivers/mfd/twl6040.c
drivers/mfd/twl6040.c
+1
-1
drivers/mfd/wm5102-tables.c
drivers/mfd/wm5102-tables.c
+3
-3
drivers/mfd/wm5110-tables.c
drivers/mfd/wm5110-tables.c
+3
-3
drivers/mfd/wm8994-core.c
drivers/mfd/wm8994-core.c
+4
-4
drivers/mfd/wm8997-tables.c
drivers/mfd/wm8997-tables.c
+1
-1
drivers/thermal/st/st_thermal.c
drivers/thermal/st/st_thermal.c
+1
-1
include/linux/regmap.h
include/linux/regmap.h
+311
-52
sound/soc/codecs/arizona.c
sound/soc/codecs/arizona.c
+1
-1
sound/soc/codecs/cs35l32.c
sound/soc/codecs/cs35l32.c
+1
-1
sound/soc/codecs/cs42l52.c
sound/soc/codecs/cs42l52.c
+1
-1
sound/soc/codecs/da7210.c
sound/soc/codecs/da7210.c
+2
-2
sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5640.c
+1
-1
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5645.c
+2
-2
sound/soc/codecs/rt5651.c
sound/soc/codecs/rt5651.c
+1
-1
sound/soc/codecs/rt5670.c
sound/soc/codecs/rt5670.c
+1
-1
sound/soc/codecs/rt5677.c
sound/soc/codecs/rt5677.c
+1
-1
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.c
+1
-1
sound/soc/codecs/wm2200.c
sound/soc/codecs/wm2200.c
+1
-1
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm5100.c
+1
-1
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8962.c
+1
-1
sound/soc/codecs/wm8993.c
sound/soc/codecs/wm8993.c
+1
-1
未找到文件。
drivers/base/regmap/internal.h
浏览文件 @
072502a6
...
@@ -136,7 +136,7 @@ struct regmap {
...
@@ -136,7 +136,7 @@ struct regmap {
/* if set, the HW registers are known to match map->reg_defaults */
/* if set, the HW registers are known to match map->reg_defaults */
bool
no_sync_defaults
;
bool
no_sync_defaults
;
struct
reg_
default
*
patch
;
struct
reg_
sequence
*
patch
;
int
patch_regs
;
int
patch_regs
;
/* if set, converts bulk read to single read */
/* if set, converts bulk read to single read */
...
...
drivers/base/regmap/regmap-ac97.c
浏览文件 @
072502a6
...
@@ -78,37 +78,24 @@ static const struct regmap_bus ac97_regmap_bus = {
...
@@ -78,37 +78,24 @@ static const struct regmap_bus ac97_regmap_bus = {
.
reg_read
=
regmap_ac97_reg_read
,
.
reg_read
=
regmap_ac97_reg_read
,
};
};
/**
struct
regmap
*
__regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
* regmap_init_ac97(): Initialise AC'97 register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @ac97: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
)
{
{
return
regmap_init
(
&
ac97
->
dev
,
&
ac97_regmap_bus
,
ac97
,
config
);
return
__regmap_init
(
&
ac97
->
dev
,
&
ac97_regmap_bus
,
ac97
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_ac97
);
EXPORT_SYMBOL_GPL
(
__
regmap_init_ac97
);
/**
struct
regmap
*
__devm_regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
* devm_regmap_init_ac97(): Initialise AC'97 register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @ac97: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
)
{
{
return
devm_regmap_init
(
&
ac97
->
dev
,
&
ac97_regmap_bus
,
ac97
,
config
);
return
__devm_regmap_init
(
&
ac97
->
dev
,
&
ac97_regmap_bus
,
ac97
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_ac97
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_ac97
);
MODULE_LICENSE
(
"GPL v2"
);
MODULE_LICENSE
(
"GPL v2"
);
drivers/base/regmap/regmap-i2c.c
浏览文件 @
072502a6
...
@@ -282,47 +282,34 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
...
@@ -282,47 +282,34 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
return
ERR_PTR
(
-
ENOTSUPP
);
return
ERR_PTR
(
-
ENOTSUPP
);
}
}
/**
struct
regmap
*
__regmap_init_i2c
(
struct
i2c_client
*
i2c
,
* regmap_init_i2c(): Initialise register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @i2c: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
)
{
{
const
struct
regmap_bus
*
bus
=
regmap_get_i2c_bus
(
i2c
,
config
);
const
struct
regmap_bus
*
bus
=
regmap_get_i2c_bus
(
i2c
,
config
);
if
(
IS_ERR
(
bus
))
if
(
IS_ERR
(
bus
))
return
ERR_CAST
(
bus
);
return
ERR_CAST
(
bus
);
return
regmap_init
(
&
i2c
->
dev
,
bus
,
&
i2c
->
dev
,
config
);
return
__regmap_init
(
&
i2c
->
dev
,
bus
,
&
i2c
->
dev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_i2c
);
EXPORT_SYMBOL_GPL
(
__
regmap_init_i2c
);
/**
struct
regmap
*
__devm_regmap_init_i2c
(
struct
i2c_client
*
i2c
,
* devm_regmap_init_i2c(): Initialise managed register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @i2c: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
)
{
{
const
struct
regmap_bus
*
bus
=
regmap_get_i2c_bus
(
i2c
,
config
);
const
struct
regmap_bus
*
bus
=
regmap_get_i2c_bus
(
i2c
,
config
);
if
(
IS_ERR
(
bus
))
if
(
IS_ERR
(
bus
))
return
ERR_CAST
(
bus
);
return
ERR_CAST
(
bus
);
return
devm_regmap_init
(
&
i2c
->
dev
,
bus
,
&
i2c
->
dev
,
config
);
return
__devm_regmap_init
(
&
i2c
->
dev
,
bus
,
&
i2c
->
dev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_i2c
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_i2c
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
drivers/base/regmap/regmap-mmio.c
浏览文件 @
072502a6
...
@@ -296,20 +296,11 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
...
@@ -296,20 +296,11 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
}
}
/**
struct
regmap
*
__regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
* regmap_init_mmio_clk(): Initialise register map with register clock
void
__iomem
*
regs
,
*
const
struct
regmap_config
*
config
,
* @dev: Device that will be interacted with
struct
lock_class_key
*
lock_key
,
* @clk_id: register clock consumer ID
const
char
*
lock_name
)
* @regs: Pointer to memory-mapped IO region
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
)
{
{
struct
regmap_mmio_context
*
ctx
;
struct
regmap_mmio_context
*
ctx
;
...
@@ -317,25 +308,17 @@ struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id,
...
@@ -317,25 +308,17 @@ struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id,
if
(
IS_ERR
(
ctx
))
if
(
IS_ERR
(
ctx
))
return
ERR_CAST
(
ctx
);
return
ERR_CAST
(
ctx
);
return
regmap_init
(
dev
,
&
regmap_mmio
,
ctx
,
config
);
return
__regmap_init
(
dev
,
&
regmap_mmio
,
ctx
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_mmio_clk
);
EXPORT_SYMBOL_GPL
(
__regmap_init_mmio_clk
);
/**
struct
regmap
*
__devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
* devm_regmap_init_mmio_clk(): Initialise managed register map with clock
const
char
*
clk_id
,
*
void
__iomem
*
regs
,
* @dev: Device that will be interacted with
const
struct
regmap_config
*
config
,
* @clk_id: register clock consumer ID
struct
lock_class_key
*
lock_key
,
* @regs: Pointer to memory-mapped IO region
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
)
{
{
struct
regmap_mmio_context
*
ctx
;
struct
regmap_mmio_context
*
ctx
;
...
@@ -343,8 +326,9 @@ struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id,
...
@@ -343,8 +326,9 @@ struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id,
if
(
IS_ERR
(
ctx
))
if
(
IS_ERR
(
ctx
))
return
ERR_CAST
(
ctx
);
return
ERR_CAST
(
ctx
);
return
devm_regmap_init
(
dev
,
&
regmap_mmio
,
ctx
,
config
);
return
__devm_regmap_init
(
dev
,
&
regmap_mmio
,
ctx
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_mmio_clk
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_mmio_clk
);
MODULE_LICENSE
(
"GPL v2"
);
MODULE_LICENSE
(
"GPL v2"
);
drivers/base/regmap/regmap-spi.c
浏览文件 @
072502a6
...
@@ -113,37 +113,24 @@ static struct regmap_bus regmap_spi = {
...
@@ -113,37 +113,24 @@ static struct regmap_bus regmap_spi = {
.
val_format_endian_default
=
REGMAP_ENDIAN_BIG
,
.
val_format_endian_default
=
REGMAP_ENDIAN_BIG
,
};
};
/**
struct
regmap
*
__regmap_init_spi
(
struct
spi_device
*
spi
,
* regmap_init_spi(): Initialise register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @spi: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_spi
(
struct
spi_device
*
spi
,
const
struct
regmap_config
*
config
)
{
{
return
regmap_init
(
&
spi
->
dev
,
&
regmap_spi
,
&
spi
->
dev
,
config
);
return
__regmap_init
(
&
spi
->
dev
,
&
regmap_spi
,
&
spi
->
dev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_spi
);
EXPORT_SYMBOL_GPL
(
__
regmap_init_spi
);
/**
struct
regmap
*
__devm_regmap_init_spi
(
struct
spi_device
*
spi
,
* devm_regmap_init_spi(): Initialise register map
const
struct
regmap_config
*
config
,
*
struct
lock_class_key
*
lock_key
,
* @spi: Device that will be interacted with
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The map will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_spi
(
struct
spi_device
*
spi
,
const
struct
regmap_config
*
config
)
{
{
return
devm_regmap_init
(
&
spi
->
dev
,
&
regmap_spi
,
&
spi
->
dev
,
config
);
return
__devm_regmap_init
(
&
spi
->
dev
,
&
regmap_spi
,
&
spi
->
dev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_spi
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_spi
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
drivers/base/regmap/regmap-spmi.c
浏览文件 @
072502a6
...
@@ -91,36 +91,25 @@ static struct regmap_bus regmap_spmi_base = {
...
@@ -91,36 +91,25 @@ static struct regmap_bus regmap_spmi_base = {
.
val_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
.
val_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
};
};
/**
struct
regmap
*
__regmap_init_spmi_base
(
struct
spmi_device
*
sdev
,
* regmap_init_spmi_base(): Create regmap for the Base register space
const
struct
regmap_config
*
config
,
* @sdev: SPMI device that will be interacted with
struct
lock_class_key
*
lock_key
,
* @config: Configuration for register map
const
char
*
lock_name
)
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_spmi_base
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
{
return
regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_base
,
sdev
,
config
);
return
__regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_base
,
sdev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_spmi_base
);
EXPORT_SYMBOL_GPL
(
__
regmap_init_spmi_base
);
/**
struct
regmap
*
__devm_regmap_init_spmi_base
(
struct
spmi_device
*
sdev
,
* devm_regmap_init_spmi_base(): Create managed regmap for Base register space
const
struct
regmap_config
*
config
,
* @sdev: SPMI device that will be interacted with
struct
lock_class_key
*
lock_key
,
* @config: Configuration for register map
const
char
*
lock_name
)
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_spmi_base
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
{
return
devm_regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_base
,
sdev
,
config
);
return
__devm_regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_base
,
sdev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_spmi_base
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_spmi_base
);
static
int
regmap_spmi_ext_read
(
void
*
context
,
static
int
regmap_spmi_ext_read
(
void
*
context
,
const
void
*
reg
,
size_t
reg_size
,
const
void
*
reg
,
size_t
reg_size
,
...
@@ -222,35 +211,24 @@ static struct regmap_bus regmap_spmi_ext = {
...
@@ -222,35 +211,24 @@ static struct regmap_bus regmap_spmi_ext = {
.
val_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
.
val_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
};
};
/**
struct
regmap
*
__regmap_init_spmi_ext
(
struct
spmi_device
*
sdev
,
* regmap_init_spmi_ext(): Create regmap for Ext register space
const
struct
regmap_config
*
config
,
* @sdev: Device that will be interacted with
struct
lock_class_key
*
lock_key
,
* @config: Configuration for register map
const
char
*
lock_name
)
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
struct
regmap
*
regmap_init_spmi_ext
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
{
return
regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_ext
,
sdev
,
config
);
return
__regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_ext
,
sdev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init_spmi_ext
);
EXPORT_SYMBOL_GPL
(
__
regmap_init_spmi_ext
);
/**
struct
regmap
*
__devm_regmap_init_spmi_ext
(
struct
spmi_device
*
sdev
,
* devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space
const
struct
regmap_config
*
config
,
* @sdev: SPMI device that will be interacted with
struct
lock_class_key
*
lock_key
,
* @config: Configuration for register map
const
char
*
lock_name
)
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
struct
regmap
*
devm_regmap_init_spmi_ext
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
{
return
devm_regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_ext
,
sdev
,
config
);
return
__devm_regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi_ext
,
sdev
,
config
,
lock_key
,
lock_name
);
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_spmi_ext
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init_spmi_ext
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
drivers/base/regmap/regmap.c
浏览文件 @
072502a6
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <linux/of.h>
#include <linux/of.h>
#include <linux/rbtree.h>
#include <linux/rbtree.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/delay.h>
#define CREATE_TRACE_POINTS
#define CREATE_TRACE_POINTS
#include "trace.h"
#include "trace.h"
...
@@ -518,22 +519,12 @@ enum regmap_endian regmap_get_val_endian(struct device *dev,
...
@@ -518,22 +519,12 @@ enum regmap_endian regmap_get_val_endian(struct device *dev,
}
}
EXPORT_SYMBOL_GPL
(
regmap_get_val_endian
);
EXPORT_SYMBOL_GPL
(
regmap_get_val_endian
);
/**
struct
regmap
*
__regmap_init
(
struct
device
*
dev
,
* regmap_init(): Initialise register map
const
struct
regmap_bus
*
bus
,
*
void
*
bus_context
,
* @dev: Device that will be interacted with
const
struct
regmap_config
*
config
,
* @bus: Bus-specific callbacks to use with device
struct
lock_class_key
*
lock_key
,
* @bus_context: Data passed to bus-specific callbacks
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap. This function should generally not be called
* directly, it should be called by bus-specific init functions.
*/
struct
regmap
*
regmap_init
(
struct
device
*
dev
,
const
struct
regmap_bus
*
bus
,
void
*
bus_context
,
const
struct
regmap_config
*
config
)
{
{
struct
regmap
*
map
;
struct
regmap
*
map
;
int
ret
=
-
EINVAL
;
int
ret
=
-
EINVAL
;
...
@@ -559,10 +550,14 @@ struct regmap *regmap_init(struct device *dev,
...
@@ -559,10 +550,14 @@ struct regmap *regmap_init(struct device *dev,
spin_lock_init
(
&
map
->
spinlock
);
spin_lock_init
(
&
map
->
spinlock
);
map
->
lock
=
regmap_lock_spinlock
;
map
->
lock
=
regmap_lock_spinlock
;
map
->
unlock
=
regmap_unlock_spinlock
;
map
->
unlock
=
regmap_unlock_spinlock
;
lockdep_set_class_and_name
(
&
map
->
spinlock
,
lock_key
,
lock_name
);
}
else
{
}
else
{
mutex_init
(
&
map
->
mutex
);
mutex_init
(
&
map
->
mutex
);
map
->
lock
=
regmap_lock_mutex
;
map
->
lock
=
regmap_lock_mutex
;
map
->
unlock
=
regmap_unlock_mutex
;
map
->
unlock
=
regmap_unlock_mutex
;
lockdep_set_class_and_name
(
&
map
->
mutex
,
lock_key
,
lock_name
);
}
}
map
->
lock_arg
=
map
;
map
->
lock_arg
=
map
;
}
}
...
@@ -907,30 +902,19 @@ struct regmap *regmap_init(struct device *dev,
...
@@ -907,30 +902,19 @@ struct regmap *regmap_init(struct device *dev,
err:
err:
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
}
}
EXPORT_SYMBOL_GPL
(
regmap_init
);
EXPORT_SYMBOL_GPL
(
__
regmap_init
);
static
void
devm_regmap_release
(
struct
device
*
dev
,
void
*
res
)
static
void
devm_regmap_release
(
struct
device
*
dev
,
void
*
res
)
{
{
regmap_exit
(
*
(
struct
regmap
**
)
res
);
regmap_exit
(
*
(
struct
regmap
**
)
res
);
}
}
/**
struct
regmap
*
__devm_regmap_init
(
struct
device
*
dev
,
* devm_regmap_init(): Initialise managed register map
const
struct
regmap_bus
*
bus
,
*
void
*
bus_context
,
* @dev: Device that will be interacted with
const
struct
regmap_config
*
config
,
* @bus: Bus-specific callbacks to use with device
struct
lock_class_key
*
lock_key
,
* @bus_context: Data passed to bus-specific callbacks
const
char
*
lock_name
)
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. This function should generally not be called
* directly, it should be called by bus-specific init functions. The
* map will be automatically freed by the device management code.
*/
struct
regmap
*
devm_regmap_init
(
struct
device
*
dev
,
const
struct
regmap_bus
*
bus
,
void
*
bus_context
,
const
struct
regmap_config
*
config
)
{
{
struct
regmap
**
ptr
,
*
regmap
;
struct
regmap
**
ptr
,
*
regmap
;
...
@@ -938,7 +922,8 @@ struct regmap *devm_regmap_init(struct device *dev,
...
@@ -938,7 +922,8 @@ struct regmap *devm_regmap_init(struct device *dev,
if
(
!
ptr
)
if
(
!
ptr
)
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
regmap
=
regmap_init
(
dev
,
bus
,
bus_context
,
config
);
regmap
=
__regmap_init
(
dev
,
bus
,
bus_context
,
config
,
lock_key
,
lock_name
);
if
(
!
IS_ERR
(
regmap
))
{
if
(
!
IS_ERR
(
regmap
))
{
*
ptr
=
regmap
;
*
ptr
=
regmap
;
devres_add
(
dev
,
ptr
);
devres_add
(
dev
,
ptr
);
...
@@ -948,7 +933,7 @@ struct regmap *devm_regmap_init(struct device *dev,
...
@@ -948,7 +933,7 @@ struct regmap *devm_regmap_init(struct device *dev,
return
regmap
;
return
regmap
;
}
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init
);
EXPORT_SYMBOL_GPL
(
__
devm_regmap_init
);
static
void
regmap_field_init
(
struct
regmap_field
*
rm_field
,
static
void
regmap_field_init
(
struct
regmap_field
*
rm_field
,
struct
regmap
*
regmap
,
struct
reg_field
reg_field
)
struct
regmap
*
regmap
,
struct
reg_field
reg_field
)
...
@@ -1827,7 +1812,7 @@ EXPORT_SYMBOL_GPL(regmap_bulk_write);
...
@@ -1827,7 +1812,7 @@ EXPORT_SYMBOL_GPL(regmap_bulk_write);
* relative. The page register has been written if that was necessary.
* relative. The page register has been written if that was necessary.
*/
*/
static
int
_regmap_raw_multi_reg_write
(
struct
regmap
*
map
,
static
int
_regmap_raw_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
const
struct
reg_
sequence
*
regs
,
size_t
num_regs
)
size_t
num_regs
)
{
{
int
ret
;
int
ret
;
...
@@ -1884,17 +1869,19 @@ static unsigned int _regmap_register_page(struct regmap *map,
...
@@ -1884,17 +1869,19 @@ static unsigned int _regmap_register_page(struct regmap *map,
}
}
static
int
_regmap_range_multi_paged_reg_write
(
struct
regmap
*
map
,
static
int
_regmap_range_multi_paged_reg_write
(
struct
regmap
*
map
,
struct
reg_
default
*
regs
,
struct
reg_
sequence
*
regs
,
size_t
num_regs
)
size_t
num_regs
)
{
{
int
ret
;
int
ret
;
int
i
,
n
;
int
i
,
n
;
struct
reg_
default
*
base
;
struct
reg_
sequence
*
base
;
unsigned
int
this_page
=
0
;
unsigned
int
this_page
=
0
;
unsigned
int
page_change
=
0
;
/*
/*
* the set of registers are not neccessarily in order, but
* the set of registers are not neccessarily in order, but
* since the order of write must be preserved this algorithm
* since the order of write must be preserved this algorithm
* chops the set each time the page changes
* chops the set each time the page changes. This also applies
* if there is a delay required at any point in the sequence.
*/
*/
base
=
regs
;
base
=
regs
;
for
(
i
=
0
,
n
=
0
;
i
<
num_regs
;
i
++
,
n
++
)
{
for
(
i
=
0
,
n
=
0
;
i
<
num_regs
;
i
++
,
n
++
)
{
...
@@ -1910,16 +1897,48 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
...
@@ -1910,16 +1897,48 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
this_page
=
win_page
;
this_page
=
win_page
;
if
(
win_page
!=
this_page
)
{
if
(
win_page
!=
this_page
)
{
this_page
=
win_page
;
this_page
=
win_page
;
page_change
=
1
;
}
}
/* If we have both a page change and a delay make sure to
* write the regs and apply the delay before we change the
* page.
*/
if
(
page_change
||
regs
[
i
].
delay_us
)
{
/* For situations where the first write requires
* a delay we need to make sure we don't call
* raw_multi_reg_write with n=0
* This can't occur with page breaks as we
* never write on the first iteration
*/
if
(
regs
[
i
].
delay_us
&&
i
==
0
)
n
=
1
;
ret
=
_regmap_raw_multi_reg_write
(
map
,
base
,
n
);
ret
=
_regmap_raw_multi_reg_write
(
map
,
base
,
n
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
return
ret
;
return
ret
;
if
(
regs
[
i
].
delay_us
)
udelay
(
regs
[
i
].
delay_us
);
base
+=
n
;
base
+=
n
;
n
=
0
;
n
=
0
;
}
ret
=
_regmap_select_page
(
map
,
&
base
[
n
].
reg
,
range
,
1
);
if
(
page_change
)
{
if
(
ret
!=
0
)
ret
=
_regmap_select_page
(
map
,
return
ret
;
&
base
[
n
].
reg
,
range
,
1
);
if
(
ret
!=
0
)
return
ret
;
page_change
=
0
;
}
}
}
}
}
if
(
n
>
0
)
if
(
n
>
0
)
return
_regmap_raw_multi_reg_write
(
map
,
base
,
n
);
return
_regmap_raw_multi_reg_write
(
map
,
base
,
n
);
...
@@ -1927,7 +1946,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
...
@@ -1927,7 +1946,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
}
}
static
int
_regmap_multi_reg_write
(
struct
regmap
*
map
,
static
int
_regmap_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
const
struct
reg_
sequence
*
regs
,
size_t
num_regs
)
size_t
num_regs
)
{
{
int
i
;
int
i
;
...
@@ -1938,6 +1957,9 @@ static int _regmap_multi_reg_write(struct regmap *map,
...
@@ -1938,6 +1957,9 @@ static int _regmap_multi_reg_write(struct regmap *map,
ret
=
_regmap_write
(
map
,
regs
[
i
].
reg
,
regs
[
i
].
def
);
ret
=
_regmap_write
(
map
,
regs
[
i
].
reg
,
regs
[
i
].
def
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
return
ret
;
return
ret
;
if
(
regs
[
i
].
delay_us
)
udelay
(
regs
[
i
].
delay_us
);
}
}
return
0
;
return
0
;
}
}
...
@@ -1977,10 +1999,14 @@ static int _regmap_multi_reg_write(struct regmap *map,
...
@@ -1977,10 +1999,14 @@ static int _regmap_multi_reg_write(struct regmap *map,
for
(
i
=
0
;
i
<
num_regs
;
i
++
)
{
for
(
i
=
0
;
i
<
num_regs
;
i
++
)
{
unsigned
int
reg
=
regs
[
i
].
reg
;
unsigned
int
reg
=
regs
[
i
].
reg
;
struct
regmap_range_node
*
range
;
struct
regmap_range_node
*
range
;
/* Coalesce all the writes between a page break or a delay
* in a sequence
*/
range
=
_regmap_range_lookup
(
map
,
reg
);
range
=
_regmap_range_lookup
(
map
,
reg
);
if
(
range
)
{
if
(
range
||
regs
[
i
].
delay_us
)
{
size_t
len
=
sizeof
(
struct
reg_
default
)
*
num_regs
;
size_t
len
=
sizeof
(
struct
reg_
sequence
)
*
num_regs
;
struct
reg_
default
*
base
=
kmemdup
(
regs
,
len
,
struct
reg_
sequence
*
base
=
kmemdup
(
regs
,
len
,
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
base
)
if
(
!
base
)
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -2013,7 +2039,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
...
@@ -2013,7 +2039,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
* A value of zero will be returned on success, a negative errno will be
* A value of zero will be returned on success, a negative errno will be
* returned in error cases.
* returned in error cases.
*/
*/
int
regmap_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
int
regmap_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
)
int
num_regs
)
{
{
int
ret
;
int
ret
;
...
@@ -2046,7 +2072,7 @@ EXPORT_SYMBOL_GPL(regmap_multi_reg_write);
...
@@ -2046,7 +2072,7 @@ EXPORT_SYMBOL_GPL(regmap_multi_reg_write);
* be returned in error cases.
* be returned in error cases.
*/
*/
int
regmap_multi_reg_write_bypassed
(
struct
regmap
*
map
,
int
regmap_multi_reg_write_bypassed
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
)
int
num_regs
)
{
{
int
ret
;
int
ret
;
...
@@ -2726,10 +2752,10 @@ EXPORT_SYMBOL_GPL(regmap_async_complete);
...
@@ -2726,10 +2752,10 @@ EXPORT_SYMBOL_GPL(regmap_async_complete);
* The caller must ensure that this function cannot be called
* The caller must ensure that this function cannot be called
* concurrently with either itself or regcache_sync().
* concurrently with either itself or regcache_sync().
*/
*/
int
regmap_register_patch
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
int
regmap_register_patch
(
struct
regmap
*
map
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
)
int
num_regs
)
{
{
struct
reg_
default
*
p
;
struct
reg_
sequence
*
p
;
int
ret
;
int
ret
;
bool
bypass
;
bool
bypass
;
...
@@ -2738,7 +2764,7 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
...
@@ -2738,7 +2764,7 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
return
0
;
return
0
;
p
=
krealloc
(
map
->
patch
,
p
=
krealloc
(
map
->
patch
,
sizeof
(
struct
reg_
default
)
*
(
map
->
patch_regs
+
num_regs
),
sizeof
(
struct
reg_
sequence
)
*
(
map
->
patch_regs
+
num_regs
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
p
)
{
if
(
p
)
{
memcpy
(
p
+
map
->
patch_regs
,
regs
,
num_regs
*
sizeof
(
*
regs
));
memcpy
(
p
+
map
->
patch_regs
,
regs
,
num_regs
*
sizeof
(
*
regs
));
...
...
drivers/bus/vexpress-config.c
浏览文件 @
072502a6
...
@@ -107,7 +107,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
...
@@ -107,7 +107,7 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
if
(
!
res
)
if
(
!
res
)
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
regmap
=
bridge
->
ops
->
regmap_init
(
dev
,
bridge
->
context
);
regmap
=
(
bridge
->
ops
->
regmap_init
)
(
dev
,
bridge
->
context
);
if
(
IS_ERR
(
regmap
))
{
if
(
IS_ERR
(
regmap
))
{
devres_free
(
res
);
devres_free
(
res
);
return
regmap
;
return
regmap
;
...
...
drivers/gpu/drm/i2c/adv7511.c
浏览文件 @
072502a6
...
@@ -54,7 +54,7 @@ static struct adv7511 *encoder_to_adv7511(struct drm_encoder *encoder)
...
@@ -54,7 +54,7 @@ static struct adv7511 *encoder_to_adv7511(struct drm_encoder *encoder)
}
}
/* ADI recommended values for proper operation. */
/* ADI recommended values for proper operation. */
static
const
struct
reg_
default
adv7511_fixed_registers
[]
=
{
static
const
struct
reg_
sequence
adv7511_fixed_registers
[]
=
{
{
0x98
,
0x03
},
{
0x98
,
0x03
},
{
0x9a
,
0xe0
},
{
0x9a
,
0xe0
},
{
0x9c
,
0x30
},
{
0x9c
,
0x30
},
...
...
drivers/input/misc/drv260x.c
浏览文件 @
072502a6
...
@@ -313,14 +313,14 @@ static void drv260x_close(struct input_dev *input)
...
@@ -313,14 +313,14 @@ static void drv260x_close(struct input_dev *input)
gpiod_set_value
(
haptics
->
enable_gpio
,
0
);
gpiod_set_value
(
haptics
->
enable_gpio
,
0
);
}
}
static
const
struct
reg_
default
drv260x_lra_cal_regs
[]
=
{
static
const
struct
reg_
sequence
drv260x_lra_cal_regs
[]
=
{
{
DRV260X_MODE
,
DRV260X_AUTO_CAL
},
{
DRV260X_MODE
,
DRV260X_AUTO_CAL
},
{
DRV260X_CTRL3
,
DRV260X_NG_THRESH_2
},
{
DRV260X_CTRL3
,
DRV260X_NG_THRESH_2
},
{
DRV260X_FEEDBACK_CTRL
,
DRV260X_FB_REG_LRA_MODE
|
{
DRV260X_FEEDBACK_CTRL
,
DRV260X_FB_REG_LRA_MODE
|
DRV260X_BRAKE_FACTOR_4X
|
DRV260X_LOOP_GAIN_HIGH
},
DRV260X_BRAKE_FACTOR_4X
|
DRV260X_LOOP_GAIN_HIGH
},
};
};
static
const
struct
reg_
default
drv260x_lra_init_regs
[]
=
{
static
const
struct
reg_
sequence
drv260x_lra_init_regs
[]
=
{
{
DRV260X_MODE
,
DRV260X_RT_PLAYBACK
},
{
DRV260X_MODE
,
DRV260X_RT_PLAYBACK
},
{
DRV260X_A_TO_V_CTRL
,
DRV260X_AUDIO_HAPTICS_PEAK_20MS
|
{
DRV260X_A_TO_V_CTRL
,
DRV260X_AUDIO_HAPTICS_PEAK_20MS
|
DRV260X_AUDIO_HAPTICS_FILTER_125HZ
},
DRV260X_AUDIO_HAPTICS_FILTER_125HZ
},
...
@@ -337,7 +337,7 @@ static const struct reg_default drv260x_lra_init_regs[] = {
...
@@ -337,7 +337,7 @@ static const struct reg_default drv260x_lra_init_regs[] = {
{
DRV260X_CTRL4
,
DRV260X_AUTOCAL_TIME_500MS
},
{
DRV260X_CTRL4
,
DRV260X_AUTOCAL_TIME_500MS
},
};
};
static
const
struct
reg_
default
drv260x_erm_cal_regs
[]
=
{
static
const
struct
reg_
sequence
drv260x_erm_cal_regs
[]
=
{
{
DRV260X_MODE
,
DRV260X_AUTO_CAL
},
{
DRV260X_MODE
,
DRV260X_AUTO_CAL
},
{
DRV260X_A_TO_V_MIN_INPUT
,
DRV260X_AUDIO_HAPTICS_MIN_IN_VOLT
},
{
DRV260X_A_TO_V_MIN_INPUT
,
DRV260X_AUDIO_HAPTICS_MIN_IN_VOLT
},
{
DRV260X_A_TO_V_MAX_INPUT
,
DRV260X_AUDIO_HAPTICS_MAX_IN_VOLT
},
{
DRV260X_A_TO_V_MAX_INPUT
,
DRV260X_AUDIO_HAPTICS_MAX_IN_VOLT
},
...
...
drivers/input/misc/drv2665.c
浏览文件 @
072502a6
...
@@ -132,7 +132,7 @@ static void drv2665_close(struct input_dev *input)
...
@@ -132,7 +132,7 @@ static void drv2665_close(struct input_dev *input)
"Failed to enter standby mode: %d
\n
"
,
error
);
"Failed to enter standby mode: %d
\n
"
,
error
);
}
}
static
const
struct
reg_
default
drv2665_init_regs
[]
=
{
static
const
struct
reg_
sequence
drv2665_init_regs
[]
=
{
{
DRV2665_CTRL_2
,
0
|
DRV2665_10_MS_IDLE_TOUT
},
{
DRV2665_CTRL_2
,
0
|
DRV2665_10_MS_IDLE_TOUT
},
{
DRV2665_CTRL_1
,
DRV2665_25_VPP_GAIN
},
{
DRV2665_CTRL_1
,
DRV2665_25_VPP_GAIN
},
};
};
...
...
drivers/input/misc/drv2667.c
浏览文件 @
072502a6
...
@@ -262,14 +262,14 @@ static void drv2667_close(struct input_dev *input)
...
@@ -262,14 +262,14 @@ static void drv2667_close(struct input_dev *input)
"Failed to enter standby mode: %d
\n
"
,
error
);
"Failed to enter standby mode: %d
\n
"
,
error
);
}
}
static
const
struct
reg_
default
drv2667_init_regs
[]
=
{
static
const
struct
reg_
sequence
drv2667_init_regs
[]
=
{
{
DRV2667_CTRL_2
,
0
},
{
DRV2667_CTRL_2
,
0
},
{
DRV2667_CTRL_1
,
DRV2667_25_VPP_GAIN
},
{
DRV2667_CTRL_1
,
DRV2667_25_VPP_GAIN
},
{
DRV2667_WV_SEQ_0
,
1
},
{
DRV2667_WV_SEQ_0
,
1
},
{
DRV2667_WV_SEQ_1
,
0
}
{
DRV2667_WV_SEQ_1
,
0
}
};
};
static
const
struct
reg_
default
drv2667_page1_init
[]
=
{
static
const
struct
reg_
sequence
drv2667_page1_init
[]
=
{
{
DRV2667_RAM_HDR_SZ
,
0x05
},
{
DRV2667_RAM_HDR_SZ
,
0x05
},
{
DRV2667_RAM_START_HI
,
0x80
},
{
DRV2667_RAM_START_HI
,
0x80
},
{
DRV2667_RAM_START_LO
,
0x06
},
{
DRV2667_RAM_START_LO
,
0x06
},
...
...
drivers/mfd/arizona-core.c
浏览文件 @
072502a6
...
@@ -392,7 +392,7 @@ static int wm5102_apply_hardware_patch(struct arizona *arizona)
...
@@ -392,7 +392,7 @@ static int wm5102_apply_hardware_patch(struct arizona *arizona)
* Register patch to some of the CODECs internal write sequences
* Register patch to some of the CODECs internal write sequences
* to ensure a clean exit from the low power sleep state.
* to ensure a clean exit from the low power sleep state.
*/
*/
static
const
struct
reg_
default
wm5110_sleep_patch
[]
=
{
static
const
struct
reg_
sequence
wm5110_sleep_patch
[]
=
{
{
0x337A
,
0xC100
},
{
0x337A
,
0xC100
},
{
0x337B
,
0x0041
},
{
0x337B
,
0x0041
},
{
0x3300
,
0xA210
},
{
0x3300
,
0xA210
},
...
...
drivers/mfd/twl6040.c
浏览文件 @
072502a6
...
@@ -86,7 +86,7 @@ static const struct reg_default twl6040_defaults[] = {
...
@@ -86,7 +86,7 @@ static const struct reg_default twl6040_defaults[] = {
{
0x2E
,
0x00
},
/* REG_STATUS (ro) */
{
0x2E
,
0x00
},
/* REG_STATUS (ro) */
};
};
static
struct
reg_
default
twl6040_patch
[]
=
{
static
struct
reg_
sequence
twl6040_patch
[]
=
{
/*
/*
* Select I2C bus access to dual access registers
* Select I2C bus access to dual access registers
* Interrupt register is cleared on read
* Interrupt register is cleared on read
...
...
drivers/mfd/wm5102-tables.c
浏览文件 @
072502a6
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define WM5102_NUM_AOD_ISR 2
#define WM5102_NUM_AOD_ISR 2
#define WM5102_NUM_ISR 5
#define WM5102_NUM_ISR 5
static
const
struct
reg_
default
wm5102_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm5102_reva_patch
[]
=
{
{
0x80
,
0x0003
},
{
0x80
,
0x0003
},
{
0x221
,
0x0090
},
{
0x221
,
0x0090
},
{
0x211
,
0x0014
},
{
0x211
,
0x0014
},
...
@@ -57,7 +57,7 @@ static const struct reg_default wm5102_reva_patch[] = {
...
@@ -57,7 +57,7 @@ static const struct reg_default wm5102_reva_patch[] = {
{
0x80
,
0x0000
},
{
0x80
,
0x0000
},
};
};
static
const
struct
reg_
default
wm5102_revb_patch
[]
=
{
static
const
struct
reg_
sequence
wm5102_revb_patch
[]
=
{
{
0x19
,
0x0001
},
{
0x19
,
0x0001
},
{
0x80
,
0x0003
},
{
0x80
,
0x0003
},
{
0x081
,
0xE022
},
{
0x081
,
0xE022
},
...
@@ -80,7 +80,7 @@ static const struct reg_default wm5102_revb_patch[] = {
...
@@ -80,7 +80,7 @@ static const struct reg_default wm5102_revb_patch[] = {
/* We use a function so we can use ARRAY_SIZE() */
/* We use a function so we can use ARRAY_SIZE() */
int
wm5102_patch
(
struct
arizona
*
arizona
)
int
wm5102_patch
(
struct
arizona
*
arizona
)
{
{
const
struct
reg_
default
*
wm5102_patch
;
const
struct
reg_
sequence
*
wm5102_patch
;
int
patch_size
;
int
patch_size
;
switch
(
arizona
->
rev
)
{
switch
(
arizona
->
rev
)
{
...
...
drivers/mfd/wm5110-tables.c
浏览文件 @
072502a6
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define WM5110_NUM_AOD_ISR 2
#define WM5110_NUM_AOD_ISR 2
#define WM5110_NUM_ISR 5
#define WM5110_NUM_ISR 5
static
const
struct
reg_
default
wm5110_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm5110_reva_patch
[]
=
{
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
0x44
,
0x20
},
{
0x44
,
0x20
},
{
0x45
,
0x40
},
{
0x45
,
0x40
},
...
@@ -134,7 +134,7 @@ static const struct reg_default wm5110_reva_patch[] = {
...
@@ -134,7 +134,7 @@ static const struct reg_default wm5110_reva_patch[] = {
{
0x209
,
0x002A
},
{
0x209
,
0x002A
},
};
};
static
const
struct
reg_
default
wm5110_revb_patch
[]
=
{
static
const
struct
reg_
sequence
wm5110_revb_patch
[]
=
{
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
0x36e
,
0x0210
},
{
0x36e
,
0x0210
},
{
0x370
,
0x0210
},
{
0x370
,
0x0210
},
...
@@ -224,7 +224,7 @@ static const struct reg_default wm5110_revb_patch[] = {
...
@@ -224,7 +224,7 @@ static const struct reg_default wm5110_revb_patch[] = {
{
0x80
,
0x0
},
{
0x80
,
0x0
},
};
};
static
const
struct
reg_
default
wm5110_revd_patch
[]
=
{
static
const
struct
reg_
sequence
wm5110_revd_patch
[]
=
{
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
0x393
,
0x27
},
{
0x393
,
0x27
},
...
...
drivers/mfd/wm8994-core.c
浏览文件 @
072502a6
...
@@ -243,21 +243,21 @@ static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
...
@@ -243,21 +243,21 @@ static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
}
}
#endif
#endif
static
const
struct
reg_
default
wm8994_revc_patch
[]
=
{
static
const
struct
reg_
sequence
wm8994_revc_patch
[]
=
{
{
0x102
,
0x3
},
{
0x102
,
0x3
},
{
0x56
,
0x3
},
{
0x56
,
0x3
},
{
0x817
,
0x0
},
{
0x817
,
0x0
},
{
0x102
,
0x0
},
{
0x102
,
0x0
},
};
};
static
const
struct
reg_
default
wm8958_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm8958_reva_patch
[]
=
{
{
0x102
,
0x3
},
{
0x102
,
0x3
},
{
0xcb
,
0x81
},
{
0xcb
,
0x81
},
{
0x817
,
0x0
},
{
0x817
,
0x0
},
{
0x102
,
0x0
},
{
0x102
,
0x0
},
};
};
static
const
struct
reg_
default
wm1811_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm1811_reva_patch
[]
=
{
{
0x102
,
0x3
},
{
0x102
,
0x3
},
{
0x56
,
0xc07
},
{
0x56
,
0xc07
},
{
0x5d
,
0x7e
},
{
0x5d
,
0x7e
},
...
@@ -326,7 +326,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
...
@@ -326,7 +326,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
{
{
struct
wm8994_pdata
*
pdata
;
struct
wm8994_pdata
*
pdata
;
struct
regmap_config
*
regmap_config
;
struct
regmap_config
*
regmap_config
;
const
struct
reg_
default
*
regmap_patch
=
NULL
;
const
struct
reg_
sequence
*
regmap_patch
=
NULL
;
const
char
*
devname
;
const
char
*
devname
;
int
ret
,
i
,
patch_regs
=
0
;
int
ret
,
i
,
patch_regs
=
0
;
int
pulls
=
0
;
int
pulls
=
0
;
...
...
drivers/mfd/wm8997-tables.c
浏览文件 @
072502a6
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include "arizona.h"
#include "arizona.h"
static
const
struct
reg_
default
wm8997_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm8997_reva_patch
[]
=
{
{
0x80
,
0x0003
},
{
0x80
,
0x0003
},
{
0x214
,
0x0008
},
{
0x214
,
0x0008
},
{
0x458
,
0x0000
},
{
0x458
,
0x0000
},
...
...
drivers/thermal/st/st_thermal.c
浏览文件 @
072502a6
...
@@ -214,7 +214,7 @@ int st_thermal_register(struct platform_device *pdev,
...
@@ -214,7 +214,7 @@ int st_thermal_register(struct platform_device *pdev,
sensor
->
ops
=
sensor
->
cdata
->
ops
;
sensor
->
ops
=
sensor
->
cdata
->
ops
;
ret
=
sensor
->
ops
->
regmap_init
(
sensor
);
ret
=
(
sensor
->
ops
->
regmap_init
)
(
sensor
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
include/linux/regmap.h
浏览文件 @
072502a6
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <linux/rbtree.h>
#include <linux/rbtree.h>
#include <linux/err.h>
#include <linux/err.h>
#include <linux/bug.h>
#include <linux/bug.h>
#include <linux/lockdep.h>
struct
module
;
struct
module
;
struct
device
;
struct
device
;
...
@@ -50,6 +51,20 @@ struct reg_default {
...
@@ -50,6 +51,20 @@ struct reg_default {
unsigned
int
def
;
unsigned
int
def
;
};
};
/**
* Register/value pairs for sequences of writes with an optional delay in
* microseconds to be applied after each write.
*
* @reg: Register address.
* @def: Register value.
* @delay_us: Delay to be applied after the register write in microseconds
*/
struct
reg_sequence
{
unsigned
int
reg
;
unsigned
int
def
;
unsigned
int
delay_us
;
};
#ifdef CONFIG_REGMAP
#ifdef CONFIG_REGMAP
enum
regmap_endian
{
enum
regmap_endian
{
...
@@ -331,45 +346,182 @@ struct regmap_bus {
...
@@ -331,45 +346,182 @@ struct regmap_bus {
size_t
max_raw_write
;
size_t
max_raw_write
;
};
};
struct
regmap
*
regmap_init
(
struct
device
*
dev
,
/*
const
struct
regmap_bus
*
bus
,
* __regmap_init functions.
void
*
bus_context
,
*
const
struct
regmap_config
*
config
);
* These functions take a lock key and name parameter, and should not be called
* directly. Instead, use the regmap_init macros that generate a key and name
* for each call.
*/
struct
regmap
*
__regmap_init
(
struct
device
*
dev
,
const
struct
regmap_bus
*
bus
,
void
*
bus_context
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_spmi_base
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_spmi_ext
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init
(
struct
device
*
dev
,
const
struct
regmap_bus
*
bus
,
void
*
bus_context
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_spmi_base
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_spmi_ext
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
/*
* Wrapper for regmap_init macros to include a unique lockdep key and name
* for each call. No-op if CONFIG_LOCKDEP is not set.
*
* @fn: Real function to call (in the form __[*_]regmap_init[_*])
* @name: Config variable name (#config in the calling macro)
**/
#ifdef CONFIG_LOCKDEP
#define __regmap_lockdep_wrapper(fn, name, ...) \
( \
({ \
static struct lock_class_key _key; \
fn(__VA_ARGS__, &_key, \
KBUILD_BASENAME ":" \
__stringify(__LINE__) ":" \
"(" name ")->lock"); \
}) \
)
#else
#define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL)
#endif
/**
* regmap_init(): Initialise register map
*
* @dev: Device that will be interacted with
* @bus: Bus-specific callbacks to use with device
* @bus_context: Data passed to bus-specific callbacks
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap. This function should generally not be called
* directly, it should be called by bus-specific init functions.
*/
#define regmap_init(dev, bus, bus_context, config) \
__regmap_lockdep_wrapper(__regmap_init, #config, \
dev, bus, bus_context, config)
int
regmap_attach_dev
(
struct
device
*
dev
,
struct
regmap
*
map
,
int
regmap_attach_dev
(
struct
device
*
dev
,
struct
regmap
*
map
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_spmi_base
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_spmi_ext
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init
(
struct
device
*
dev
,
const
struct
regmap_bus
*
bus
,
void
*
bus_context
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_i2c
(
struct
i2c_client
*
i2c
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_spmi_base
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_spmi_ext
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_ac97
(
struct
snd_ac97
*
ac97
,
const
struct
regmap_config
*
config
);
bool
regmap_ac97_default_volatile
(
struct
device
*
dev
,
unsigned
int
reg
);
/**
* regmap_init_i2c(): Initialise register map
*
* @i2c: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_i2c(i2c, config) \
__regmap_lockdep_wrapper(__regmap_init_i2c, #config, \
i2c, config)
/**
* regmap_init_spi(): Initialise register map
*
* @spi: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_spi(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spi, #config, \
dev, config)
/**
* regmap_init_spmi_base(): Create regmap for the Base register space
* @sdev: SPMI device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_spmi_base(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \
dev, config)
/**
* regmap_init_spmi_ext(): Create regmap for Ext register space
* @sdev: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_spmi_ext(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \
dev, config)
/**
* regmap_init_mmio_clk(): Initialise register map with register clock
*
* @dev: Device that will be interacted with
* @clk_id: register clock consumer ID
* @regs: Pointer to memory-mapped IO region
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_mmio_clk(dev, clk_id, regs, config) \
__regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \
dev, clk_id, regs, config)
/**
/**
* regmap_init_mmio(): Initialise register map
* regmap_init_mmio(): Initialise register map
...
@@ -381,12 +533,109 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
...
@@ -381,12 +533,109 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
* The return value will be an ERR_PTR() on error or a valid pointer to
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
* a struct regmap.
*/
*/
static
inline
struct
regmap
*
regmap_init_mmio
(
struct
device
*
dev
,
#define regmap_init_mmio(dev, regs, config) \
void
__iomem
*
regs
,
regmap_init_mmio_clk(dev, NULL, regs, config)
const
struct
regmap_config
*
config
)
{
/**
return
regmap_init_mmio_clk
(
dev
,
NULL
,
regs
,
config
);
* regmap_init_ac97(): Initialise AC'97 register map
}
*
* @ac97: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_ac97(ac97, config) \
__regmap_lockdep_wrapper(__regmap_init_ac97, #config, \
ac97, config)
bool
regmap_ac97_default_volatile
(
struct
device
*
dev
,
unsigned
int
reg
);
/**
* devm_regmap_init(): Initialise managed register map
*
* @dev: Device that will be interacted with
* @bus: Bus-specific callbacks to use with device
* @bus_context: Data passed to bus-specific callbacks
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. This function should generally not be called
* directly, it should be called by bus-specific init functions. The
* map will be automatically freed by the device management code.
*/
#define devm_regmap_init(dev, bus, bus_context, config) \
__regmap_lockdep_wrapper(__devm_regmap_init, #config, \
dev, bus, bus_context, config)
/**
* devm_regmap_init_i2c(): Initialise managed register map
*
* @i2c: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_i2c(i2c, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \
i2c, config)
/**
* devm_regmap_init_spi(): Initialise register map
*
* @spi: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The map will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spi(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \
dev, config)
/**
* devm_regmap_init_spmi_base(): Create managed regmap for Base register space
* @sdev: SPMI device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spmi_base(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \
dev, config)
/**
* devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space
* @sdev: SPMI device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spmi_ext(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \
dev, config)
/**
* devm_regmap_init_mmio_clk(): Initialise managed register map with clock
*
* @dev: Device that will be interacted with
* @clk_id: register clock consumer ID
* @regs: Pointer to memory-mapped IO region
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \
dev, clk_id, regs, config)
/**
/**
* devm_regmap_init_mmio(): Initialise managed register map
* devm_regmap_init_mmio(): Initialise managed register map
...
@@ -399,12 +648,22 @@ static inline struct regmap *regmap_init_mmio(struct device *dev,
...
@@ -399,12 +648,22 @@ static inline struct regmap *regmap_init_mmio(struct device *dev,
* to a struct regmap. The regmap will be automatically freed by the
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
* device management code.
*/
*/
static
inline
struct
regmap
*
devm_regmap_init_mmio
(
struct
device
*
dev
,
#define devm_regmap_init_mmio(dev, regs, config) \
void
__iomem
*
regs
,
devm_regmap_init_mmio_clk(dev, NULL, regs, config)
const
struct
regmap_config
*
config
)
{
/**
return
devm_regmap_init_mmio_clk
(
dev
,
NULL
,
regs
,
config
);
* devm_regmap_init_ac97(): Initialise AC'97 register map
}
*
* @ac97: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_ac97(ac97, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
ac97, config)
void
regmap_exit
(
struct
regmap
*
map
);
void
regmap_exit
(
struct
regmap
*
map
);
int
regmap_reinit_cache
(
struct
regmap
*
map
,
int
regmap_reinit_cache
(
struct
regmap
*
map
,
...
@@ -417,10 +676,10 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
...
@@ -417,10 +676,10 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
const
void
*
val
,
size_t
val_len
);
const
void
*
val
,
size_t
val_len
);
int
regmap_bulk_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
int
regmap_bulk_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
size_t
val_count
);
size_t
val_count
);
int
regmap_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
int
regmap_multi_reg_write
(
struct
regmap
*
map
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
);
int
num_regs
);
int
regmap_multi_reg_write_bypassed
(
struct
regmap
*
map
,
int
regmap_multi_reg_write_bypassed
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
);
int
num_regs
);
int
regmap_raw_write_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
int
regmap_raw_write_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
size_t
val_len
);
const
void
*
val
,
size_t
val_len
);
...
@@ -461,7 +720,7 @@ void regcache_mark_dirty(struct regmap *map);
...
@@ -461,7 +720,7 @@ void regcache_mark_dirty(struct regmap *map);
bool
regmap_check_range_table
(
struct
regmap
*
map
,
unsigned
int
reg
,
bool
regmap_check_range_table
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
struct
regmap_access_table
*
table
);
const
struct
regmap_access_table
*
table
);
int
regmap_register_patch
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
int
regmap_register_patch
(
struct
regmap
*
map
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
);
int
num_regs
);
int
regmap_parse_val
(
struct
regmap
*
map
,
const
void
*
buf
,
int
regmap_parse_val
(
struct
regmap
*
map
,
const
void
*
buf
,
unsigned
int
*
val
);
unsigned
int
*
val
);
...
...
sound/soc/codecs/arizona.c
浏览文件 @
072502a6
...
@@ -1366,7 +1366,7 @@ static void arizona_wm5102_set_dac_comp(struct snd_soc_codec *codec,
...
@@ -1366,7 +1366,7 @@ static void arizona_wm5102_set_dac_comp(struct snd_soc_codec *codec,
{
{
struct
arizona_priv
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
struct
arizona_priv
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
struct
arizona
*
arizona
=
priv
->
arizona
;
struct
arizona
*
arizona
=
priv
->
arizona
;
struct
reg_
default
dac_comp
[]
=
{
struct
reg_
sequence
dac_comp
[]
=
{
{
0x80
,
0x3
},
{
0x80
,
0x3
},
{
ARIZONA_DAC_COMP_1
,
0
},
{
ARIZONA_DAC_COMP_1
,
0
},
{
ARIZONA_DAC_COMP_2
,
0
},
{
ARIZONA_DAC_COMP_2
,
0
},
...
...
sound/soc/codecs/cs35l32.c
浏览文件 @
072502a6
...
@@ -276,7 +276,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_cs35l32 = {
...
@@ -276,7 +276,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_cs35l32 = {
};
};
/* Current and threshold powerup sequence Pg37 in datasheet */
/* Current and threshold powerup sequence Pg37 in datasheet */
static
const
struct
reg_
default
cs35l32_monitor_patch
[]
=
{
static
const
struct
reg_
sequence
cs35l32_monitor_patch
[]
=
{
{
0x00
,
0x99
},
{
0x00
,
0x99
},
{
0x48
,
0x17
},
{
0x48
,
0x17
},
...
...
sound/soc/codecs/cs42l52.c
浏览文件 @
072502a6
...
@@ -1118,7 +1118,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_cs42l52 = {
...
@@ -1118,7 +1118,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_cs42l52 = {
};
};
/* Current and threshold powerup sequence Pg37 */
/* Current and threshold powerup sequence Pg37 */
static
const
struct
reg_
default
cs42l52_threshold_patch
[]
=
{
static
const
struct
reg_
sequence
cs42l52_threshold_patch
[]
=
{
{
0x00
,
0x99
},
{
0x00
,
0x99
},
{
0x3E
,
0xBA
},
{
0x3E
,
0xBA
},
...
...
sound/soc/codecs/da7210.c
浏览文件 @
072502a6
...
@@ -1182,7 +1182,7 @@ static struct snd_soc_codec_driver soc_codec_dev_da7210 = {
...
@@ -1182,7 +1182,7 @@ static struct snd_soc_codec_driver soc_codec_dev_da7210 = {
#if IS_ENABLED(CONFIG_I2C)
#if IS_ENABLED(CONFIG_I2C)
static
struct
reg_
default
da7210_regmap_i2c_patch
[]
=
{
static
struct
reg_
sequence
da7210_regmap_i2c_patch
[]
=
{
/* System controller master disable */
/* System controller master disable */
{
DA7210_STARTUP1
,
0x00
},
{
DA7210_STARTUP1
,
0x00
},
...
@@ -1269,7 +1269,7 @@ static struct i2c_driver da7210_i2c_driver = {
...
@@ -1269,7 +1269,7 @@ static struct i2c_driver da7210_i2c_driver = {
#if defined(CONFIG_SPI_MASTER)
#if defined(CONFIG_SPI_MASTER)
static
struct
reg_
default
da7210_regmap_spi_patch
[]
=
{
static
struct
reg_
sequence
da7210_regmap_spi_patch
[]
=
{
/* Dummy read to give two pulses over nCS for SPI */
/* Dummy read to give two pulses over nCS for SPI */
{
DA7210_AUX2
,
0x00
},
{
DA7210_AUX2
,
0x00
},
{
DA7210_AUX2
,
0x00
},
{
DA7210_AUX2
,
0x00
},
...
...
sound/soc/codecs/rt5640.c
浏览文件 @
072502a6
...
@@ -51,7 +51,7 @@ static const struct regmap_range_cfg rt5640_ranges[] = {
...
@@ -51,7 +51,7 @@ static const struct regmap_range_cfg rt5640_ranges[] = {
.
window_len
=
0x1
,
},
.
window_len
=
0x1
,
},
};
};
static
const
struct
reg_
default
init_list
[]
=
{
static
const
struct
reg_
sequence
init_list
[]
=
{
{
RT5640_PR_BASE
+
0x3d
,
0x3600
},
{
RT5640_PR_BASE
+
0x3d
,
0x3600
},
{
RT5640_PR_BASE
+
0x12
,
0x0aa8
},
{
RT5640_PR_BASE
+
0x12
,
0x0aa8
},
{
RT5640_PR_BASE
+
0x14
,
0x0aaa
},
{
RT5640_PR_BASE
+
0x14
,
0x0aaa
},
...
...
sound/soc/codecs/rt5645.c
浏览文件 @
072502a6
...
@@ -54,7 +54,7 @@ static const struct regmap_range_cfg rt5645_ranges[] = {
...
@@ -54,7 +54,7 @@ static const struct regmap_range_cfg rt5645_ranges[] = {
},
},
};
};
static
const
struct
reg_
default
init_list
[]
=
{
static
const
struct
reg_
sequence
init_list
[]
=
{
{
RT5645_PR_BASE
+
0x3d
,
0x3600
},
{
RT5645_PR_BASE
+
0x3d
,
0x3600
},
{
RT5645_PR_BASE
+
0x1c
,
0xfd20
},
{
RT5645_PR_BASE
+
0x1c
,
0xfd20
},
{
RT5645_PR_BASE
+
0x20
,
0x611f
},
{
RT5645_PR_BASE
+
0x20
,
0x611f
},
...
@@ -63,7 +63,7 @@ static const struct reg_default init_list[] = {
...
@@ -63,7 +63,7 @@ static const struct reg_default init_list[] = {
};
};
#define RT5645_INIT_REG_LEN ARRAY_SIZE(init_list)
#define RT5645_INIT_REG_LEN ARRAY_SIZE(init_list)
static
const
struct
reg_
default
rt5650_init_list
[]
=
{
static
const
struct
reg_
sequence
rt5650_init_list
[]
=
{
{
0xf6
,
0x0100
},
{
0xf6
,
0x0100
},
};
};
...
...
sound/soc/codecs/rt5651.c
浏览文件 @
072502a6
...
@@ -46,7 +46,7 @@ static const struct regmap_range_cfg rt5651_ranges[] = {
...
@@ -46,7 +46,7 @@ static const struct regmap_range_cfg rt5651_ranges[] = {
.
window_len
=
0x1
,
},
.
window_len
=
0x1
,
},
};
};
static
struct
reg_
default
init_list
[]
=
{
static
struct
reg_
sequence
init_list
[]
=
{
{
RT5651_PR_BASE
+
0x3d
,
0x3e00
},
{
RT5651_PR_BASE
+
0x3d
,
0x3e00
},
};
};
...
...
sound/soc/codecs/rt5670.c
浏览文件 @
072502a6
...
@@ -51,7 +51,7 @@ static const struct regmap_range_cfg rt5670_ranges[] = {
...
@@ -51,7 +51,7 @@ static const struct regmap_range_cfg rt5670_ranges[] = {
.
window_len
=
0x1
,
},
.
window_len
=
0x1
,
},
};
};
static
const
struct
reg_
default
init_list
[]
=
{
static
const
struct
reg_
sequence
init_list
[]
=
{
{
RT5670_PR_BASE
+
0x14
,
0x9a8a
},
{
RT5670_PR_BASE
+
0x14
,
0x9a8a
},
{
RT5670_PR_BASE
+
0x38
,
0x3ba1
},
{
RT5670_PR_BASE
+
0x38
,
0x3ba1
},
{
RT5670_PR_BASE
+
0x3d
,
0x3640
},
{
RT5670_PR_BASE
+
0x3d
,
0x3640
},
...
...
sound/soc/codecs/rt5677.c
浏览文件 @
072502a6
...
@@ -54,7 +54,7 @@ static const struct regmap_range_cfg rt5677_ranges[] = {
...
@@ -54,7 +54,7 @@ static const struct regmap_range_cfg rt5677_ranges[] = {
},
},
};
};
static
const
struct
reg_
default
init_list
[]
=
{
static
const
struct
reg_
sequence
init_list
[]
=
{
{
RT5677_ASRC_12
,
0x0018
},
{
RT5677_ASRC_12
,
0x0018
},
{
RT5677_PR_BASE
+
0x3d
,
0x364d
},
{
RT5677_PR_BASE
+
0x3d
,
0x364d
},
{
RT5677_PR_BASE
+
0x17
,
0x4fc0
},
{
RT5677_PR_BASE
+
0x17
,
0x4fc0
},
...
...
sound/soc/codecs/tlv320aic3x.c
浏览文件 @
072502a6
...
@@ -1668,7 +1668,7 @@ static const struct i2c_device_id aic3x_i2c_id[] = {
...
@@ -1668,7 +1668,7 @@ static const struct i2c_device_id aic3x_i2c_id[] = {
};
};
MODULE_DEVICE_TABLE
(
i2c
,
aic3x_i2c_id
);
MODULE_DEVICE_TABLE
(
i2c
,
aic3x_i2c_id
);
static
const
struct
reg_
default
aic3007_class_d
[]
=
{
static
const
struct
reg_
sequence
aic3007_class_d
[]
=
{
/* Class-D speaker driver init; datasheet p. 46 */
/* Class-D speaker driver init; datasheet p. 46 */
{
AIC3X_PAGE_SELECT
,
0x0D
},
{
AIC3X_PAGE_SELECT
,
0x0D
},
{
0xD
,
0x0D
},
{
0xD
,
0x0D
},
...
...
sound/soc/codecs/wm2200.c
浏览文件 @
072502a6
...
@@ -897,7 +897,7 @@ static bool wm2200_readable_register(struct device *dev, unsigned int reg)
...
@@ -897,7 +897,7 @@ static bool wm2200_readable_register(struct device *dev, unsigned int reg)
}
}
}
}
static
const
struct
reg_
default
wm2200_reva_patch
[]
=
{
static
const
struct
reg_
sequence
wm2200_reva_patch
[]
=
{
{
0x07
,
0x0003
},
{
0x07
,
0x0003
},
{
0x102
,
0x0200
},
{
0x102
,
0x0200
},
{
0x203
,
0x0084
},
{
0x203
,
0x0084
},
...
...
sound/soc/codecs/wm5100.c
浏览文件 @
072502a6
...
@@ -1247,7 +1247,7 @@ static const struct snd_soc_dapm_route wm5100_dapm_routes[] = {
...
@@ -1247,7 +1247,7 @@ static const struct snd_soc_dapm_route wm5100_dapm_routes[] = {
{
"PWM2"
,
NULL
,
"PWM2 Driver"
},
{
"PWM2"
,
NULL
,
"PWM2 Driver"
},
};
};
static
const
struct
reg_
default
wm5100_reva_patches
[]
=
{
static
const
struct
reg_
sequence
wm5100_reva_patches
[]
=
{
{
WM5100_AUDIO_IF_1_10
,
0
},
{
WM5100_AUDIO_IF_1_10
,
0
},
{
WM5100_AUDIO_IF_1_11
,
1
},
{
WM5100_AUDIO_IF_1_11
,
1
},
{
WM5100_AUDIO_IF_1_12
,
2
},
{
WM5100_AUDIO_IF_1_12
,
2
},
...
...
sound/soc/codecs/wm8962.c
浏览文件 @
072502a6
...
@@ -3495,7 +3495,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8962 = {
...
@@ -3495,7 +3495,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8962 = {
};
};
/* Improve power consumption for IN4 DC measurement mode */
/* Improve power consumption for IN4 DC measurement mode */
static
const
struct
reg_
default
wm8962_dc_measure
[]
=
{
static
const
struct
reg_
sequence
wm8962_dc_measure
[]
=
{
{
0xfd
,
0x1
},
{
0xfd
,
0x1
},
{
0xcc
,
0x40
},
{
0xcc
,
0x40
},
{
0xfd
,
0
},
{
0xfd
,
0
},
...
...
sound/soc/codecs/wm8993.c
浏览文件 @
072502a6
...
@@ -1595,7 +1595,7 @@ static int wm8993_resume(struct snd_soc_codec *codec)
...
@@ -1595,7 +1595,7 @@ static int wm8993_resume(struct snd_soc_codec *codec)
#endif
#endif
/* Tune DC servo configuration */
/* Tune DC servo configuration */
static
struct
reg_
default
wm8993_regmap_patch
[]
=
{
static
struct
reg_
sequence
wm8993_regmap_patch
[]
=
{
{
0x44
,
3
},
{
0x44
,
3
},
{
0x56
,
3
},
{
0x56
,
3
},
{
0x44
,
0
},
{
0x44
,
0
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录