From patchwork Thu Feb 28 10:59:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshay Saraswat X-Patchwork-Id: 223871 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 E9E4D2C0091 for ; Thu, 28 Feb 2013 21:39:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11EA74A027; Thu, 28 Feb 2013 11:39:43 +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 Ww8X-2MTMXci; Thu, 28 Feb 2013 11:39:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B9214A048; Thu, 28 Feb 2013 11:39:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8DCA74A01E for ; Thu, 28 Feb 2013 11:39:05 +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 EZOAGAObrtPr for ; Thu, 28 Feb 2013 11:39:04 +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 3703A4A025 for ; Thu, 28 Feb 2013 11:39:01 +0100 (CET) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MIX00FB5EWUBNH0@mailout1.samsung.com> for u-boot@lists.denx.de; Thu, 28 Feb 2013 19:39:01 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 1C.44.25214.5C33F215; Thu, 28 Feb 2013 19:39:01 +0900 (KST) X-AuditID: cbfee68e-b7fa46d00000627e-fa-512f33c5b55c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 2F.55.03880.5C33F215; Thu, 28 Feb 2013 19:39:01 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MIX001ILEWPCT50@mmp1.samsung.com> for u-boot@lists.denx.de; Thu, 28 Feb 2013 19:39:01 +0900 (KST) From: Akshay Saraswat To: u-boot@lists.denx.de Date: Thu, 28 Feb 2013 05:59:19 -0500 Message-id: <1362049164-10297-5-git-send-email-akshay.s@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1362049164-10297-1-git-send-email-akshay.s@samsung.com> References: <1362049164-10297-1-git-send-email-akshay.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsWyRsSkTveosX6gwf5+LYu3ezvZHRg9zt7Z wRjAGMVlk5Kak1mWWqRvl8CVseDsPJaCxVwVl1aqNjBu5+hi5OSQEDCR+HahnQXCFpO4cG89 WxcjF4eQwFJGiVOXdrLCFJ1c8YwdIrGIUeLEowlQzjImifknNoFVsQnoSGxf8p0dxBYRkJD4 1X+VEcRmFnCU2HfkGxOILSyQJLF2dS8ziM0ioCrxuGM5WC+vgItE49KzbBDb5CQ+7HkENIeD g1PAVeJhtxFIWAio5NLPL6wge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Qk777H7vw5tfiJ5gOiLVzdW+u3ub+drn+ZznyudPCdx1cZWhqS3DSq8/S+Jb1t24 vuTmFv1Ytxn/lW79UH52U6Hu3CmjE0vfS4uUn+z79OjKisdC79u/KrEUZyQaajEXFScCAG5n Rqu0AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: prashanth.g@samsung.com Subject: [U-Boot] [PATCH 4/9 v2] 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 with command "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 --- Changes since v1: - Added "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 */