Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp210734pxa; Tue, 11 Aug 2020 00:30:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9injchkg4EBcxp8BoyBxaBRt3IndIIf5+ejK8OLzeVvzPpdnqXgYb40baPmaozzVMbOGM X-Received: by 2002:aa7:c88f:: with SMTP id p15mr25080814eds.33.1597131003257; Tue, 11 Aug 2020 00:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597131003; cv=none; d=google.com; s=arc-20160816; b=jlphPkNwgXymPxxUzJw+e/nbEwSpmidrmc1fIN5SH7eUX4k/sa+TGSpECWb8MaAU9t VALqhgodrpw1HlOh5NnDnlxQHAZxK30yNq1syA4/ayBWhLI8UNlmxln3n2lnKOO5+lvx czdTIGsGc5IsNNAjRCyiLYbJsTk3gx6TPYUKDbTBYUMHL9679JtWdtduHt3vTWJQEIxv heGxB9H1srwGdjI4oHrXHHojQS24plskooTSliAIyv3ClNKZxlWJXUai+3TWQNQx5LGK 1EpccDqI9ejEcuJ+CTZ7mt8E/ooe1IEnIgJK9g2IhDS75AiEmTStGwlPCIBQuJsEvelm 3sOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VNS8rgxQTsSqkuQvisEfuQkArMcjZwTTMFnULFhcBtc=; b=zsG97hduB6llrslLtSaDvNuCpa5CsQaq8mhLxKfHJFjYmVsOBacBvwga71rwXY/eJQ Lr9BTNa9ONA0oUa3eV+S9h1mddDlK+AgamhFv0rqJFYgF65JKsoIN0cFXbR5q419chuG EK2bKX3PT8mcL9ZVqZ55cO8jpaIJ5NZIh0CmM3zl/wEUnFl1XX0J/E4aysmDzxLNy3G2 uOYFD4bLYiGZYSbmoGkx8c+viyihjtycuAX0w3LNnfaE1nYC06TyqWqRYmMGdwxfyqz/ RdKeJbDBH2x57QUBhgdbGcX9ljv4kpWx828DZ0emMt6te/K3rFPZdlmMevXBzWD5giB6 fS/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I4zF9BZf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si13209189ejy.245.2020.08.11.00.29.39; Tue, 11 Aug 2020 00:30:03 -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; dkim=pass header.i=@chromium.org header.s=google header.b=I4zF9BZf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728143AbgHKH2m (ORCPT + 99 others); Tue, 11 Aug 2020 03:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbgHKH2l (ORCPT ); Tue, 11 Aug 2020 03:28:41 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A9BEC061787 for ; Tue, 11 Aug 2020 00:28:41 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id w17so1234964edt.8 for ; Tue, 11 Aug 2020 00:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VNS8rgxQTsSqkuQvisEfuQkArMcjZwTTMFnULFhcBtc=; b=I4zF9BZfsZmsK7v24MOsVh7XvfpQcnthAJ+k+iaowWwFaGJKa8I19900B1KW4J28/g QR7nxd0IiU11LQkTVy/3+d7XPpi7vGdQov5nIi0/DWk2Kvl23qwuigMTXNJztOHnjsoM /thmEzj30fA5G4XJFAH1TYiYY+DDEeFHE12gU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VNS8rgxQTsSqkuQvisEfuQkArMcjZwTTMFnULFhcBtc=; b=AKdlMDbrpniZdwtE+mZfsfjnBx+nhaItMwWXWJWgLPhRWicHtsFuNn1iMcGrQw6KW7 UxR22ic/D267DH03WSm7UA2vwPTCbDBE5XzDy40LJNZ9uS+O7mGJGnayxx3TKvv06F1P E8PKEtOjYP5LCh/nADcSV8cIHfSQ5Bw+PUTkkec+5GYB75EtHF4mtomDLryzewhgN7IO 71qjdO2uyo5C/rFnSy+ixe46pBo5vB5032tnVyiix6zMxH/F+2uulqstwT2j4M9Y176S a7hdvQaUdjT+hnCafSWXSQpUYb7QjpRL5LZWumWx2b/oFng26wrrxxL3YZ9k5GvvxweW gUaA== X-Gm-Message-State: AOAM531dKApvsvETtyp1CpvJ51umSLifbCHxVfsu5QKGwtJk2mz5rp1p b0KKUGuCFnDcm22CeE8c7U4sojMSn0+Y5ZwWkWzMAA== X-Received: by 2002:a50:e004:: with SMTP id e4mr13096018edl.114.1597130919795; Tue, 11 Aug 2020 00:28:39 -0700 (PDT) MIME-Version: 1.0 References: <1596012277-8448-1-git-send-email-weiyi.lu@mediatek.com> <1596012277-8448-5-git-send-email-weiyi.lu@mediatek.com> <1597128205.20627.14.camel@mtksdaap41> In-Reply-To: <1597128205.20627.14.camel@mtksdaap41> From: Nicolas Boichat Date: Tue, 11 Aug 2020 15:28:29 +0800 Message-ID: Subject: Re: [PATCH v2 4/5] clk: mediatek: Add configurable enable control to mtk_pll_data To: Weiyi Lu Cc: Rob Herring , srv_heupstream , James Liao , Stephen Boyd , lkml , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Wendell Lin , linux-clk@vger.kernel.org, linux-arm Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 2:43 PM Weiyi Lu wrote: > [...] > > > + writel(r, pll->en_addr); > > > > > > r = readl(pll->pwr_addr) | CON0_ISO_EN; > > > writel(r, pll->pwr_addr); > > > @@ -327,6 +327,10 @@ static struct clk *mtk_clk_register_pll(const struct mtk_pll_data *data, > > > pll->tuner_addr = base + data->tuner_reg; > > > if (data->tuner_en_reg) > > > pll->tuner_en_addr = base + data->tuner_en_reg; > > > + if (data->en_reg) > > > + pll->en_addr = base + data->en_reg; > > > + else > > > + pll->en_addr = pll->base_addr + REG_CON0; > > > > Don't you need to set pll->data->pll_en_bit to CON0_BASE_EN here? > > (which probably means that you need to add a pll->en_bit field to > > struct mtk_clk_pll) > > > > Because all mtk_clk_pll data are static variables, en_bit would be 0 if > NO value assigned. Wow, you're right, but this is a little bit subtle. I wonder if it's worth adding a small comment? (either here or in struct mtk_pll_data)