Commit 49599cf6 authored by Xiubo Li's avatar Xiubo Li Committed by Thierry Reding

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: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 8e6e7651
...@@ -397,12 +397,23 @@ static int fsl_pwm_init(struct fsl_pwm_chip *fpc) ...@@ -397,12 +397,23 @@ static int fsl_pwm_init(struct fsl_pwm_chip *fpc)
return 0; 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 = { static const struct regmap_config fsl_pwm_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.val_bits = 32, .val_bits = 32,
.max_register = FTM_PWMLOAD, .max_register = FTM_PWMLOAD,
.volatile_reg = fsl_pwm_volatile_reg,
.cache_type = REGCACHE_RBTREE,
}; };
static int fsl_pwm_probe(struct platform_device *pdev) static int fsl_pwm_probe(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment