From owner-svn-src-head@freebsd.org Tue Apr 26 12:36:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E43B1C301; Tue, 26 Apr 2016 12:36:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 703171D41; Tue, 26 Apr 2016 12:36:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QCaC7v090144; Tue, 26 Apr 2016 12:36:12 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCaCS1090143; Tue, 26 Apr 2016 12:36:12 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604261236.u3QCaCS1090143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 26 Apr 2016 12:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298634 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:36:13 -0000 Author: jmcneill Date: Tue Apr 26 12:36:12 2016 New Revision: 298634 URL: https://svnweb.freebsd.org/changeset/base/298634 Log: Fix calculation of LCD CH1 SCLK1 output frequency when SCLK2 /2 is used as source. PR: 208680 Reported by: David Binderman Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_lcdclk.c Tue Apr 26 12:33:25 2016 (r298633) +++ head/sys/arm/allwinner/clk/aw_lcdclk.c Tue Apr 26 12:36:12 2016 (r298634) @@ -266,7 +266,7 @@ static int aw_lcdclk_recalc_freq(struct clknode *clk, uint64_t *freq) { struct aw_lcdclk_softc *sc; - uint32_t val, m; + uint32_t val, m, src_sel; sc = clknode_get_softc(clk); @@ -281,7 +281,8 @@ aw_lcdclk_recalc_freq(struct clknode *cl *freq = *freq / m; if (sc->id == CLK_IDX_CH1_SCLK1) { - if ((val & CH1_SCLK1_SEL) == CH1_SCLK1_SEL_SCLK2_DIV2) + src_sel = (val & CH1_SCLK1_SEL) >> CH1_SCLK1_SEL_SHIFT; + if (src_sel == CH1_SCLK1_SEL_SCLK2_DIV2) *freq /= 2; }