summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2024-06-19 12:11:43 +0200
committerLee Jones <lee@kernel.org>2024-06-26 16:09:52 +0100
commit796b942f65967af55684bf520812787b97522151 (patch)
tree58fa2aebb37b4792cd3c641094be30cb0cdae6ce /drivers
parenta6143bdcaf7e37ecce05df2a3d3c1c5d587f87b1 (diff)
mfd: stm32-timers: Add some register definitions with a parameter
There are some registers that belong together and are numbered from 1 to 4. Introduce a macro definition for these that takes the channel number as parameter and define the previously available constants using the new ones. This allows to simplify some users that up to now use constructs like TIM_CCER_CC1NE << (ch * 4) which is an ugly mix of using a predefined value and still knowing internal details about it. Note that there are several decrements by 1 involved. These are necessary because software guys start counting at 0 while the hardware designer started at 1 (and having TIM_CCER_CCxE(1) be TIM_CCER_CC2E isn't a sane option). The compiler is expected to optimize these out nicely. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/05df15f61dde81033407d3b4fcb67ee403ecc8db.1718791090.git.u.kleine-koenig@baylibre.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions