Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
652f3196
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看板
提交
652f3196
编写于
2月 10, 2017
作者:
T
Thierry Reding
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.11/core' into for-next
上级
0c744ea4
b526a314
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
55 addition
and
80 deletion
+55
-80
drivers/leds/leds-pwm.c
drivers/leds/leds-pwm.c
+3
-13
drivers/pwm/core.c
drivers/pwm/core.c
+36
-34
drivers/pwm/pwm-atmel-hlcdc.c
drivers/pwm/pwm-atmel-hlcdc.c
+0
-1
drivers/pwm/pwm-atmel.c
drivers/pwm/pwm-atmel.c
+0
-1
drivers/pwm/pwm-bcm-kona.c
drivers/pwm/pwm-bcm-kona.c
+0
-1
drivers/pwm/pwm-berlin.c
drivers/pwm/pwm-berlin.c
+0
-1
drivers/pwm/pwm-brcmstb.c
drivers/pwm/pwm-brcmstb.c
+0
-1
drivers/pwm/pwm-fsl-ftm.c
drivers/pwm/pwm-fsl-ftm.c
+0
-1
drivers/pwm/pwm-imx.c
drivers/pwm/pwm-imx.c
+0
-1
drivers/pwm/pwm-lp3943.c
drivers/pwm/pwm-lp3943.c
+0
-1
drivers/pwm/pwm-mxs.c
drivers/pwm/pwm-mxs.c
+1
-1
drivers/pwm/pwm-pca9685.c
drivers/pwm/pwm-pca9685.c
+0
-1
drivers/pwm/pwm-sti.c
drivers/pwm/pwm-sti.c
+0
-1
drivers/pwm/pwm-sun4i.c
drivers/pwm/pwm-sun4i.c
+0
-1
drivers/pwm/pwm-twl-led.c
drivers/pwm/pwm-twl-led.c
+0
-1
drivers/pwm/pwm-twl.c
drivers/pwm/pwm-twl.c
+0
-1
drivers/staging/greybus/pwm.c
drivers/staging/greybus/pwm.c
+0
-1
include/linux/pwm.h
include/linux/pwm.h
+15
-18
未找到文件。
drivers/leds/leds-pwm.c
浏览文件 @
652f3196
...
@@ -29,7 +29,6 @@ struct led_pwm_data {
...
@@ -29,7 +29,6 @@ struct led_pwm_data {
unsigned
int
active_low
;
unsigned
int
active_low
;
unsigned
int
period
;
unsigned
int
period
;
int
duty
;
int
duty
;
bool
can_sleep
;
};
};
struct
led_pwm_priv
{
struct
led_pwm_priv
{
...
@@ -49,7 +48,7 @@ static void __led_pwm_set(struct led_pwm_data *led_dat)
...
@@ -49,7 +48,7 @@ static void __led_pwm_set(struct led_pwm_data *led_dat)
pwm_enable
(
led_dat
->
pwm
);
pwm_enable
(
led_dat
->
pwm
);
}
}
static
void
led_pwm_set
(
struct
led_classdev
*
led_cdev
,
static
int
led_pwm_set
(
struct
led_classdev
*
led_cdev
,
enum
led_brightness
brightness
)
enum
led_brightness
brightness
)
{
{
struct
led_pwm_data
*
led_dat
=
struct
led_pwm_data
*
led_dat
=
...
@@ -66,12 +65,7 @@ static void led_pwm_set(struct led_classdev *led_cdev,
...
@@ -66,12 +65,7 @@ static void led_pwm_set(struct led_classdev *led_cdev,
led_dat
->
duty
=
duty
;
led_dat
->
duty
=
duty
;
__led_pwm_set
(
led_dat
);
__led_pwm_set
(
led_dat
);
}
static
int
led_pwm_set_blocking
(
struct
led_classdev
*
led_cdev
,
enum
led_brightness
brightness
)
{
led_pwm_set
(
led_cdev
,
brightness
);
return
0
;
return
0
;
}
}
...
@@ -112,11 +106,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
...
@@ -112,11 +106,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
return
ret
;
return
ret
;
}
}
led_data
->
can_sleep
=
pwm_can_sleep
(
led_data
->
pwm
);
led_data
->
cdev
.
brightness_set_blocking
=
led_pwm_set
;
if
(
!
led_data
->
can_sleep
)
led_data
->
cdev
.
brightness_set
=
led_pwm_set
;
else
led_data
->
cdev
.
brightness_set_blocking
=
led_pwm_set_blocking
;
/*
/*
* FIXME: pwm_apply_args() should be removed when switching to the
* FIXME: pwm_apply_args() should be removed when switching to the
...
...
drivers/pwm/core.c
浏览文件 @
652f3196
...
@@ -137,9 +137,14 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
...
@@ -137,9 +137,14 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
{
{
struct
pwm_device
*
pwm
;
struct
pwm_device
*
pwm
;
/* check, whether the driver supports a third cell for flags */
if
(
pc
->
of_pwm_n_cells
<
3
)
if
(
pc
->
of_pwm_n_cells
<
3
)
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
/* flags in the third cell are optional */
if
(
args
->
args_count
<
2
)
return
ERR_PTR
(
-
EINVAL
);
if
(
args
->
args
[
0
]
>=
pc
->
npwm
)
if
(
args
->
args
[
0
]
>=
pc
->
npwm
)
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
...
@@ -148,11 +153,10 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
...
@@ -148,11 +153,10 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
return
pwm
;
return
pwm
;
pwm
->
args
.
period
=
args
->
args
[
1
];
pwm
->
args
.
period
=
args
->
args
[
1
];
pwm
->
args
.
polarity
=
PWM_POLARITY_NORMAL
;
if
(
args
->
args
[
2
]
&
PWM_POLARITY_INVERTED
)
if
(
args
->
args
_count
>
2
&&
args
->
args
[
2
]
&
PWM_POLARITY_INVERTED
)
pwm
->
args
.
polarity
=
PWM_POLARITY_INVERSED
;
pwm
->
args
.
polarity
=
PWM_POLARITY_INVERSED
;
else
pwm
->
args
.
polarity
=
PWM_POLARITY_NORMAL
;
return
pwm
;
return
pwm
;
}
}
...
@@ -163,9 +167,14 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
...
@@ -163,9 +167,14 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
{
{
struct
pwm_device
*
pwm
;
struct
pwm_device
*
pwm
;
/* sanity check driver support */
if
(
pc
->
of_pwm_n_cells
<
2
)
if
(
pc
->
of_pwm_n_cells
<
2
)
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
/* all cells are required */
if
(
args
->
args_count
!=
pc
->
of_pwm_n_cells
)
return
ERR_PTR
(
-
EINVAL
);
if
(
args
->
args
[
0
]
>=
pc
->
npwm
)
if
(
args
->
args
[
0
]
>=
pc
->
npwm
)
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
...
@@ -663,24 +672,17 @@ struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id)
...
@@ -663,24 +672,17 @@ struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id)
err
=
of_parse_phandle_with_args
(
np
,
"pwms"
,
"#pwm-cells"
,
index
,
err
=
of_parse_phandle_with_args
(
np
,
"pwms"
,
"#pwm-cells"
,
index
,
&
args
);
&
args
);
if
(
err
)
{
if
(
err
)
{
pr_
debug
(
"%s(): can't parse
\"
pwms
\"
property
\n
"
,
__func__
);
pr_
err
(
"%s(): can't parse
\"
pwms
\"
property
\n
"
,
__func__
);
return
ERR_PTR
(
err
);
return
ERR_PTR
(
err
);
}
}
pc
=
of_node_to_pwmchip
(
args
.
np
);
pc
=
of_node_to_pwmchip
(
args
.
np
);
if
(
IS_ERR
(
pc
))
{
if
(
IS_ERR
(
pc
))
{
pr_
debug
(
"%s(): PWM chip not found
\n
"
,
__func__
);
pr_
err
(
"%s(): PWM chip not found
\n
"
,
__func__
);
pwm
=
ERR_CAST
(
pc
);
pwm
=
ERR_CAST
(
pc
);
goto
put
;
goto
put
;
}
}
if
(
args
.
args_count
!=
pc
->
of_pwm_n_cells
)
{
pr_debug
(
"%s: wrong #pwm-cells for %s
\n
"
,
np
->
full_name
,
args
.
np
->
full_name
);
pwm
=
ERR_PTR
(
-
EINVAL
);
goto
put
;
}
pwm
=
pc
->
of_xlate
(
pc
,
&
args
);
pwm
=
pc
->
of_xlate
(
pc
,
&
args
);
if
(
IS_ERR
(
pwm
))
if
(
IS_ERR
(
pwm
))
goto
put
;
goto
put
;
...
@@ -757,12 +759,13 @@ void pwm_remove_table(struct pwm_lookup *table, size_t num)
...
@@ -757,12 +759,13 @@ void pwm_remove_table(struct pwm_lookup *table, size_t num)
*/
*/
struct
pwm_device
*
pwm_get
(
struct
device
*
dev
,
const
char
*
con_id
)
struct
pwm_device
*
pwm_get
(
struct
device
*
dev
,
const
char
*
con_id
)
{
{
struct
pwm_device
*
pwm
=
ERR_PTR
(
-
EPROBE_DEFER
);
const
char
*
dev_id
=
dev
?
dev_name
(
dev
)
:
NULL
;
const
char
*
dev_id
=
dev
?
dev_name
(
dev
)
:
NULL
;
struct
pwm_chip
*
chip
=
NULL
;
struct
pwm_device
*
pwm
;
struct
pwm_chip
*
chip
;
unsigned
int
best
=
0
;
unsigned
int
best
=
0
;
struct
pwm_lookup
*
p
,
*
chosen
=
NULL
;
struct
pwm_lookup
*
p
,
*
chosen
=
NULL
;
unsigned
int
match
;
unsigned
int
match
;
int
err
;
/* look up via DT first */
/* look up via DT first */
if
(
IS_ENABLED
(
CONFIG_OF
)
&&
dev
&&
dev
->
of_node
)
if
(
IS_ENABLED
(
CONFIG_OF
)
&&
dev
&&
dev
->
of_node
)
...
@@ -817,24 +820,35 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
...
@@ -817,24 +820,35 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
}
}
}
}
if
(
!
chosen
)
{
mutex_unlock
(
&
pwm_lookup_lock
);
pwm
=
ERR_PTR
(
-
ENODEV
);
goto
out
;
if
(
!
chosen
)
}
return
ERR_PTR
(
-
ENODEV
);
chip
=
pwmchip_find_by_name
(
chosen
->
provider
);
chip
=
pwmchip_find_by_name
(
chosen
->
provider
);
/*
* If the lookup entry specifies a module, load the module and retry
* the PWM chip lookup. This can be used to work around driver load
* ordering issues if driver's can't be made to properly support the
* deferred probe mechanism.
*/
if
(
!
chip
&&
chosen
->
module
)
{
err
=
request_module
(
chosen
->
module
);
if
(
err
==
0
)
chip
=
pwmchip_find_by_name
(
chosen
->
provider
);
}
if
(
!
chip
)
if
(
!
chip
)
goto
out
;
return
ERR_PTR
(
-
EPROBE_DEFER
)
;
pwm
=
pwm_request_from_chip
(
chip
,
chosen
->
index
,
con_id
?:
dev_id
);
pwm
=
pwm_request_from_chip
(
chip
,
chosen
->
index
,
con_id
?:
dev_id
);
if
(
IS_ERR
(
pwm
))
if
(
IS_ERR
(
pwm
))
goto
out
;
return
pwm
;
pwm
->
args
.
period
=
chosen
->
period
;
pwm
->
args
.
period
=
chosen
->
period
;
pwm
->
args
.
polarity
=
chosen
->
polarity
;
pwm
->
args
.
polarity
=
chosen
->
polarity
;
out:
mutex_unlock
(
&
pwm_lookup_lock
);
return
pwm
;
return
pwm
;
}
}
EXPORT_SYMBOL_GPL
(
pwm_get
);
EXPORT_SYMBOL_GPL
(
pwm_get
);
...
@@ -960,18 +974,6 @@ void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
...
@@ -960,18 +974,6 @@ void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
}
}
EXPORT_SYMBOL_GPL
(
devm_pwm_put
);
EXPORT_SYMBOL_GPL
(
devm_pwm_put
);
/**
* pwm_can_sleep() - report whether PWM access will sleep
* @pwm: PWM device
*
* Returns: True if accessing the PWM can sleep, false otherwise.
*/
bool
pwm_can_sleep
(
struct
pwm_device
*
pwm
)
{
return
true
;
}
EXPORT_SYMBOL_GPL
(
pwm_can_sleep
);
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
static
void
pwm_dbg_show
(
struct
pwm_chip
*
chip
,
struct
seq_file
*
s
)
static
void
pwm_dbg_show
(
struct
pwm_chip
*
chip
,
struct
seq_file
*
s
)
{
{
...
...
drivers/pwm/pwm-atmel-hlcdc.c
浏览文件 @
652f3196
...
@@ -270,7 +270,6 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
...
@@ -270,7 +270,6 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
chip
->
chip
.
npwm
=
1
;
chip
->
chip
.
npwm
=
1
;
chip
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
chip
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
chip
->
chip
.
of_pwm_n_cells
=
3
;
chip
->
chip
.
of_pwm_n_cells
=
3
;
chip
->
chip
.
can_sleep
=
1
;
ret
=
pwmchip_add_with_polarity
(
&
chip
->
chip
,
PWM_POLARITY_INVERSED
);
ret
=
pwmchip_add_with_polarity
(
&
chip
->
chip
,
PWM_POLARITY_INVERSED
);
if
(
ret
)
{
if
(
ret
)
{
...
...
drivers/pwm/pwm-atmel.c
浏览文件 @
652f3196
...
@@ -385,7 +385,6 @@ static int atmel_pwm_probe(struct platform_device *pdev)
...
@@ -385,7 +385,6 @@ static int atmel_pwm_probe(struct platform_device *pdev)
atmel_pwm
->
chip
.
base
=
-
1
;
atmel_pwm
->
chip
.
base
=
-
1
;
atmel_pwm
->
chip
.
npwm
=
4
;
atmel_pwm
->
chip
.
npwm
=
4
;
atmel_pwm
->
chip
.
can_sleep
=
true
;
atmel_pwm
->
config
=
data
->
config
;
atmel_pwm
->
config
=
data
->
config
;
atmel_pwm
->
updated_pwms
=
0
;
atmel_pwm
->
updated_pwms
=
0
;
mutex_init
(
&
atmel_pwm
->
isr_lock
);
mutex_init
(
&
atmel_pwm
->
isr_lock
);
...
...
drivers/pwm/pwm-bcm-kona.c
浏览文件 @
652f3196
...
@@ -276,7 +276,6 @@ static int kona_pwmc_probe(struct platform_device *pdev)
...
@@ -276,7 +276,6 @@ static int kona_pwmc_probe(struct platform_device *pdev)
kp
->
chip
.
npwm
=
6
;
kp
->
chip
.
npwm
=
6
;
kp
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
kp
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
kp
->
chip
.
of_pwm_n_cells
=
3
;
kp
->
chip
.
of_pwm_n_cells
=
3
;
kp
->
chip
.
can_sleep
=
true
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
kp
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
kp
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
...
...
drivers/pwm/pwm-berlin.c
浏览文件 @
652f3196
...
@@ -206,7 +206,6 @@ static int berlin_pwm_probe(struct platform_device *pdev)
...
@@ -206,7 +206,6 @@ static int berlin_pwm_probe(struct platform_device *pdev)
pwm
->
chip
.
ops
=
&
berlin_pwm_ops
;
pwm
->
chip
.
ops
=
&
berlin_pwm_ops
;
pwm
->
chip
.
base
=
-
1
;
pwm
->
chip
.
base
=
-
1
;
pwm
->
chip
.
npwm
=
4
;
pwm
->
chip
.
npwm
=
4
;
pwm
->
chip
.
can_sleep
=
true
;
pwm
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
pwm
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
pwm
->
chip
.
of_pwm_n_cells
=
3
;
pwm
->
chip
.
of_pwm_n_cells
=
3
;
...
...
drivers/pwm/pwm-brcmstb.c
浏览文件 @
652f3196
...
@@ -270,7 +270,6 @@ static int brcmstb_pwm_probe(struct platform_device *pdev)
...
@@ -270,7 +270,6 @@ static int brcmstb_pwm_probe(struct platform_device *pdev)
p
->
chip
.
ops
=
&
brcmstb_pwm_ops
;
p
->
chip
.
ops
=
&
brcmstb_pwm_ops
;
p
->
chip
.
base
=
-
1
;
p
->
chip
.
base
=
-
1
;
p
->
chip
.
npwm
=
2
;
p
->
chip
.
npwm
=
2
;
p
->
chip
.
can_sleep
=
true
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
p
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
p
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
...
...
drivers/pwm/pwm-fsl-ftm.c
浏览文件 @
652f3196
...
@@ -446,7 +446,6 @@ static int fsl_pwm_probe(struct platform_device *pdev)
...
@@ -446,7 +446,6 @@ static int fsl_pwm_probe(struct platform_device *pdev)
fpc
->
chip
.
of_pwm_n_cells
=
3
;
fpc
->
chip
.
of_pwm_n_cells
=
3
;
fpc
->
chip
.
base
=
-
1
;
fpc
->
chip
.
base
=
-
1
;
fpc
->
chip
.
npwm
=
8
;
fpc
->
chip
.
npwm
=
8
;
fpc
->
chip
.
can_sleep
=
true
;
ret
=
pwmchip_add
(
&
fpc
->
chip
);
ret
=
pwmchip_add
(
&
fpc
->
chip
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
drivers/pwm/pwm-imx.c
浏览文件 @
652f3196
...
@@ -304,7 +304,6 @@ static int imx_pwm_probe(struct platform_device *pdev)
...
@@ -304,7 +304,6 @@ static int imx_pwm_probe(struct platform_device *pdev)
imx
->
chip
.
dev
=
&
pdev
->
dev
;
imx
->
chip
.
dev
=
&
pdev
->
dev
;
imx
->
chip
.
base
=
-
1
;
imx
->
chip
.
base
=
-
1
;
imx
->
chip
.
npwm
=
1
;
imx
->
chip
.
npwm
=
1
;
imx
->
chip
.
can_sleep
=
true
;
r
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
r
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
imx
->
mmio_base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
r
);
imx
->
mmio_base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
r
);
...
...
drivers/pwm/pwm-lp3943.c
浏览文件 @
652f3196
...
@@ -278,7 +278,6 @@ static int lp3943_pwm_probe(struct platform_device *pdev)
...
@@ -278,7 +278,6 @@ static int lp3943_pwm_probe(struct platform_device *pdev)
lp3943_pwm
->
chip
.
dev
=
&
pdev
->
dev
;
lp3943_pwm
->
chip
.
dev
=
&
pdev
->
dev
;
lp3943_pwm
->
chip
.
ops
=
&
lp3943_pwm_ops
;
lp3943_pwm
->
chip
.
ops
=
&
lp3943_pwm_ops
;
lp3943_pwm
->
chip
.
npwm
=
LP3943_NUM_PWMS
;
lp3943_pwm
->
chip
.
npwm
=
LP3943_NUM_PWMS
;
lp3943_pwm
->
chip
.
can_sleep
=
true
;
platform_set_drvdata
(
pdev
,
lp3943_pwm
);
platform_set_drvdata
(
pdev
,
lp3943_pwm
);
...
...
drivers/pwm/pwm-mxs.c
浏览文件 @
652f3196
...
@@ -151,7 +151,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
...
@@ -151,7 +151,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
mxs
->
chip
.
dev
=
&
pdev
->
dev
;
mxs
->
chip
.
dev
=
&
pdev
->
dev
;
mxs
->
chip
.
ops
=
&
mxs_pwm_ops
;
mxs
->
chip
.
ops
=
&
mxs_pwm_ops
;
mxs
->
chip
.
base
=
-
1
;
mxs
->
chip
.
base
=
-
1
;
mxs
->
chip
.
can_sleep
=
true
;
ret
=
of_property_read_u32
(
np
,
"fsl,pwm-number"
,
&
mxs
->
chip
.
npwm
);
ret
=
of_property_read_u32
(
np
,
"fsl,pwm-number"
,
&
mxs
->
chip
.
npwm
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"failed to get pwm number: %d
\n
"
,
ret
);
dev_err
(
&
pdev
->
dev
,
"failed to get pwm number: %d
\n
"
,
ret
);
...
...
drivers/pwm/pwm-pca9685.c
浏览文件 @
652f3196
...
@@ -343,7 +343,6 @@ static int pca9685_pwm_probe(struct i2c_client *client,
...
@@ -343,7 +343,6 @@ static int pca9685_pwm_probe(struct i2c_client *client,
pca
->
chip
.
dev
=
&
client
->
dev
;
pca
->
chip
.
dev
=
&
client
->
dev
;
pca
->
chip
.
base
=
-
1
;
pca
->
chip
.
base
=
-
1
;
pca
->
chip
.
can_sleep
=
true
;
return
pwmchip_add
(
&
pca
->
chip
);
return
pwmchip_add
(
&
pca
->
chip
);
}
}
...
...
drivers/pwm/pwm-sti.c
浏览文件 @
652f3196
...
@@ -635,7 +635,6 @@ static int sti_pwm_probe(struct platform_device *pdev)
...
@@ -635,7 +635,6 @@ static int sti_pwm_probe(struct platform_device *pdev)
pc
->
chip
.
ops
=
&
sti_pwm_ops
;
pc
->
chip
.
ops
=
&
sti_pwm_ops
;
pc
->
chip
.
base
=
-
1
;
pc
->
chip
.
base
=
-
1
;
pc
->
chip
.
npwm
=
pc
->
cdata
->
pwm_num_devs
;
pc
->
chip
.
npwm
=
pc
->
cdata
->
pwm_num_devs
;
pc
->
chip
.
can_sleep
=
true
;
ret
=
pwmchip_add
(
&
pc
->
chip
);
ret
=
pwmchip_add
(
&
pc
->
chip
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
drivers/pwm/pwm-sun4i.c
浏览文件 @
652f3196
...
@@ -340,7 +340,6 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
...
@@ -340,7 +340,6 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
pwm
->
chip
.
ops
=
&
sun4i_pwm_ops
;
pwm
->
chip
.
ops
=
&
sun4i_pwm_ops
;
pwm
->
chip
.
base
=
-
1
;
pwm
->
chip
.
base
=
-
1
;
pwm
->
chip
.
npwm
=
pwm
->
data
->
npwm
;
pwm
->
chip
.
npwm
=
pwm
->
data
->
npwm
;
pwm
->
chip
.
can_sleep
=
true
;
pwm
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
pwm
->
chip
.
of_xlate
=
of_pwm_xlate_with_flags
;
pwm
->
chip
.
of_pwm_n_cells
=
3
;
pwm
->
chip
.
of_pwm_n_cells
=
3
;
...
...
drivers/pwm/pwm-twl-led.c
浏览文件 @
652f3196
...
@@ -303,7 +303,6 @@ static int twl_pwmled_probe(struct platform_device *pdev)
...
@@ -303,7 +303,6 @@ static int twl_pwmled_probe(struct platform_device *pdev)
twl
->
chip
.
dev
=
&
pdev
->
dev
;
twl
->
chip
.
dev
=
&
pdev
->
dev
;
twl
->
chip
.
base
=
-
1
;
twl
->
chip
.
base
=
-
1
;
twl
->
chip
.
can_sleep
=
true
;
mutex_init
(
&
twl
->
mutex
);
mutex_init
(
&
twl
->
mutex
);
...
...
drivers/pwm/pwm-twl.c
浏览文件 @
652f3196
...
@@ -323,7 +323,6 @@ static int twl_pwm_probe(struct platform_device *pdev)
...
@@ -323,7 +323,6 @@ static int twl_pwm_probe(struct platform_device *pdev)
twl
->
chip
.
dev
=
&
pdev
->
dev
;
twl
->
chip
.
dev
=
&
pdev
->
dev
;
twl
->
chip
.
base
=
-
1
;
twl
->
chip
.
base
=
-
1
;
twl
->
chip
.
npwm
=
2
;
twl
->
chip
.
npwm
=
2
;
twl
->
chip
.
can_sleep
=
true
;
mutex_init
(
&
twl
->
mutex
);
mutex_init
(
&
twl
->
mutex
);
...
...
drivers/staging/greybus/pwm.c
浏览文件 @
652f3196
...
@@ -284,7 +284,6 @@ static int gb_pwm_probe(struct gbphy_device *gbphy_dev,
...
@@ -284,7 +284,6 @@ static int gb_pwm_probe(struct gbphy_device *gbphy_dev,
pwm
->
ops
=
&
gb_pwm_ops
;
pwm
->
ops
=
&
gb_pwm_ops
;
pwm
->
base
=
-
1
;
/* Allocate base dynamically */
pwm
->
base
=
-
1
;
/* Allocate base dynamically */
pwm
->
npwm
=
pwmc
->
pwm_max
+
1
;
pwm
->
npwm
=
pwmc
->
pwm_max
+
1
;
pwm
->
can_sleep
=
true
;
/* FIXME */
ret
=
pwmchip_add
(
pwm
);
ret
=
pwmchip_add
(
pwm
);
if
(
ret
)
{
if
(
ret
)
{
...
...
include/linux/pwm.h
浏览文件 @
652f3196
...
@@ -287,8 +287,6 @@ struct pwm_ops {
...
@@ -287,8 +287,6 @@ struct pwm_ops {
* @pwms: array of PWM devices allocated by the framework
* @pwms: array of PWM devices allocated by the framework
* @of_xlate: request a PWM device given a device tree PWM specifier
* @of_xlate: request a PWM device given a device tree PWM specifier
* @of_pwm_n_cells: number of cells expected in the device tree PWM specifier
* @of_pwm_n_cells: number of cells expected in the device tree PWM specifier
* @can_sleep: must be true if the .config(), .enable() or .disable()
* operations may sleep
*/
*/
struct
pwm_chip
{
struct
pwm_chip
{
struct
device
*
dev
;
struct
device
*
dev
;
...
@@ -302,7 +300,6 @@ struct pwm_chip {
...
@@ -302,7 +300,6 @@ struct pwm_chip {
struct
pwm_device
*
(
*
of_xlate
)(
struct
pwm_chip
*
pc
,
struct
pwm_device
*
(
*
of_xlate
)(
struct
pwm_chip
*
pc
,
const
struct
of_phandle_args
*
args
);
const
struct
of_phandle_args
*
args
);
unsigned
int
of_pwm_n_cells
;
unsigned
int
of_pwm_n_cells
;
bool
can_sleep
;
};
};
/**
/**
...
@@ -451,8 +448,6 @@ struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id);
...
@@ -451,8 +448,6 @@ struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id);
struct
pwm_device
*
devm_of_pwm_get
(
struct
device
*
dev
,
struct
device_node
*
np
,
struct
pwm_device
*
devm_of_pwm_get
(
struct
device
*
dev
,
struct
device_node
*
np
,
const
char
*
con_id
);
const
char
*
con_id
);
void
devm_pwm_put
(
struct
device
*
dev
,
struct
pwm_device
*
pwm
);
void
devm_pwm_put
(
struct
device
*
dev
,
struct
pwm_device
*
pwm
);
bool
pwm_can_sleep
(
struct
pwm_device
*
pwm
);
#else
#else
static
inline
struct
pwm_device
*
pwm_request
(
int
pwm_id
,
const
char
*
label
)
static
inline
struct
pwm_device
*
pwm_request
(
int
pwm_id
,
const
char
*
label
)
{
{
...
@@ -566,11 +561,6 @@ static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
...
@@ -566,11 +561,6 @@ static inline struct pwm_device *devm_of_pwm_get(struct device *dev,
static
inline
void
devm_pwm_put
(
struct
device
*
dev
,
struct
pwm_device
*
pwm
)
static
inline
void
devm_pwm_put
(
struct
device
*
dev
,
struct
pwm_device
*
pwm
)
{
{
}
}
static
inline
bool
pwm_can_sleep
(
struct
pwm_device
*
pwm
)
{
return
false
;
}
#endif
#endif
static
inline
void
pwm_apply_args
(
struct
pwm_device
*
pwm
)
static
inline
void
pwm_apply_args
(
struct
pwm_device
*
pwm
)
...
@@ -613,18 +603,25 @@ struct pwm_lookup {
...
@@ -613,18 +603,25 @@ struct pwm_lookup {
const
char
*
con_id
;
const
char
*
con_id
;
unsigned
int
period
;
unsigned
int
period
;
enum
pwm_polarity
polarity
;
enum
pwm_polarity
polarity
;
const
char
*
module
;
/* optional, may be NULL */
};
};
#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id, _period, _polarity) \
#define PWM_LOOKUP_WITH_MODULE(_provider, _index, _dev_id, _con_id, \
_period, _polarity, _module) \
{ \
{ \
.provider = _provider, \
.provider = _provider, \
.index = _index, \
.index = _index, \
.dev_id = _dev_id, \
.dev_id = _dev_id, \
.con_id = _con_id, \
.con_id = _con_id, \
.period = _period, \
.period = _period, \
.polarity = _polarity \
.polarity = _polarity, \
.module = _module, \
}
}
#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id, _period, _polarity) \
PWM_LOOKUP_WITH_MODULE(_provider, _index, _dev_id, _con_id, _period, \
_polarity, NULL)
#if IS_ENABLED(CONFIG_PWM)
#if IS_ENABLED(CONFIG_PWM)
void
pwm_add_table
(
struct
pwm_lookup
*
table
,
size_t
num
);
void
pwm_add_table
(
struct
pwm_lookup
*
table
,
size_t
num
);
void
pwm_remove_table
(
struct
pwm_lookup
*
table
,
size_t
num
);
void
pwm_remove_table
(
struct
pwm_lookup
*
table
,
size_t
num
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录