From patchwork Fri Mar 22 04:25:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AS50 KCHSU0 X-Patchwork-Id: 10864891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10B19922 for ; Fri, 22 Mar 2019 04:50:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB01A2A5E2 for ; Fri, 22 Mar 2019 04:50:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAFD12A5E1; Fri, 22 Mar 2019 04:50:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 83B032A5E1 for ; Fri, 22 Mar 2019 04:50:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1375E15D6; Fri, 22 Mar 2019 05:25:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1375E15D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553228800; bh=dxcTNQve+yWxttdIVqaSmahHIng5se89v26mEoe4pyg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dBHH8Sohgz0b2HQTgBrOYSky9Y1Uzeq17poQnMK6cug1FWqS8N3CI+awHgP1oTEqD MfHFGkAxQzeT/+wKbk0H4h2dhiVigkr/6zsAlCASZXouyAd0H/ppARn8TAsvDC0deA OQ7X7gkf4HsvyBayLLP2cGxUXZLmmEZ3/jpvlRTw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 81ACDF89674; Fri, 22 Mar 2019 05:25:49 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id DC483F89678; Fri, 22 Mar 2019 05:25:47 +0100 (CET) Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by alsa1.perex.cz (Postfix) with ESMTP id B9519F89670 for ; Fri, 22 Mar 2019 05:25:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B9519F89670 Received: from NTHCCAS01.nuvoton.com (nthccas01.nuvoton.com [10.1.8.28]) by maillog.nuvoton.com (Postfix) with ESMTP id 91AAC1C80D12; Fri, 22 Mar 2019 12:25:38 +0800 (CST) Received: from NTHCML01B.nuvoton.com (10.1.8.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 22 Mar 2019 12:25:38 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCML01B.nuvoton.com (10.1.8.178) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 22 Mar 2019 12:25:38 +0800 Received: from localhost.localdomain (10.4.36.27) by NTHCCAS01.nuvoton.com (10.1.12.25) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Fri, 22 Mar 2019 12:25:37 +0800 From: John Hsu To: Date: Fri, 22 Mar 2019 12:25:35 +0800 Message-ID: <20190322042535.30650-1-KCHSU0@nuvoton.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190313064718.4534-1-KCHSU0@nuvoton.com> References: <20190313064718.4534-1-KCHSU0@nuvoton.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, WTLI@nuvoton.com, John Hsu , lgirdwood@gmail.com, YHCHuang@nuvoton.com, CTLIN0@nuvoton.com Subject: [alsa-devel] [PATCH] ASoC: nau8810: fix the issue of 64 bits division X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Do division with div_u64 for the PLL calculation. These errors are fixed and list as follows: 1."__udivdi3" [sound/soc/codecs/snd-soc-nau8810.ko] undefined! 2."__aeabi_uldivmod" [sound/soc/codecs/snd-soc-nau8810.ko] undefined! 3. nau8810.c:(.text.nau8810_calc_pll+0xd8): undefined reference to `__udivdi3' Signed-off-by: John Hsu --- sound/soc/codecs/nau8810.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index 125e205e6687..dd82c65cfa7f 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -505,7 +505,8 @@ static int nau8810_calc_pll(unsigned int pll_in, f2_max = 0; scal_sel = ARRAY_SIZE(nau8810_mclk_scaler); for (i = 0; i < ARRAY_SIZE(nau8810_mclk_scaler); i++) { - f2 = 256ULL * fs * 4 * nau8810_mclk_scaler[i] / 10; + f2 = 256ULL * fs * 4 * nau8810_mclk_scaler[i]; + f2 = div_u64(f2, 10); if (f2 > NAU_PLL_FREQ_MIN && f2 < NAU_PLL_FREQ_MAX && f2_max < f2) { f2_max = f2;