From patchwork Thu May 11 13:32:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 92604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4379061vqo; Thu, 11 May 2023 06:39:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zm/etYX1t8t23lfzMm6rdXWX1dEWd++wVnOhqtXfTLOS6HroG/0lbwclzPK/uU26FLL3s X-Received: by 2002:a17:902:dac9:b0:1ac:d03a:9702 with SMTP id q9-20020a170902dac900b001acd03a9702mr6839981plx.67.1683812365750; Thu, 11 May 2023 06:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683812365; cv=none; d=google.com; s=arc-20160816; b=lopiqyN3oGZ7+Wra6kX4LsYFm9d2seERtqnyJ6tQPYsz0O7RCDkJp7fNOoQYXFE4v8 x+GqzDjqpgduHrdWFYYdlKWxboG+1ycehRL4HRsonlJrI4uaES3/WUfYQ2uAjSePfhgo jonDl0aTBIlCsd5vcRvimdBlxdcU9PNL2h8hROglUmu0v57U8qwCMNqIaxX+JkzSZxJU 2goDNptVojbtDTUsTYvFV+avqZo+siYWmCzj/6RmOW7vcTZRXnlw3Jh7DYMjlCqFuc24 UHqBkVFF8zHEmPwS9hk9eBrJzAy2BrkYkZuSXyL5cpghnkNnRx6CT2Ev0ksC6mRlGsDH 9FnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/UFGhB83ROP440y4JzZ2DWi4wx7mDPzfDrtis1oh0Uc=; b=ClPDUO5vgz4HZ+U3rvP3Rbkw1jVXMGEQMsuOK6eCRHLzYVoiSMGo+spLJt66uzOb36 PSel28JZMWqlFhRrLgBiVcXuY7dPTMDuO9W9Cfcx24/aejZlvtEqn2hW5mrJqGVyItj+ dQSUAhtCxn1DBFHlSBBhG/Zoidwp7n2do+mw9ePR9pQS6wjg7sKhXUwZyx1t8MJdHtwp a3UqMb1T6P16PfDi2Y1TNY2jHUUACCwTL5/i81wdu/L/oFBmYOeRVC76A3kQFiHSh2FC QCIvJSmdn2oUTDpv2xcLvdtraQ1k36o0l2JNSX+j5dpkdsYJpK8nXQvTqHOVzlZMGNyI djGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=j61F2EZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a170903018300b001ac671a8fd3si7410171plg.110.2023.05.11.06.39.13; Thu, 11 May 2023 06:39:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=j61F2EZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238357AbjEKNeJ (ORCPT + 99 others); Thu, 11 May 2023 09:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238280AbjEKNdb (ORCPT ); Thu, 11 May 2023 09:33:31 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB97F9EE6 for ; Thu, 11 May 2023 06:32:40 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-30796c0cbcaso4969766f8f.1 for ; Thu, 11 May 2023 06:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1683811959; x=1686403959; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/UFGhB83ROP440y4JzZ2DWi4wx7mDPzfDrtis1oh0Uc=; b=j61F2EZHIzVROnVnEJ5dWEjJ++EssalrBvY6bt/WB/zE+mHTfRUUC/bBLbEd7+yPl6 RX8i5zBHeuDrZGi+bAPCxS1N991+YDw3bs5Zy6SAnO/xM/UudkTyW4UgDraICDPSf0/I RECDKvfIjuag395gnx5RBeyaOahlsldWTVmNJrb5bFCd2AFM8Qf9VbXRqbeqTfRbpPAa 1CeZH70bHm/Pbt2PyULvdqvNP2tnNQ2ufDY8zlryLlFsHPdx1AzWPUJJ3QSnFUSYgRjk 2lMw0iTxLG9t0Cbw7IhYC2ioUqEjinWoW4QCUgSMcDQNnMe5Dpl/5VMizBghngXbBcU2 I5ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683811959; x=1686403959; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/UFGhB83ROP440y4JzZ2DWi4wx7mDPzfDrtis1oh0Uc=; b=Fl87ZYWLolm1kUWH+dppw6BYd/HdadRR9dgvl1IOw+f4p1+xqqVd7du2lbZibsOwei GdVRPgHXALZoVhn6Cj36ivtu0E2qxxXDJ9gsAujJohGAbhMDmXbKPHF/NKb8KPk5HfJK YoS5NwgemKl4uYOxhHw93MstlL4FSASF+0Y8jhnTfMHfFrQ8v39eiANa94Nq6GV4cCb7 RpL5Lx1dPOFvPtiiiJe0PTjxN96kiFpO3evO/xdw4hvDhuHWpMlC8XEf2jtygCEOQkyH D0IGTNL55r1vAUUMskGub8ZhuejajOqk4kXyKBi9o8j4PTqI3Jc+oQmaKwKN6ieMMzJB q+KA== X-Gm-Message-State: AC+VfDzVuwWC7+jz6hrBe9NRpKCyEF1uOIXgesKASkpZJJ1clIHXOEmO Hau9EL8BnPfJsVMe5VaU8Aei1g== X-Received: by 2002:adf:e690:0:b0:2e8:b9bb:f969 with SMTP id r16-20020adfe690000000b002e8b9bbf969mr15481747wrm.0.1683811958720; Thu, 11 May 2023 06:32:38 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4090:a246:80f3:ef71:25ff:df82:9cc9]) by smtp.gmail.com with ESMTPSA id a15-20020adff7cf000000b002f6176cc6desm20479025wrq.110.2023.05.11.06.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 06:32:38 -0700 (PDT) From: Markus Schneider-Pargmann To: Michael Turquette , Stephen Boyd , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Markus Schneider-Pargmann , Alexandre Mergnat Subject: [PATCH] clk: mediatek: mt8365: Fix inverted topclk operations Date: Thu, 11 May 2023 15:32:26 +0200 Message-Id: <20230511133226.913600-1-msp@baylibre.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765605235087123980?= X-GMAIL-MSGID: =?utf-8?q?1765605235087123980?= The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work. Fixed by swapping the operations with the inverted ones. Reported-by: Alexandre Mergnat Fixes: 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks") Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno --- drivers/clk/mediatek/clk-mt8365.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt8365.c b/drivers/clk/mediatek/clk-mt8365.c index 6b4e193f648d..6d785ec5754d 100644 --- a/drivers/clk/mediatek/clk-mt8365.c +++ b/drivers/clk/mediatek/clk-mt8365.c @@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = { #define GATE_TOP0(_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &top0_cg_regs, \ - _shift, &mtk_clk_gate_ops_no_setclr_inv) + _shift, &mtk_clk_gate_ops_no_setclr) #define GATE_TOP1(_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &top1_cg_regs, \ - _shift, &mtk_clk_gate_ops_no_setclr) + _shift, &mtk_clk_gate_ops_no_setclr_inv) #define GATE_TOP2(_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &top2_cg_regs, \ - _shift, &mtk_clk_gate_ops_no_setclr) + _shift, &mtk_clk_gate_ops_no_setclr_inv) static const struct mtk_gate top_clk_gates[] = { GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),