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

Commit 9522c83d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "misc: isa1200: Add mutex for clk_on"

parents 73b6d968 2d0d60b6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ static void isa1200_vib_set(struct isa1200_chip *haptic, int enable)
				}
			}

			mutex_lock(&haptic->client->dev.mutex);
			/* vote for clock */
			if (haptic->pdata->need_pwm_clk && !haptic->clk_on) {
				rc = clk_prepare_enable(haptic->pwm_clk);
@@ -130,6 +131,7 @@ static void isa1200_vib_set(struct isa1200_chip *haptic, int enable)
				}
				haptic->clk_on = true;
			}
			mutex_unlock(&haptic->client->dev.mutex);

			rc = isa1200_write_reg(haptic->client,
						ISA1200_HCTRL5,
@@ -162,11 +164,13 @@ static void isa1200_vib_set(struct isa1200_chip *haptic, int enable)
			if (rc < 0)
				pr_err("%s: stop vibartion fail\n", __func__);

			mutex_lock(&haptic->client->dev.mutex);
			/* de-vote clock */
			if (haptic->pdata->need_pwm_clk && haptic->clk_on) {
				clk_disable_unprepare(haptic->pwm_clk);
				haptic->clk_on = false;
			}
			mutex_unlock(&haptic->client->dev.mutex);
			/* check for board specific clk callback */
			if (haptic->pdata->clk_enable) {
				rc = haptic->pdata->clk_enable(false);
@@ -180,10 +184,12 @@ static void isa1200_vib_set(struct isa1200_chip *haptic, int enable)
	return;

dis_clk:
	mutex_lock(&haptic->client->dev.mutex);
	if (haptic->pdata->need_pwm_clk && haptic->clk_on) {
		clk_disable_unprepare(haptic->pwm_clk);
		haptic->clk_on = false;
	}
	mutex_unlock(&haptic->client->dev.mutex);

dis_clk_cb:
	if (haptic->pdata->clk_enable) {