From patchwork Wed Feb 27 10:02:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshay Saraswat X-Patchwork-Id: 223568 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9DDFE2C0084 for ; Wed, 27 Feb 2013 20:43:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A336A4A029; Wed, 27 Feb 2013 10:43:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zIa++qFrsZ-E; Wed, 27 Feb 2013 10:43:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 62A4B4A03E; Wed, 27 Feb 2013 10:42:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 943454A02A for ; Wed, 27 Feb 2013 10:42:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FEfzPwxF4BDL for ; Wed, 27 Feb 2013 10:42:25 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by theia.denx.de (Postfix) with ESMTP id 1DC4B4A026 for ; Wed, 27 Feb 2013 10:42:24 +0100 (CET) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MIV00HZCHLR3VL0@mailout1.samsung.com> for u-boot@lists.denx.de; Wed, 27 Feb 2013 18:42:18 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 9B.16.17763.9F4DD215; Wed, 27 Feb 2013 18:42:18 +0900 (KST) X-AuditID: cbfee690-b7f6b6d000004563-35-512dd4f96d73 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C3.30.03918.9F4DD215; Wed, 27 Feb 2013 18:42:17 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MIV00MJRHM5Q470@mmp2.samsung.com>; Wed, 27 Feb 2013 18:42:17 +0900 (KST) From: Akshay Saraswat To: u-boot@lists.denx.de Date: Wed, 27 Feb 2013 05:02:41 -0500 Message-id: <1361959366-27634-5-git-send-email-akshay.s@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1361959366-27634-1-git-send-email-akshay.s@samsung.com> References: <1361959366-27634-1-git-send-email-akshay.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRmVeSWpSXmKPExsWyRsSkWvfXFd1Ag8+vGC2mPjjHaPFtyzZG i7d7O9kdmD1mN1xk8dg56y67x9k7OxgDmKO4bFJSczLLUov07RK4Mlq/NzEVrOKs+L30JXMD 4y32LkYODgkBE4n/3zm7GDmBTDGJC/fWs3UxcnEICSxllGhd2cYOkTCR+N05gR0iMZ1RYuPF PUwQTi+TxMY/F8Gq2AR0JLYv+Q5miwhISPzqv8oIsoFZQEPi8Tt1kLCwQLzEhvnPmEBsFgFV iUkrTrCC2LwCLhKP1k9jhVgmJ/FhzyOwMZ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/d3nPmxI1/ 4fIzvCZ8103Z5Z562bYjruZ4oZF6oar4fmXfT/ZxFk/2LBLZfadE49mhb6kH2q03C6657LTk 2tHC40t2CfPVrf5okv9ngmmyi8XXn5NuTDVfUcnvVsnd/f/Z/qu1DGvbCk5k6gQ+3fprfrrE jnLzy+qKSizFGYmGWsxFxYkApiols8kCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Subject: [U-Boot] [PATCH 4/9] Exynos: Avoid a divide by zero by specifying a non-zero period for pwm 4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The pwm_config function in the exynos pwm driver divides by its period period parameter. A function was calling pwm_config with a 0ns period and a 0ns duty cycle. That doesn't actually make any sense physically, and results in a divide by zero in the driver. This change changes the paremters to be a 100000ns period and duty cycle. TEST=sf probe 1:0; time sf read 40008000 0 1000 Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Gabe Black Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- arch/arm/cpu/armv7/s5p-common/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c index de61405..6a0fa58 100644 --- a/arch/arm/cpu/armv7/s5p-common/timer.c +++ b/arch/arm/cpu/armv7/s5p-common/timer.c @@ -58,7 +58,7 @@ int timer_init(void) { /* PWM Timer 4 */ pwm_init(4, MUX_DIV_4, 0); - pwm_config(4, 0, 0); + pwm_config(4, 100000, 100000); pwm_enable(4); /* Use this as the current monotonic time in us */