Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
84651e81
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看板
提交
84651e81
编写于
6月 20, 2020
作者:
L
Linus Walleij
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'ib-for-each-requested' into devel
上级
925ca369
5bae1f08
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
23 deletion
+24
-23
arch/arm/plat-orion/gpio.c
arch/arm/plat-orion/gpio.c
+2
-6
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-mvebu.c
+2
-6
drivers/gpio/gpio-xra1403.c
drivers/gpio/gpio-xra1403.c
+2
-6
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/pinctrl-at91.c
+2
-5
include/linux/gpio/driver.h
include/linux/gpio/driver.h
+16
-0
未找到文件。
arch/arm/plat-orion/gpio.c
浏览文件 @
84651e81
...
...
@@ -442,6 +442,7 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
struct
orion_gpio_chip
*
ochip
=
gpiochip_get_data
(
chip
);
u32
out
,
io_conf
,
blink
,
in_pol
,
data_in
,
cause
,
edg_msk
,
lvl_msk
;
const
char
*
label
;
int
i
;
out
=
readl_relaxed
(
GPIO_OUT
(
ochip
));
...
...
@@ -453,15 +454,10 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
edg_msk
=
readl_relaxed
(
GPIO_EDGE_MASK
(
ochip
));
lvl_msk
=
readl_relaxed
(
GPIO_LEVEL_MASK
(
ochip
));
for
(
i
=
0
;
i
<
chip
->
ngpio
;
i
++
)
{
const
char
*
label
;
for_each_requested_gpio
(
chip
,
i
,
label
)
{
u32
msk
;
bool
is_out
;
label
=
gpiochip_is_requested
(
chip
,
i
);
if
(
!
label
)
continue
;
msk
=
1
<<
i
;
is_out
=
!
(
io_conf
&
msk
);
...
...
drivers/gpio/gpio-mvebu.c
浏览文件 @
84651e81
...
...
@@ -846,6 +846,7 @@ static void mvebu_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{
struct
mvebu_gpio_chip
*
mvchip
=
gpiochip_get_data
(
chip
);
u32
out
,
io_conf
,
blink
,
in_pol
,
data_in
,
cause
,
edg_msk
,
lvl_msk
;
const
char
*
label
;
int
i
;
regmap_read
(
mvchip
->
regs
,
GPIO_OUT_OFF
+
mvchip
->
offset
,
&
out
);
...
...
@@ -857,15 +858,10 @@ static void mvebu_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
edg_msk
=
mvebu_gpio_read_edge_mask
(
mvchip
);
lvl_msk
=
mvebu_gpio_read_level_mask
(
mvchip
);
for
(
i
=
0
;
i
<
chip
->
ngpio
;
i
++
)
{
const
char
*
label
;
for_each_requested_gpio
(
chip
,
i
,
label
)
{
u32
msk
;
bool
is_out
;
label
=
gpiochip_is_requested
(
chip
,
i
);
if
(
!
label
)
continue
;
msk
=
BIT
(
i
);
is_out
=
!
(
io_conf
&
msk
);
...
...
drivers/gpio/gpio-xra1403.c
浏览文件 @
84651e81
...
...
@@ -121,6 +121,7 @@ static void xra1403_dbg_show(struct seq_file *s, struct gpio_chip *chip)
struct
xra1403
*
xra
=
gpiochip_get_data
(
chip
);
int
value
[
XRA_LAST
];
int
i
;
const
char
*
label
;
unsigned
int
gcr
;
unsigned
int
gsr
;
...
...
@@ -136,12 +137,7 @@ static void xra1403_dbg_show(struct seq_file *s, struct gpio_chip *chip)
gcr
=
value
[
XRA_GCR
+
1
]
<<
8
|
value
[
XRA_GCR
];
gsr
=
value
[
XRA_GSR
+
1
]
<<
8
|
value
[
XRA_GSR
];
for
(
i
=
0
;
i
<
chip
->
ngpio
;
i
++
)
{
const
char
*
label
=
gpiochip_is_requested
(
chip
,
i
);
if
(
!
label
)
continue
;
for_each_requested_gpio
(
chip
,
i
,
label
)
{
seq_printf
(
s
,
" gpio-%-3d (%-12s) %s %s
\n
"
,
chip
->
base
+
i
,
label
,
(
gcr
&
BIT
(
i
))
?
"in"
:
"out"
,
...
...
drivers/pinctrl/pinctrl-at91.c
浏览文件 @
84651e81
...
...
@@ -1486,14 +1486,11 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
int
i
;
struct
at91_gpio_chip
*
at91_gpio
=
gpiochip_get_data
(
chip
);
void
__iomem
*
pio
=
at91_gpio
->
regbase
;
const
char
*
gpio_label
;
for
(
i
=
0
;
i
<
chip
->
ngpio
;
i
++
)
{
for
_each_requested_gpio
(
chip
,
i
,
gpio_label
)
{
unsigned
mask
=
pin_to_mask
(
i
);
const
char
*
gpio_label
;
gpio_label
=
gpiochip_is_requested
(
chip
,
i
);
if
(
!
gpio_label
)
continue
;
mode
=
at91_gpio
->
ops
->
get_periph
(
pio
,
mask
);
seq_printf
(
s
,
"[%s] GPIO%s%d: "
,
gpio_label
,
chip
->
label
,
i
);
...
...
include/linux/gpio/driver.h
浏览文件 @
84651e81
...
...
@@ -474,6 +474,22 @@ struct gpio_chip {
extern
const
char
*
gpiochip_is_requested
(
struct
gpio_chip
*
gc
,
unsigned
int
offset
);
/**
* for_each_requested_gpio_in_range - iterates over requested GPIOs in a given range
* @chip: the chip to query
* @i: loop variable
* @base: first GPIO in the range
* @size: amount of GPIOs to check starting from @base
* @label: label of current GPIO
*/
#define for_each_requested_gpio_in_range(chip, i, base, size, label) \
for (i = 0; i < size; i++) \
if ((label = gpiochip_is_requested(chip, base + i)) == NULL) {} else
/* Iterates over all requested GPIO of the given @chip */
#define for_each_requested_gpio(chip, i, label) \
for_each_requested_gpio_in_range(chip, i, 0, chip->ngpio, label)
/* add/remove chips */
extern
int
gpiochip_add_data_with_key
(
struct
gpio_chip
*
gc
,
void
*
data
,
struct
lock_class_key
*
lock_key
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录