Received: by 10.213.65.68 with SMTP id h4csp3913306imn; Tue, 10 Apr 2018 06:35:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ZLnWSS0QgyzIfDlWIMk9m++B7aVhkiWjKV+YJXS4LzktvHacYwzWGvHAm1H5t85tY+C3b X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr445248plg.195.1523367351004; Tue, 10 Apr 2018 06:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523367350; cv=none; d=google.com; s=arc-20160816; b=d3jQr0TOQUzqzORh6N912j3QOXn3NIJ1z9xNXyMnSUHvybxxqbYRP1y5Dms4W3ZGDh C0ZsxFhPtq20lQcPBZn8zen0q7oJI/sLSM5utvXCWtzgeKuP9hsnOwcIBxyJ1Hb2vQ/M UJkc8WpLAk29MRAt1H3oBooMlVJCNc45ellvVRL4ZtvmXCP1GIskx2onLS/7K9puBdFc F0YdGjFhSQPFHRJ7roUH2pq37r+YpC2fJwSUFgDvPJfwBRar11w+NCldyjJWkWvS9+nW tjgpOMrh/u8Np9vXu8u8fSzbbS6m/syh7CsitgjGhud1P2+oed55Yr2lLbPtipjvW+9b 2Z/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Q5z0pmDHMwJNEAJ0uHgVW3gp8vy973uBNw0A6ziJBwA=; b=ejxEKH++WE5B1DkljpzmZYHGS6eXZO7iFVAbxJ9645IV2UNY/wbfZt4k1HQxwkkPaA bl2g9U74gWFM6EOdD11dpEeV4/oUbsyL8ekmCW2R25SAPpHexfwKIFvq3FRHiyJroU/O gAkfBzduFReTT4eL/RKOCyG+WJF1fyHS2qFPFuiTBQBKF0TB0vqNxjv6e164DdXuR6Zm sIxWHNHuameRRs+wo4XMTYGjqUAGNjY1dZR3eltcJe6Kqie0Lu0tlxjC9hx/GVsE7Qe5 8RQATeg7dxy6Q4PcCsTDa6o3UIFLKtj95eCxH20f1JancCQbLFieQQdBm0RdziFOds/R Mc/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=lLjeOv/N; 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 z22-v6si2692693plo.270.2018.04.10.06.35.14; Tue, 10 Apr 2018 06:35:50 -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=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=lLjeOv/N; 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 S1753676AbeDJNcn (ORCPT + 99 others); Tue, 10 Apr 2018 09:32:43 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45286 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752986AbeDJNcj (ORCPT ); Tue, 10 Apr 2018 09:32:39 -0400 Received: by mail-lf0-f65.google.com with SMTP id q5-v6so11695165lff.12 for ; Tue, 10 Apr 2018 06:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Q5z0pmDHMwJNEAJ0uHgVW3gp8vy973uBNw0A6ziJBwA=; b=lLjeOv/NPz0YjEwdHxXioRAAhXbys9S8FQ0wcYRyZ4q2E+SNU6M07wCc6seXNRPE/4 2MdphbybsC1Cb9Mi8q85iG6PikiO+zDTI07/l9zIeiS0/c5wW8BxfEmNCC4q6I18RvLW sif62aRPnRTffoLrODG7YfVbh3Mb2rVDDrI5UYpHe8ob0WuGj5Dofb12ct7Yv6SrZRKZ kFy9+Oe79RMRV7ohRv8D2Pcx5NpYMe3MnWgyeWvjHIY2veXTh2oNBjO+4ESsZRMjmEpr 1r/I4wWrCI2zExSF/RcBT08Q4Obs/CWoCIpRzPu3csz2I+aENNq1TFsmzAJTcB9Iqcp5 b9+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Q5z0pmDHMwJNEAJ0uHgVW3gp8vy973uBNw0A6ziJBwA=; b=IJaTJbGeYNcZ5IhwRX43qmC+oNiHKGWG3OZ9ljFmnhKbYnBECNx4rtG5GY72IXTXE8 wQpxdZH/M2fPzLuXz6VmOLX3uaGyf+Eclm9Yex+U4Bqv07jYSuaGE1ZHcBzxKQpyVspy itywCA8yEl8cIHAGQyOYm7F7PsXYxFXE9Y1aHUwIzCBLHz3FsIxkWuMxUTobiNfdZrOp Woj7Zl0Erx2Xo4ySdJNI+3RIKhikYxegs/g+KsNo0lhoV6ec2zmT9hfL4j5yHMXdTDME CcfO6ZoINMQaU6VNuk4DnwZ0j5dKHBdYSddyJO48zUrGIM9vVnWMHwVlpLkt/Lj5uc8D aPtw== X-Gm-Message-State: ALQs6tCVv7a+9HOazgyy3AuH5Fl+H+ntaAyfzBQJo6IobA5LsHFs0OI2 Vdl5ZE9m1H4YgK1B6xh/kZstOg== X-Received: by 10.46.155.204 with SMTP id w12mr289708ljj.76.1523367157704; Tue, 10 Apr 2018 06:32:37 -0700 (PDT) Received: from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99]) by smtp.gmail.com with ESMTPSA id h19sm487400lja.41.2018.04.10.06.32.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Apr 2018 06:32:36 -0700 (PDT) Date: Tue, 10 Apr 2018 15:32:36 +0200 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Geert Uytterhoeven Cc: Michael Turquette , Stephen Boyd , Biju Das , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: renesas: rcar-gen2: Centralize quirks handling Message-ID: <20180410133236.GU12256@bigcity.dyn.berto.se> References: <1523365498-16789-1-git-send-email-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1523365498-16789-1-git-send-email-geert+renesas@glider.be> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thanks for your patch. On 2018-04-10 15:04:58 +0200, Geert Uytterhoeven wrote: > Introduce centralized quirks handling like on R-Car Gen3, and convert > the RZ/G1C SD clock table handling over to it. > > This makes it easier to add more quirks later, if/when needed. > > Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas S?derlund > --- > To be queued in clk-renesas-for-v4.18. > > drivers/clk/renesas/rcar-gen2-cpg.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/renesas/rcar-gen2-cpg.c b/drivers/clk/renesas/rcar-gen2-cpg.c > index 0c49f59d5074b1c4..daf88bc2cdae177b 100644 > --- a/drivers/clk/renesas/rcar-gen2-cpg.c > +++ b/drivers/clk/renesas/rcar-gen2-cpg.c > @@ -261,9 +261,15 @@ static const struct clk_div_table cpg_sd01_div_table[] = { > static const struct rcar_gen2_cpg_pll_config *cpg_pll_config __initdata; > static unsigned int cpg_pll0_div __initdata; > static u32 cpg_mode __initdata; > +static u32 cpg_quirks __initdata; > > -static const struct soc_device_attribute soc_r8a77470[] = { > - { .soc_id = "r8a77470" }, > +#define SD_SKIP_FIRST BIT(0) /* Skip first clock in SD table */ > + > +static const struct soc_device_attribute cpg_quirks_match[] __initconst = { > + { > + .soc_id = "r8a77470", > + .data = (void *)SD_SKIP_FIRST, > + }, > { /* sentinel */ } > }; > > @@ -333,7 +339,7 @@ struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev, > > case CLK_TYPE_GEN2_SD0: > table = cpg_sd01_div_table; > - if (soc_device_match(soc_r8a77470)) > + if (cpg_quirks & SD_SKIP_FIRST) > table++; > > shift = 4; > @@ -341,7 +347,7 @@ struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev, > > case CLK_TYPE_GEN2_SD1: > table = cpg_sd01_div_table; > - if (soc_device_match(soc_r8a77470)) > + if (cpg_quirks & SD_SKIP_FIRST) > table++; > > shift = 0; > @@ -372,9 +378,15 @@ struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev, > int __init rcar_gen2_cpg_init(const struct rcar_gen2_cpg_pll_config *config, > unsigned int pll0_div, u32 mode) > { > + const struct soc_device_attribute *attr; > + > cpg_pll_config = config; > cpg_pll0_div = pll0_div; > cpg_mode = mode; > + attr = soc_device_match(cpg_quirks_match); > + if (attr) > + cpg_quirks = (uintptr_t)attr->data; > + pr_debug("%s: mode = 0x%x quirks = 0x%x\n", __func__, mode, cpg_quirks); > > spin_lock_init(&cpg_lock); > > -- > 2.7.4 > -- Regards, Niklas S?derlund