]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pwm: ftm: Add regmap rbtree type cache support
authorXiubo Li <Li.Xiubo@freescale.com>
Wed, 15 Oct 2014 05:21:34 +0000 (13:21 +0800)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 1 Dec 2014 09:44:48 +0000 (10:44 +0100)
This patch is to prepare for adding PM support for FTM PWM driver using
callback function suspend and resume in .driver.pm of platform_driver.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-fsl-ftm.c

index 1150598b7532b7971e3ada73b0320dd892fba966..9bfbea5dbf2f9f07a9c0bf1f9ea67535c8bd7c4b 100644 (file)
@@ -397,12 +397,23 @@ static int fsl_pwm_init(struct fsl_pwm_chip *fpc)
        return 0;
 }
 
+static bool fsl_pwm_volatile_reg(struct device *dev, unsigned int reg)
+{
+       switch (reg) {
+       case FTM_CNT:
+               return true;
+       }
+       return false;
+}
+
 static const struct regmap_config fsl_pwm_regmap_config = {
        .reg_bits = 32,
        .reg_stride = 4,
        .val_bits = 32,
 
        .max_register = FTM_PWMLOAD,
+       .volatile_reg = fsl_pwm_volatile_reg,
+       .cache_type = REGCACHE_RBTREE,
 };
 
 static int fsl_pwm_probe(struct platform_device *pdev)