Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp665699ybp; Fri, 11 Oct 2019 02:19:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi7EVa2dF1wuYrBZK9dU/ahwoq7E9jT9SVY9z5/gaLQX3/8uCu9CdLLNVvG8lL0GVKTpxH X-Received: by 2002:a17:906:4908:: with SMTP id b8mr12583695ejq.83.1570785558548; Fri, 11 Oct 2019 02:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570785558; cv=none; d=google.com; s=arc-20160816; b=v10BStBK7KPBorM6PekQYorx5A5G14+qyRAkzLqkwmtOy7yvenO5SN9nGzBy+RYgKd Wkk6qjnSwN06r04TG+eNK/KWGzNDjjQmIw2VuWG1sSQWr5JSnnEbiSPCDAB5FyebcoyC 5P6ObvnP3NtkVIMl9HZ2PONrL0YlDQFucw0hsnzMXrzjEjW/NeNFpi89ulmbFcQ3kFdB enG4PJ3qfMf1tbhlRb8BFPUZruMec2hVY2HunHz1YvdW+M/9UDSsk4gVwJGSePtHTtD/ b2b06WhhxT+e94hI6zqQ8cuwcVZ2RzooWf9HtEa9nYHR6Bt924WUKZrWpwNibgt4fFIx sIOA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WxhHnzxDCrC+/Rpr2u6kAWWRrEwwZW/mV2UWllDHadQ=; b=rD9Sa2JKESKVr7flF1qC0H1U1cN93mfbn+h6tw+H1nxUdZnW2AQKPddDNp/u3bTrxP jfK35vRYzPTStNplkiiyoF0vfxn3i4gvOISSbAMX58S/ohWp4gTWJwiHwOq15bVCi1Ws fPNbtXUveOkA9XW/a57CGxDya/oGZ7GTEQYr+doaAdldCBoM9OZ210tenXQfuGiL3L6a oYS0e8/ixGmUj6yOWDdyyQWHTOx1oUkKEnVc7Tlk9C9sddQoz2mxvXHXLyVMqkbbMKe1 PtNMUgM8bWLvCip5PIpbO6jyZDhaiYQG58u7EpiVMkcYN+VxLOGvGgJgFQzpPzOSEXzB hVwA== ARC-Authentication-Results: i=1; mx.google.com; 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 90si6096219edj.72.2019.10.11.02.18.55; Fri, 11 Oct 2019 02:19:18 -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; 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 S1727589AbfJKJRm (ORCPT + 99 others); Fri, 11 Oct 2019 05:17:42 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:35287 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfJKJRl (ORCPT ); Fri, 11 Oct 2019 05:17:41 -0400 X-Originating-IP: 86.207.98.53 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A7857240004; Fri, 11 Oct 2019 09:17:39 +0000 (UTC) Date: Fri, 11 Oct 2019 11:17:38 +0200 From: Alexandre Belloni To: Parthiban Nallathambi Cc: a.zummo@towertech.it, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, parthitce@gmail.com Subject: Re: [PATCH] rtc: rv3028: add clkout support Message-ID: <20191011091738.GC3125@piout.net> References: <20190927141505.640751-1-pn@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927141505.640751-1-pn@denx.de> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, thanks for the patch, minor comments below. On 27/09/2019 16:15:05+0200, Parthiban Nallathambi wrote: > + ret = regmap_update_bits(rv3028->regmap, RV3028_STATUS, > + RV3028_STATUS_CLKF, 0); > + if (ret < 0) > + return ret; > + This is already done earlier and this will not be enabled again unless CLKIE is set which should not happen. So I don't think it is necessary to do it once again here. > + for (i = 0; i < ARRAY_SIZE(clkout_rates); i++) { > + if (clkout_rates[i] == rate) { > + ret = regmap_update_bits(rv3028->regmap, > + RV3028_CLKOUT, > + RV3028_CLKOUT_FD_MASK, i); > + if (ret < 0) > + return ret; > + > + return regmap_write(rv3028->regmap, RV3028_CLKOUT, > + RV3028_CLKOUT_CLKSY | RV3028_CLKOUT_CLKOE); > + } > + } > + > + return -EINVAL; > +} > +static int rv3028_clkout_register_clk(struct rv3028_data *rv3028, > + struct i2c_client *client) > +{ > + int ret; > + struct clk *clk; > + struct clk_init_data init; > + struct device_node *node = client->dev.of_node; > + > + /* disable the clkout output */ > + ret = regmap_write(rv3028->regmap, RV3028_CLKOUT, 0x0); > + if (ret < 0) > + return ret; > + This is not what the user would expect and could introduce a glitch in the clock output every time the platform is booted. If there are no users of the clock, then you should probably let the core disable it once the boot has ended. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com