ITE drivers/sensor: add tachometer driver for it8xxx2_evb

Add tachometer driver for it8xxx2_evb.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
This commit is contained in:
Ruibin Chang 2021-10-19 18:33:38 +08:00 committed by Anas Nashif
commit fad78a2c07
12 changed files with 399 additions and 0 deletions

View file

@ -44,6 +44,13 @@
#define REG_BASE_ADDR EC_REG_BASE_ADDR
#endif
/* Common definition */
/*
* EC clock frequency (PWM and tachometer driver need it to reply
* to api or calculate RPM)
*/
#define EC_FREQ MHZ(8)
/**
* (10XXh) Shared Memory Flash Interface Bridge (SMFI)
*/
@ -640,6 +647,11 @@ struct pwm_it8xxx2_regs {
/* PWM register fields */
/* 0x023: PWM Clock Control */
#define IT8XXX2_PWM_PCCE BIT(1)
/* 0x048: Tachometer Switch Control */
#define IT8XXX2_PWM_T0DVS BIT(3)
#define IT8XXX2_PWM_T0CHSEL BIT(2)
#define IT8XXX2_PWM_T1DVS BIT(1)
#define IT8XXX2_PWM_T1CHSEL BIT(0)
/**
*