Merge tag 'pwm/for-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 5 Feb 2018 17:44:52 +0000 (09:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 5 Feb 2018 17:44:52 +0000 (09:44 -0800)
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

Documentation/devicetree/bindings/pwm/pwm-meson.txt
drivers/pwm/pwm-meson.c
drivers/pwm/pwm-stmpe.c
drivers/pwm/sysfs.c

index 1ee81321c35e792ded427994001aef24be69f931..1fa3f718213342f20e910a224b95e23efede87be 100644 (file)
@@ -5,6 +5,8 @@ Required properties:
 - compatible: Shall contain "amlogic,meson8b-pwm"
                          or "amlogic,meson-gxbb-pwm"
                          or "amlogic,meson-gxbb-ao-pwm"
+                         or "amlogic,meson-axg-ee-pwm"
+                         or "amlogic,meson-axg-ao-pwm"
 - #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
   the cells format.
 
index d589331d1884b29f938c47f9fb3308ffcb212026..0767deba8e622dbfb8227910252266c5f54ef777 100644 (file)
@@ -411,6 +411,24 @@ static const struct meson_pwm_data pwm_gxbb_ao_data = {
        .num_parents = ARRAY_SIZE(pwm_gxbb_ao_parent_names),
 };
 
+static const char * const pwm_axg_ee_parent_names[] = {
+       "xtal", "fclk_div5", "fclk_div4", "fclk_div3"
+};
+
+static const struct meson_pwm_data pwm_axg_ee_data = {
+       .parent_names = pwm_axg_ee_parent_names,
+       .num_parents = ARRAY_SIZE(pwm_axg_ee_parent_names),
+};
+
+static const char * const pwm_axg_ao_parent_names[] = {
+       "aoclk81", "xtal", "fclk_div4", "fclk_div5"
+};
+
+static const struct meson_pwm_data pwm_axg_ao_data = {
+       .parent_names = pwm_axg_ao_parent_names,
+       .num_parents = ARRAY_SIZE(pwm_axg_ao_parent_names),
+};
+
 static const struct of_device_id meson_pwm_matches[] = {
        {
                .compatible = "amlogic,meson8b-pwm",
@@ -424,6 +442,14 @@ static const struct of_device_id meson_pwm_matches[] = {
                .compatible = "amlogic,meson-gxbb-ao-pwm",
                .data = &pwm_gxbb_ao_data
        },
+       {
+               .compatible = "amlogic,meson-axg-ee-pwm",
+               .data = &pwm_axg_ee_data
+       },
+       {
+               .compatible = "amlogic,meson-axg-ao-pwm",
+               .data = &pwm_axg_ao_data
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, meson_pwm_matches);
index e464582a390a58ef68064a1cc925822d2ec95354..3439f1e902cb0e5dbfba93f1bbd88d0a1785c4fa 100644 (file)
@@ -145,7 +145,7 @@ static int stmpe_24xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
                break;
 
        case 2:
-               offset = STMPE24XX_PWMIC1;
+               offset = STMPE24XX_PWMIC2;
                break;
 
        default:
index a813239300c3d46bba1320caac77ec7adc8363a8..83f2b0b15712bf5745a0dc3a231c5ed0a817fdcd 100644 (file)
@@ -263,6 +263,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
        export->pwm = pwm;
        mutex_init(&export->lock);
 
+       export->child.class = parent->class;
        export->child.release = pwm_export_release;
        export->child.parent = parent;
        export->child.devt = MKDEV(0, 0);