Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1727654ybg; Sat, 19 Oct 2019 01:11:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx179LB6lgjmiGibqpnqKBtXuTFoYZl1DBwCTHOLwB/d6kTUn3dngKgkMUYvTKDspOLUTrj X-Received: by 2002:a17:906:6a8e:: with SMTP id p14mr12475859ejr.137.1571472717639; Sat, 19 Oct 2019 01:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472717; cv=none; d=google.com; s=arc-20160816; b=f3xoQ8zCiiAi5b/FOuMGpM5E2shW8jgL6tLKJJKpQ/qOY5IQuabK0xEC3ynFC4Myqo vMB5VgbQpdFefSExoX2BtYtXKQpcB0ZHvFfqeSPKpumBJAzvAqY8v+eryxAKIFo+FbMU Oua8mPWX4Gt1f1CaziuC21DhJVddlB9khf8E88tfjR0QxYTOix59DrsHPB1ThNH++gJX f04k6KjRgcmlyyVCtmeVxrJ5t7P0jDkCcBpdL/adsdFu7jpok6+vooce5TEhOsIs7cj6 CWDlP1vWUuGV8KfSunk3v8twCNEbaS2lm/HcavtnB3fMNxKb+6EkGqlFrkk1TsIE4OpK q5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=Pye4HWlub3IDylCCSHfIEOZK1qkSr4gE/QoC/7Ru8AM=; b=eiUqFqWw7OLrG0/qn3OMmrzlbUMUmDjQzPG82JYWwCmChivzwQ17Vk8XZsKgRVE+Pn xzKJZCIvWVfcjL383DbxNEWxOytXqa/2BwR2wBHxOBmFV9v+akgC9b/pHkvpnUrv3IqC r4D90euodsvLkqJlHvAZGGgxrCSO4MSoeExyazjknFjMBd2eszIhMY5L0Yfl2SCoWShw tlAIU+68KO2XXE1yVTkQFrRGkQmxuiPu5vXM9yTzkmlvYg1t1f5pn7H5EXZ/lf9ky2se 8x8XzRNy7ZYtv10JSGupr5rLmpLFfaMYT8uCrbcfhZZgr4VuHSv/JgxU0xPXr3ST925r OpmA== 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 f30si5999401ede.435.2019.10.19.01.11.34; Sat, 19 Oct 2019 01:11:57 -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 S2442389AbfJRKCc (ORCPT + 99 others); Fri, 18 Oct 2019 06:02:32 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:36166 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389081AbfJRKCc (ORCPT ); Fri, 18 Oct 2019 06:02:32 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46vhR964WNz1rbLw; Fri, 18 Oct 2019 12:02:29 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46vhR95GxNz1qqkJ; Fri, 18 Oct 2019 12:02:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id SGdtoCozUb-6; Fri, 18 Oct 2019 12:02:28 +0200 (CEST) X-Auth-Info: Hlu3gswWWogMyRCvlWNhIPirpcHi4k5BQihMZtIGVVI= Received: from antares.denx.de (unknown [62.91.23.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 18 Oct 2019 12:02:28 +0200 (CEST) Cc: pn@denx.de, 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 To: Alexandre Belloni References: <20190927141505.640751-1-pn@denx.de> <20191011091738.GC3125@piout.net> From: Parthiban Nallathambi Message-ID: <942df087-0f61-f573-77a0-7b27582e25c8@denx.de> Date: Fri, 18 Oct 2019 12:02:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191011091738.GC3125@piout.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for the comments. Will send v2 with changes. On 10/11/19 11:17 AM, Alexandre Belloni wrote: > 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. Agree, removed in v2. > >> + 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. Thanks, removed in v2. > > -- Thanks, Parthiban N DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-22 Fax: (+49)-8142-66989-80 Email: pn@denx.de