From patchwork Wed Oct 16 13:13:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 176472 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7153233ocf; Wed, 16 Oct 2019 06:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNmpVnvgAWxfbuoCF+Bl4z2tMl7ZETqZbqnbxIzyLuQnsjhGCQgDWXLC4tejDRhLpm2qBp X-Received: by 2002:a05:6402:12ca:: with SMTP id k10mr39089543edx.91.1571231619003; Wed, 16 Oct 2019 06:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571231618; cv=none; d=google.com; s=arc-20160816; b=HhZ+RlJm9eVHq4EscTW4RLBmbqGQTqoKpHWove4eNBLfbP2anA9I+ie0/0npIs8A1J 23KxmFFUMs1y0o3ShAyYgZ19LEN9LFL1vhww5Ufs2lsMaIwQMHW/h3hljmEo+lQ43kFh lHFtCSe49XW66DDu/L7d+SZhyx+zTokgAyZrFTXYdyg9z3+N+qGqwQ07RfcD9tIxPd5F q/o5Mx8eEdHDfyRwvPXzRDifZpiWD1AkjeEaIks0czMMeo7PeyjOHHXrpp/APp5d7M0D OIU2QaZc12KVflGr17ftWuGFuZdWypYTNhnB2waLwAgYDLTX8+G/H7VHXF1b2MiHEzds PbvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=C3WMejLIjX/sN4h8RDr6kyJEZVhRO/kXeqFDRFF6Id8=; b=NBVwXq8kFJxJAlDE+stXpsanI3TTGaKDzQmaD9rlD5D9KKVgxKcBWoNSjoYicsmISe 7F+fEO5ASvKSdzX+Wf1zAONQiflZ27WiZKoHx64MtXxflBzQLHTMSBOv2fs452e3YZXb FpRqGYQPo3RIM7vnSF1pTpwCbQbl+nV3M0SpnLeMyyF4hru+Gdztsz0ftL3pRlQxKzGP 7Wow0n90mtWlVxuBMoVaUKTVT/s+mGyqswt02bi9E7M+xsVtzBwIixmvDyhLUSl5h2AN O4NPhcbXnOUxWDTHcpsmt6soFSobpeGPXM0DuiwPv7spI/CpDtEbNhg6ZZrt/TbYibG0 9bkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lbZlVSMX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si15907451edh.372.2019.10.16.06.13.38; Wed, 16 Oct 2019 06:13:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lbZlVSMX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393548AbfJPNNf (ORCPT + 26 others); Wed, 16 Oct 2019 09:13:35 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35738 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728176AbfJPNNe (ORCPT ); Wed, 16 Oct 2019 09:13:34 -0400 Received: by mail-pg1-f196.google.com with SMTP id p30so14294208pgl.2; Wed, 16 Oct 2019 06:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C3WMejLIjX/sN4h8RDr6kyJEZVhRO/kXeqFDRFF6Id8=; b=lbZlVSMXAaG45YMMWa8UqrZlE3mNsCasc5BFMYhZcETMQqmJCvgmOTLr7gfz8HrKHu eEdTYOcFOGto7xSuq4Ubox4D2RUcQXEtZbmkFSB/I/JDek6+CuHQ+WWMPQTHIs/Mk/mP qXFlhQxgDQQMvILeKOUlNYmP7iCbES0YFtXHKZGxxvUTQcFZypFfH5dHUzdQLJ/Qpv+d h3HtGKJHsCkcxMoKujCuTiPiTt1JRu3lR+jbO/Crwj7/pGNEX6sXJOJnk2P+T2/Xnan8 5l9QrDaWaeEXuS7aPnU4jZq+Km9U5QgJJgLrtR+qcC4JIka0Vh6UmV871gOHIJrimT6I uJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=C3WMejLIjX/sN4h8RDr6kyJEZVhRO/kXeqFDRFF6Id8=; b=eW84I/8sIG+AvtGCvbkQObt50qlegioBy+Tf38GwAK3SBjtM1yaJqL3jmYtzXmJILV VYltFYkEJ5E3bLPq5/e4YdMuyZ2blNgb71d1CY8WbwbWKO23AXDbRZGH3FwlD/j+etaW 24nIbhE28qEyNvV/XmEkZVudWf3xhHDxGIYdHaCqMZ64rXMEU2Ms0q1bPZlq4Zx7FJZ7 iZytYiIRMpjalOvarSvPGE0ad9amjCddd+zp+GkAfLpnIQs2ga2vJGV7v9oVVYKF2yTJ CwB7sQ8O6fY5Zx8IEXbxaPzvt4mytqqj0dt2LVJq2NDb5W43TIaaNCGXIdTko7+Z/DA0 4lYw== X-Gm-Message-State: APjAAAUjs10LPHmhjyg9AV62H9cL45KSSNQIISkgoXeSg9cO84AtJaxi xrK4i56Xd4vDX2WmHXUn89o= X-Received: by 2002:a17:90a:a781:: with SMTP id f1mr5116963pjq.29.1571231613537; Wed, 16 Oct 2019 06:13:33 -0700 (PDT) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id n3sm28433569pff.102.2019.10.16.06.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 06:13:32 -0700 (PDT) From: Joel Stanley To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-aspeed@lists.ozlabs.org, Andrew Jeffery Subject: [PATCH] clk: ast2600: Fix enabling of clocks Date: Wed, 16 Oct 2019 23:43:19 +1030 Message-Id: <20191016131319.31318-1-joel@jms.id.au> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct clk_ops enable callback for the aspeed gates mixes up the set to clear and write to set registers. Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC") Reviewed-by: Andrew Jeffery Signed-off-by: Joel Stanley --- drivers/clk/clk-ast2600.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.23.0 diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c index 1c1bb39bb04e..b1318e6b655b 100644 --- a/drivers/clk/clk-ast2600.c +++ b/drivers/clk/clk-ast2600.c @@ -266,10 +266,11 @@ static int aspeed_g6_clk_enable(struct clk_hw *hw) /* Enable clock */ if (gate->flags & CLK_GATE_SET_TO_DISABLE) { - regmap_write(gate->map, get_clock_reg(gate), clk); - } else { - /* Use set to clear register */ + /* Clock is clear to enable, so use set to clear register */ regmap_write(gate->map, get_clock_reg(gate) + 0x04, clk); + } else { + /* Clock is set to enable, so use write to set register */ + regmap_write(gate->map, get_clock_reg(gate), clk); } if (gate->reset_idx >= 0) {