~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/stm32-lptimer.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * STM32 Low-Power Timer parent driver.
  4  * Copyright (C) STMicroelectronics 2017
  5  * Author: Fabrice Gasnier <fabrice.gasnier@st.com>
  6  * Inspired by Benjamin Gaignard's stm32-timers driver
  7  */
  8 
  9 #ifndef _LINUX_STM32_LPTIMER_H_
 10 #define _LINUX_STM32_LPTIMER_H_
 11 
 12 #include <linux/clk.h>
 13 #include <linux/regmap.h>
 14 
 15 #define STM32_LPTIM_ISR         0x00    /* Interrupt and Status Reg  */
 16 #define STM32_LPTIM_ICR         0x04    /* Interrupt Clear Reg       */
 17 #define STM32_LPTIM_IER         0x08    /* Interrupt Enable Reg      */
 18 #define STM32_LPTIM_CFGR        0x0C    /* Configuration Reg         */
 19 #define STM32_LPTIM_CR          0x10    /* Control Reg               */
 20 #define STM32_LPTIM_CMP         0x14    /* Compare Reg               */
 21 #define STM32_LPTIM_ARR         0x18    /* Autoreload Reg            */
 22 #define STM32_LPTIM_CNT         0x1C    /* Counter Reg               */
 23 
 24 /* STM32_LPTIM_ISR - bit fields */
 25 #define STM32_LPTIM_CMPOK_ARROK         GENMASK(4, 3)
 26 #define STM32_LPTIM_ARROK               BIT(4)
 27 #define STM32_LPTIM_CMPOK               BIT(3)
 28 
 29 /* STM32_LPTIM_ICR - bit fields */
 30 #define STM32_LPTIM_ARRMCF              BIT(1)
 31 #define STM32_LPTIM_CMPOKCF_ARROKCF     GENMASK(4, 3)
 32 
 33 /* STM32_LPTIM_IER - bit flieds */
 34 #define STM32_LPTIM_ARRMIE      BIT(1)
 35 
 36 /* STM32_LPTIM_CR - bit fields */
 37 #define STM32_LPTIM_CNTSTRT     BIT(2)
 38 #define STM32_LPTIM_SNGSTRT     BIT(1)
 39 #define STM32_LPTIM_ENABLE      BIT(0)
 40 
 41 /* STM32_LPTIM_CFGR - bit fields */
 42 #define STM32_LPTIM_ENC         BIT(24)
 43 #define STM32_LPTIM_COUNTMODE   BIT(23)
 44 #define STM32_LPTIM_WAVPOL      BIT(21)
 45 #define STM32_LPTIM_PRESC       GENMASK(11, 9)
 46 #define STM32_LPTIM_CKPOL       GENMASK(2, 1)
 47 
 48 /* STM32_LPTIM_CKPOL */
 49 #define STM32_LPTIM_CKPOL_RISING_EDGE   0
 50 #define STM32_LPTIM_CKPOL_FALLING_EDGE  1
 51 #define STM32_LPTIM_CKPOL_BOTH_EDGES    2
 52 
 53 /* STM32_LPTIM_ARR */
 54 #define STM32_LPTIM_MAX_ARR     0xFFFF
 55 
 56 /**
 57  * struct stm32_lptimer - STM32 Low-Power Timer data assigned by parent device
 58  * @clk: clock reference for this instance
 59  * @regmap: register map reference for this instance
 60  * @has_encoder: indicates this Low-Power Timer supports encoder mode
 61  */
 62 struct stm32_lptimer {
 63         struct clk *clk;
 64         struct regmap *regmap;
 65         bool has_encoder;
 66 };
 67 
 68 #endif
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php