svn commit: r335581 - head/sys/arm/allwinner/clkng

Emmanuel Vadot manu at FreeBSD.org
Sat Jun 23 15:03:56 UTC 2018


Author: manu
Date: Sat Jun 23 15:03:54 2018
New Revision: 335581
URL: https://svnweb.freebsd.org/changeset/base/335581

Log:
  allwinner: clkng: Correct mux width and flags
  
  The test for checking if the clock have a mux was inverted and the mask
  to calculate the parent index was wrong was wrong too.
  It means that upon creation the incorrect parent was resolved as the current
  one and upon reparent the switch was never made.
  
  Pointy hat (lots of them): manu

Modified:
  head/sys/arm/allwinner/clkng/aw_clk_nkmp.c
  head/sys/arm/allwinner/clkng/aw_clk_nm.c

Modified: head/sys/arm/allwinner/clkng/aw_clk_nkmp.c
==============================================================================
--- head/sys/arm/allwinner/clkng/aw_clk_nkmp.c	Sat Jun 23 10:41:52 2018	(r335580)
+++ head/sys/arm/allwinner/clkng/aw_clk_nkmp.c	Sat Jun 23 15:03:54 2018	(r335581)
@@ -128,12 +128,12 @@ aw_clk_nkmp_set_mux(struct clknode *clk, int index)
 
 	sc = clknode_get_softc(clk);
 
-	if ((sc->flags & AW_CLK_HAS_MUX) != 0)
+	if ((sc->flags & AW_CLK_HAS_MUX) == 0)
 		return (0);
 
 	DEVICE_LOCK(clk);
 	READ4(clk, sc->offset, &val);
-	val &= ~(sc->mux_mask >> sc->mux_shift);
+	val &= ~sc->mux_mask;
 	val |= index << sc->mux_shift;
 	WRITE4(clk, sc->offset, val);
 	DEVICE_UNLOCK(clk);

Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c
==============================================================================
--- head/sys/arm/allwinner/clkng/aw_clk_nm.c	Sat Jun 23 10:41:52 2018	(r335580)
+++ head/sys/arm/allwinner/clkng/aw_clk_nm.c	Sat Jun 23 15:03:54 2018	(r335581)
@@ -125,12 +125,12 @@ aw_clk_nm_set_mux(struct clknode *clk, int index)
 
 	sc = clknode_get_softc(clk);
 
-	if ((sc->flags & AW_CLK_HAS_MUX) != 0)
+	if ((sc->flags & AW_CLK_HAS_MUX) == 0)
 		return (0);
 
 	DEVICE_LOCK(clk);
 	READ4(clk, sc->offset, &val);
-	val &= ~(sc->mux_mask >> sc->mux_shift);
+	val &= ~sc->mux_mask;
 	val |= index << sc->mux_shift;
 	WRITE4(clk, sc->offset, val);
 	DEVICE_UNLOCK(clk);


More information about the svn-src-all mailing list