Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp33918pxj; Wed, 16 Jun 2021 19:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4QYozxw9Llkmv1tM5TC0eTH2Tga9Kq8TTOPhN6vjQxewncTfZL3ndWrRAdPL2qhJKYwPV X-Received: by 2002:aa7:c845:: with SMTP id g5mr3379611edt.306.1623897047680; Wed, 16 Jun 2021 19:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623897047; cv=none; d=google.com; s=arc-20160816; b=vdBxQCp5saAO78L6kXtRoJy2OoUAAoSsMwk0yhQVZzpfCPwcPV2y4zDbQehOUvPcze 4oTkhO/pxjTpF9azhWz4zAVDFyxB9IV9pyTPe8WWLtLhBkMHLbO0TntQCuMCHJXBtxU2 ElDxabBejVKEmpjO60ORotkvZ+F3dneKKAy+/Qz4jrKAw+q4z61SUBWnDUZcQ+N6EBRQ E3RCn91juO89iVlNeg9w8jZR+kt7GFtteZPNCK+T3WQWO6nwtuNgVTruEwZ7Yag/KP9e M4dCThwbkx6Pz25lxgrn5Z0ZxCDFTtdbhFJfwARTG/RQt/UhtxcFfxUQz2Rjs20GZh+/ ozfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=IBB4ojDz4LUz+X+ufh1aglcdACsqvTX70eCXK7YqOt4=; b=tknLPJamjHdrmO8so+R9onosOqL+HVf0ZBp40cEPoCiBbw0f5wQzVZPw0APCcWnxoj zexgUhcUIkQ4cP9U4Lge8pjTHk5t6cRuPH9TTdH7TRJ/RdnARhNqccMAZi2lRUvRuFyC PWK/W1fDsUroz3s7ieRhb1GbDiCPfd0JnAEKrj21UnFjyer6xMAYijuVhJMzSHySrgQp IJ9haEOm7TJuAlQKkkjbLTsLD0xYXqxNixTVo5e8zH648KLB7rovcIk8EsPzad73JKgp rVDzJ1HBdkPLbUhRNFlHGqLIJUUKbP3TX3Y3oSeZIFY5veputAPRfqq2zz0lQr4kqCws x6rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si3703437edd.408.2021.06.16.19.30.25; Wed, 16 Jun 2021 19:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234190AbhFPWvf (ORCPT + 99 others); Wed, 16 Jun 2021 18:51:35 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:33228 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234231AbhFPWvc (ORCPT ); Wed, 16 Jun 2021 18:51:32 -0400 X-UUID: b941abc295ca46e99e818863ffc78dbb-20210617 X-UUID: b941abc295ca46e99e818863ffc78dbb-20210617 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1949136275; Thu, 17 Jun 2021 06:49:22 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Jun 2021 06:49:20 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 17 Jun 2021 06:49:20 +0800 From: Chun-Jie Chen To: Matthias Brugger , Stephen Boyd , Nicolas Boichat , Rob Herring CC: , , , , , , , Chun-Jie Chen Subject: [PATCH 03/22] clk: mediatek: Fix corner case of tuner_en_reg Date: Thu, 17 Jun 2021 06:47:24 +0800 Message-ID: <20210616224743.5109-4-chun-jie.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210616224743.5109-1-chun-jie.chen@mediatek.com> References: <20210616224743.5109-1-chun-jie.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On MT8195, tuner_en_reg is moved to register offest 0x0. If we only judge by tuner_en_reg, it may lead to wrong address. Add tuner_en_bit to the check condition. And it has been confirmed, on all the MediaTek SoCs, bit0 of offset 0x0 is always occupied by clock square control. Signed-off-by: Chun-Jie Chen --- drivers/clk/mediatek/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index 7fb001a4e7d8..99ada6e06697 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -332,7 +332,7 @@ static struct clk *mtk_clk_register_pll(const struct mtk_pll_data *data, pll->pcw_chg_addr = pll->base_addr + REG_CON1; if (data->tuner_reg) pll->tuner_addr = base + data->tuner_reg; - if (data->tuner_en_reg) + if (data->tuner_en_reg || data->tuner_en_bit) pll->tuner_en_addr = base + data->tuner_en_reg; if (data->en_reg) pll->en_addr = base + data->en_reg; -- 2.18.0