Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87b61856 authored by Fenglin Wu's avatar Fenglin Wu
Browse files

input: qcom-hv-haptics: limit play rate for PM8350B v1 hardware



Due to a hardware limitation, PM8350B v1 cannot play more than 8 KHz as
it has a FIFO size of 104 bytes. Hence limit the play rate for PM8350B
v1 to 8 KHz.

Change-Id: Ibeabd4c0229a54e2d99023c8fbc5970b1a7a1e64
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent d79818af
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -966,6 +966,13 @@ static int haptics_set_fifo(struct haptics_chip *chip, struct fifo_cfg *fifo)
		return -EBUSY;
	}

	if (chip->ptn_revision == HAP_PTN_V1 &&
			fifo->period_per_s > F_8KHZ &&
			fifo->num_s > MAX_FIFO_SAMPLES(chip)) {
		dev_err(chip->dev, "PM8350B v1 doesn't support playing long FIFO pattern higher than 8 KHz play rate\n");
		return -EINVAL;
	}

	/* Configure FIFO play rate */
	rc = haptics_set_fifo_playrate(chip, fifo->period_per_s);
	if (rc < 0)