Merge tag 'pwm/for-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
[sfrench/cifs-2.6.git] / drivers / pwm / pwm-atmel.c
index 4ac899d8008cf50d99b597c17c3c270db3541cd5..a9fd6f0d408c318e56538e15e30d241d9a885ee3 100644 (file)
 #define PWMV2_CPRD             0x0C
 #define PWMV2_CPRDUPD          0x10
 
-/* Max values for period and prescaler */
-
-/* Only the LSB 16 bits are significant. */
-#define PWM_MAXV1_PRD          0xFFFF
-#define PRD_MAXV1_PRES         10
-
 struct atmel_pwm_registers {
        u8 period;
        u8 period_upd;
@@ -292,8 +286,8 @@ static const struct atmel_pwm_data atmel_sam9rl_pwm_data = {
        },
        .cfg = {
                /* 16 bits to keep period and duty. */
-               .max_period     = PWM_MAXV1_PRD,
-               .max_pres       = PRD_MAXV1_PRES,
+               .max_period     = 0xffff,
+               .max_pres       = 10,
        },
 };
 
@@ -306,8 +300,22 @@ static const struct atmel_pwm_data atmel_sama5_pwm_data = {
        },
        .cfg = {
                /* 16 bits to keep period and duty. */
-               .max_period     = PWM_MAXV1_PRD,
-               .max_pres       = PRD_MAXV1_PRES,
+               .max_period     = 0xffff,
+               .max_pres       = 10,
+       },
+};
+
+static const struct atmel_pwm_data mchp_sam9x60_pwm_data = {
+       .regs = {
+               .period         = PWMV1_CPRD,
+               .period_upd     = PWMV1_CUPD,
+               .duty           = PWMV1_CDTY,
+               .duty_upd       = PWMV1_CUPD,
+       },
+       .cfg = {
+               /* 32 bits to keep period and duty. */
+               .max_period     = 0xffffffff,
+               .max_pres       = 10,
        },
 };
 
@@ -334,6 +342,9 @@ static const struct of_device_id atmel_pwm_dt_ids[] = {
        }, {
                .compatible = "atmel,sama5d2-pwm",
                .data = &atmel_sama5_pwm_data,
+       }, {
+               .compatible = "microchip,sam9x60-pwm",
+               .data = &mchp_sam9x60_pwm_data,
        }, {
                /* sentinel */
        },