summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-10-15 09:21:34 +0400
committerThierry Reding <thierry.reding@gmail.com>2014-12-01 12:44:48 +0300
commit49599cf6bb8098ecde64f2bda3337b5fcf6323c5 (patch)
tree71d8a9af13bf026606d39e25c1a734835477e469 /drivers/pwm
parent8e6e76510287d1a08c7c36e8e076b1314f59d9c4 (diff)
downloadlinux-49599cf6bb8098ecde64f2bda3337b5fcf6323c5.tar.xz
pwm: ftm: Add regmap rbtree type cache support
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>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-fsl-ftm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-fsl-ftm.c b/drivers/pwm/pwm-fsl-ftm.c
index 1150598b7532..9bfbea5dbf2f 100644
--- a/drivers/pwm/pwm-fsl-ftm.c
+++ b/drivers/pwm/pwm-fsl-ftm.c
@@ -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)