lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220103081610.6656-3-vishakha.joshi@intel.com>
Date:   Mon,  3 Jan 2022 13:46:10 +0530
From:   vishakha.joshi@...el.com
To:     thierry.reding@...il.com
Cc:     u.kleine-koenig@...gutronix.de, lee.jones@...aro.org,
        linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
        andriy.shevchenko@...ux.intel.com, jarkko.nikula@...ux.intel.com,
        vijayakannan.ayyathurai@...el.com, bala.senthil@...el.com,
        tamal.saha@...el.com, lakshmi.bai.raja.subramanian@...el.com,
        vishakha.joshi@...el.com
Subject: [PATCH v1 2/2] pwm: Update the REPEAT_COUNT value

From: Vishakha Joshi <vishakha.joshi@...el.com>

Update the count value in the PWM_LEADIN register.

Signed-off-by: Vishakha Joshi <vishakha.joshi@...el.com>
---
 drivers/pwm/pwm-keembay.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pwm/pwm-keembay.c b/drivers/pwm/pwm-keembay.c
index 733811b05721..4494e54e23b8 100644
--- a/drivers/pwm/pwm-keembay.c
+++ b/drivers/pwm/pwm-keembay.c
@@ -128,11 +128,14 @@ static int keembay_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 	if (state->polarity != PWM_POLARITY_NORMAL)
 		return -EINVAL;
 
+	if (state->count > KMB_PWM_COUNT_MAX)
+		return -EINVAL;
+
 	/*
-	 * Configure the pwm repeat count as infinite at (15:0) and leadin
-	 * low time as 0 at (30:16), which is in terms of clock cycles.
+	 * Configure the PWM repeat count at (15:0) and LEADIN low time as 0 at
+	 * (30:16), which is in terms of clock cycles.
 	 */
-	keembay_pwm_update_bits(priv, KMB_PWM_LEADIN_MASK, 0,
+	keembay_pwm_update_bits(priv, KMB_PWM_LEADIN_MASK, state->count,
 				KMB_PWM_LEADIN_OFFSET(pwm->hwpwm));
 
 	keembay_pwm_get_state(chip, pwm, &current_state);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ