Skip to content

Commit

Permalink
pwm: ftm: Add regmap rbtree type cache support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and Thierry Reding committed Dec 1, 2014
1 parent 8e6e765 commit 49599cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/pwm/pwm-fsl-ftm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49599cf

Please sign in to comment.