aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-05 12:44:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-05 12:44:52 -0500
commit20f9aa221375dcd906cf160babc00ac2898769fe (patch)
tree61019df8386bc5714954616cea921e7ddfedce9d
parent140995c9762dafd3247ce232273fe19cf9d8b38b (diff)
parentbccaa3f917c90917a758020dfbdd9027290a7c4e (diff)
Merge tag 'pwm/for-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "The Meson PWM controller driver gains support for the AXG series and a minor bug is fixed for the STMPE driver. To round things off, the class is now set for PWM channels exported via sysfs which allows non-root access, provided that the system has been configured accordingly" * tag 'pwm/for-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: meson: Add clock source configuration for Meson-AXG dt-bindings: pwm: Update bindings for the Meson-AXG pwm: stmpe: Fix wrong register offset for hwpwm=2 case pwm: Set class for exported channels in sysfs
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-meson.txt2
-rw-r--r--drivers/pwm/pwm-meson.c26
-rw-r--r--drivers/pwm/pwm-stmpe.c2
-rw-r--r--drivers/pwm/sysfs.c1
4 files changed, 30 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/pwm/pwm-meson.txt b/Documentation/devicetree/bindings/pwm/pwm-meson.txt
index 1ee81321c35e..1fa3f7182133 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-meson.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-meson.txt
@@ -5,6 +5,8 @@ Required properties:
5- compatible: Shall contain "amlogic,meson8b-pwm" 5- compatible: Shall contain "amlogic,meson8b-pwm"
6 or "amlogic,meson-gxbb-pwm" 6 or "amlogic,meson-gxbb-pwm"
7 or "amlogic,meson-gxbb-ao-pwm" 7 or "amlogic,meson-gxbb-ao-pwm"
8 or "amlogic,meson-axg-ee-pwm"
9 or "amlogic,meson-axg-ao-pwm"
8- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of 10- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
9 the cells format. 11 the cells format.
10 12
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index d589331d1884..0767deba8e62 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -411,6 +411,24 @@ static const struct meson_pwm_data pwm_gxbb_ao_data = {
411 .num_parents = ARRAY_SIZE(pwm_gxbb_ao_parent_names), 411 .num_parents = ARRAY_SIZE(pwm_gxbb_ao_parent_names),
412}; 412};
413 413
414static const char * const pwm_axg_ee_parent_names[] = {
415 "xtal", "fclk_div5", "fclk_div4", "fclk_div3"
416};
417
418static const struct meson_pwm_data pwm_axg_ee_data = {
419 .parent_names = pwm_axg_ee_parent_names,
420 .num_parents = ARRAY_SIZE(pwm_axg_ee_parent_names),
421};
422
423static const char * const pwm_axg_ao_parent_names[] = {
424 "aoclk81", "xtal", "fclk_div4", "fclk_div5"
425};
426
427static const struct meson_pwm_data pwm_axg_ao_data = {
428 .parent_names = pwm_axg_ao_parent_names,
429 .num_parents = ARRAY_SIZE(pwm_axg_ao_parent_names),
430};
431
414static const struct of_device_id meson_pwm_matches[] = { 432static const struct of_device_id meson_pwm_matches[] = {
415 { 433 {
416 .compatible = "amlogic,meson8b-pwm", 434 .compatible = "amlogic,meson8b-pwm",
@@ -424,6 +442,14 @@ static const struct of_device_id meson_pwm_matches[] = {
424 .compatible = "amlogic,meson-gxbb-ao-pwm", 442 .compatible = "amlogic,meson-gxbb-ao-pwm",
425 .data = &pwm_gxbb_ao_data 443 .data = &pwm_gxbb_ao_data
426 }, 444 },
445 {
446 .compatible = "amlogic,meson-axg-ee-pwm",
447 .data = &pwm_axg_ee_data
448 },
449 {
450 .compatible = "amlogic,meson-axg-ao-pwm",
451 .data = &pwm_axg_ao_data
452 },
427 {}, 453 {},
428}; 454};
429MODULE_DEVICE_TABLE(of, meson_pwm_matches); 455MODULE_DEVICE_TABLE(of, meson_pwm_matches);
diff --git a/drivers/pwm/pwm-stmpe.c b/drivers/pwm/pwm-stmpe.c
index e464582a390a..3439f1e902cb 100644
--- a/drivers/pwm/pwm-stmpe.c
+++ b/drivers/pwm/pwm-stmpe.c
@@ -145,7 +145,7 @@ static int stmpe_24xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
145 break; 145 break;
146 146
147 case 2: 147 case 2:
148 offset = STMPE24XX_PWMIC1; 148 offset = STMPE24XX_PWMIC2;
149 break; 149 break;
150 150
151 default: 151 default:
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index a813239300c3..83f2b0b15712 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -263,6 +263,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
263 export->pwm = pwm; 263 export->pwm = pwm;
264 mutex_init(&export->lock); 264 mutex_init(&export->lock);
265 265
266 export->child.class = parent->class;
266 export->child.release = pwm_export_release; 267 export->child.release = pwm_export_release;
267 export->child.parent = parent; 268 export->child.parent = parent;
268 export->child.devt = MKDEV(0, 0); 269 export->child.devt = MKDEV(0, 0);