mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 20:03:33 -04:00
input: qcom-hv-haptics: update FIFO real time fill status mask
FIFO_REAL_TIME_FILL_STATUS_MASK is different for haptics HW version V3. Update it. Change-Id: Ida8326d89678af34ae2c3a35164ae1a7ad5f6b7b Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
This commit is contained in:
parent
72c28d8ec9
commit
41004b86e3
1 changed files with 6 additions and 3 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#define FIFO_REAL_TIME_FILL_STATUS_MASK_V1 GENMASK(6, 0)
|
||||
/* STATUS_DATA_MSB in V2 when MOD_STATUS_SEL is 5 and MOD_STATUS_XT.SEL is 1 */
|
||||
#define FIFO_REAL_TIME_FILL_STATUS_MSB_MASK_V2 GENMASK(1, 0)
|
||||
#define FIFO_REAL_TIME_FILL_STATUS_MSB_MASK_V3 GENMASK(2, 0)
|
||||
#define FIFO_EMPTY_FLAG_BIT_V2 BIT(6)
|
||||
#define FIFO_FULL_FLAG_BIT_V2 BIT(5)
|
||||
|
||||
|
|
@ -1684,7 +1685,7 @@ static int haptics_update_fifo_sample_v2(struct haptics_chip *chip,
|
|||
static int haptics_get_fifo_fill_status(struct haptics_chip *chip, u32 *fill)
|
||||
{
|
||||
int rc;
|
||||
u8 val[2];
|
||||
u8 val[2], fill_status_mask;
|
||||
bool empty = false, full = false;
|
||||
|
||||
if (chip->ptn_revision == HAP_PTN_V1) {
|
||||
|
|
@ -1718,8 +1719,10 @@ static int haptics_get_fifo_fill_status(struct haptics_chip *chip, u32 *fill)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
*fill = ((val[0] & FIFO_REAL_TIME_FILL_STATUS_MSB_MASK_V2)
|
||||
<< 8) | val[1];
|
||||
fill_status_mask = (chip->cfg_revision == HAP_CFG_V2) ?
|
||||
FIFO_REAL_TIME_FILL_STATUS_MSB_MASK_V2 :
|
||||
FIFO_REAL_TIME_FILL_STATUS_MSB_MASK_V3;
|
||||
*fill = ((val[0] & fill_status_mask) << 8) | val[1];
|
||||
empty = !!(val[0] & FIFO_EMPTY_FLAG_BIT_V2);
|
||||
full = !!(val[0] & FIFO_FULL_FLAG_BIT_V2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue