Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1074529pxx; Fri, 30 Oct 2020 00:57:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTElwhmk5muX5cFopout5n45uCOFz85yDlC0NyoTZt95YQc2ziYyEsvv0HJsp/CNzCLpmq X-Received: by 2002:a05:6402:1112:: with SMTP id u18mr988494edv.349.1604044651158; Fri, 30 Oct 2020 00:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604044651; cv=none; d=google.com; s=arc-20160816; b=wfPbbF8WSMtdXwEO1eEzXAQt4lauNFf2qkdsadwenAamWEVUm5lI2TfblWbhOHvI/f n5urbhBEBzboAW2xaE+x73p3wBIEF8NgmJvo/Zveq8yaJfnx36RGowYGrEMwNx7RgDSt AN3ffDHkNxIOcPlNkD+LZOYu9oNC+5V/IqKwoFkSA1XDGrPaRifA1D63xsGRJKK3ddyi dkBwLn8Io0g688Vs0oNYHGmGi/CqkHF1f+0d8kJ+jXaENlo2BpniCIDmrm+NBY4zBZy4 fS5E7fJKkY0McmB8KEQrWV4ThUACt/Ehb0jfP26XRH3QVy9XrkR66iddL20Oc/WSjdxI rXYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=i23jS/gbz5X7YN7KU9IqT0XWSw21v9qjwEgB0M7JaQM=; b=OzNFsJ/fA9eJLGZoPP8DzbK8e9pfhGAo7fE1uBuiBj9W1rdAAOnCOsjVvtJKV7fv72 toA68EXaSLYOvzEtmS+vmny+vh+ks+6GIuRC5ZafcsNUUvamfeuzGKeGFTHTWiQ4fBqq Tl+Vt/O2wjkjTjK0OrlvGEttY7u4CbSY7IOK6kRHRy/7UgfbOcr5pXY0sagzM19Dq/J0 OdFzDOdN7fTPxCOdkZuQs9qlJp90e3dDviniVZXY4btWAdwBnOEpFABMcGnWPyyKWVBh wR/EBCKwfRc1F/9uj/tpSihBm3I9EHfzHAY72Zz/BtTXRZGcClIENvhS2FtG0YETsE/X Latw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si3598647ejr.168.2020.10.30.00.57.08; Fri, 30 Oct 2020 00:57:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725888AbgJ3Hze (ORCPT + 99 others); Fri, 30 Oct 2020 03:55:34 -0400 Received: from mail-oo1-f67.google.com ([209.85.161.67]:36053 "EHLO mail-oo1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJ3Hze (ORCPT ); Fri, 30 Oct 2020 03:55:34 -0400 Received: by mail-oo1-f67.google.com with SMTP id j6so1388632oot.3; Fri, 30 Oct 2020 00:55:32 -0700 (PDT) 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=i23jS/gbz5X7YN7KU9IqT0XWSw21v9qjwEgB0M7JaQM=; b=P8avz5J2YYC5arHRgMlkWfbqNCHBsJwfOXqCIJ24J0T9JBhEULWpC67WEGnHPRZZuh Y388zxjLVNAckW5WUKGSquMdtXfHqNErsKTIvjmbkj6e68U3dqRX7GqF9A0ExewkOl9s MMRx1SMJHJkQ8HAHRlx5iWjhYKfn1GlSQ5glZu+pCa5mvdxDVbZyyf630fGlOjgKhKyd mbReQ82T2Raw9WGb66qttzpnMu7XUT3wgiIN9wJNwq6KDn4eCQdrS2eHGzwwQUCSX0DT L+MdnfL6bCqv822INYgmQkU7Vn367vM4jP2SabTg2EUJ7m1wEsTPqs6XRMJoWRT1M5/C HOOQ== X-Gm-Message-State: AOAM532WchCJrGnQgZYohbob0MjtGCuHs6ZdFpD4BWoYAYRX9NBblMCG MLi3Rm8K1sw7qbi4yMXD3S4QlisLLA9Mic6eskSrAZQl80Q= X-Received: by 2002:a4a:e80b:: with SMTP id b11mr813437oob.1.1604044532122; Fri, 30 Oct 2020 00:55:32 -0700 (PDT) MIME-Version: 1.0 References: <20201029105515.16309-1-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 30 Oct 2020 08:55:21 +0100 Message-ID: Subject: Re: [PATCH v2] clk: renesas: r8a774c0: Add RPC clocks To: Lad Prabhakar Cc: Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List , Biju Das , Prabhakar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Thu, Oct 29, 2020 at 3:28 PM Geert Uytterhoeven wrote: > On Thu, Oct 29, 2020 at 11:55 AM Lad Prabhakar > wrote: > > Describe the RPCSRC internal clock and the RPC[D2] clocks derived from it, > > as well as the RPC-IF module clock, in the RZ/G2E (R8A774C0) CPG/MSSR > > driver. > > + if (e3_rpcsrc_parent) { > > + parent = clks[core->parent >> 16]; > > + if (IS_ERR(parent)) > > + return ERR_CAST(parent); > > + } > > + > > + return clk_register_divider_table(NULL, core->name, > > + __clk_get_name(parent), 0, > > + base + CPG_RPCCKCR, 3, 2, 0, > > + e3_rpcsrc_parent ? > > + cpg_rpcsrc_e3_pll1_div_table : > > + cpg_rpcsrc_e3_pll0_div_table, > > + &cpg_lock); > > + > > So you want to keep the parent clock selection fixed, but still allow > the system to change the divider? > Why not support changing the parent too, by modeling this as a composite > clock consisting of a mux and a divider? To clarify: basically you have two options here: 1. Model this clock as a non-mutable clock, based on the register settings at the time the kernel boots. I.e. register it as a fixed-divider clock. This is how we handle the PLLx clocks. 2. Model this clock as a fully-programmable clock. I.e. implement both dynamic parent selection and dynamic divider selection. You have picked something in between ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds