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  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]
Date:	Sun,  4 Jan 2015 17:12:56 -0800
From:	Tim Kryger <tim.kryger@...il.com>
To:	Thierry Reding <thierry.reding@...il.com>,
	Scott Branden <sbranden@...adcom.com>,
	Arun Ramamurthy <arunrama@...adcom.com>,
	Jonathan Richardson <jonathar@...adcom.com>
Cc:	Ray Jui <rjui@...adcom.com>, Linux PWM <linux-pwm@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Broadcom Kernel Feedback 
	<bcm-kernel-feedback-list@...adcom.com>,
	Tim Kryger <tim.kryger@...il.com>
Subject: [PATCH 2/2] drivers: pwm: bcm-kona: Dont set polarity in probe

From: Arun Ramamurthy <arunrama@...adcom.com>

Omit setting the polarity to normal during probe and instead use the
new pwmchip_add_inversed function to register a PWM chip with default
polarity of inversed for all channels as this is the actual hardware
default.

Signed-off-by: Arun Ramamurthy <arunrama@...adcom.com>
Reviewed-by: Ray Jui <rjui@...adcom.com>
Signed-off-by: Scott Branden <sbranden@...adcom.com>
Signed-off-by: Tim Kryger <tim.kryger@...il.com>
---

This is based on Arun's patch (originally posted by Scott)

https://lkml.org/lkml/2014/11/25/1019

I modified it to use the pwmchip_add_inversed function so the polarity
could be safely left at the power on default and updated the commit
message accordingly.

 drivers/pwm/pwm-bcm-kona.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c
index 02bc048..32b3ec6 100644
--- a/drivers/pwm/pwm-bcm-kona.c
+++ b/drivers/pwm/pwm-bcm-kona.c
@@ -266,18 +266,15 @@ static int kona_pwmc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	/* Set smooth mode, push/pull, and normal polarity for all channels */
-	for (chan = 0; chan < kp->chip.npwm; chan++) {
-		value |= (1 << PWM_CONTROL_SMOOTH_SHIFT(chan));
+	/* Set push/pull for all channels */
+	for (chan = 0; chan < kp->chip.npwm; chan++)
 		value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan));
-		value |= (1 << PWM_CONTROL_POLARITY_SHIFT(chan));
-	}
 
 	writel(value, kp->base + PWM_CONTROL_OFFSET);
 
 	clk_disable_unprepare(kp->clk);
 
-	ret = pwmchip_add(&kp->chip);
+	ret = pwmchip_add_inversed(&kp->chip);
 	if (ret < 0)
 		dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists