Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1348873pxb; Fri, 21 Jan 2022 16:09:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/iONfnbm6j9YTow2wj0wU3Bs86b1SBR1M90Sho4gEZiGtdS4JI0sQuL+ngrJ5R/nUn5Ed X-Received: by 2002:a05:6a00:10d5:b0:4be:d3f9:c329 with SMTP id d21-20020a056a0010d500b004bed3f9c329mr5500259pfu.2.1642810151937; Fri, 21 Jan 2022 16:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642810151; cv=none; d=google.com; s=arc-20160816; b=CQ8FpdLnsn1WDcakojkP95selv/P+mIM0AYwQ/+u4qYShbcuu9amZV3J+w1/indUVa wHgCita9qTioSbybT8ZqBALVOfhHe9gi0h9jbwHXtc7YAN9fas96ed0CKw1Da9TrZpmL v/4xteGG96goAJVLFEfEk/IyaPrLB7u+KJ9aqzvpDbsA/NjbkUCVJCEAR4Uzphhqm8V6 sXM7S97R/hfbIud87SHkNFkJ2iepKicBp7MZH7w95MKQQ3BSsGBlTq3ZfExF7FjNr0/u 8/mfp7+3AGcRzg4RDDLasO2K0rKe5ES8J7L5uM8aLtgeBy7ZPXpE013Zp/nsdwvGtU/I 2W1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=JjVDuclbm/fwd2D1p+3vNEJf8jRpvYGorewRrFiM1Nk=; b=IIMCoeAJ7CSMFKKWgaR0H6XkO4YA9V83+CgmxJ9fn6tpf2vlYt9hr9TB6oKHBbMG9V z8suuFvhikLjlAW8uOv5F8E89294MDIdp5hY3DuFlT8x4xiy4Z6sQEizRC0/Ks9npW+2 H7Rae1sgfHcGY4G8/wfKgBShCULDR4BHjvSav1R/JLz/Eyo/hJGTgvf7kBrNJtTv5AQr Fgngd6BAQbTZcvY9tnQ/ItCaFqi7uTFyUI7PtrNWRIBKlNtPvzhsiO1/ER2T6yz33zFw nA2cj9ShrkqADnKMvC+BdjBIeEnEn+umtBbdA16E+FoaHeM0BVdlQbt2FtjkODrUZVFz F6TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=BhkPYbE7; 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 l14si8268700plh.157.2022.01.21.16.08.59; Fri, 21 Jan 2022 16:09:11 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=BhkPYbE7; 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 S1377989AbiATVsx (ORCPT + 99 others); Thu, 20 Jan 2022 16:48:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbiATVsw (ORCPT ); Thu, 20 Jan 2022 16:48:52 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24B70C061574 for ; Thu, 20 Jan 2022 13:48:49 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so17232931wme.0 for ; Thu, 20 Jan 2022 13:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=JjVDuclbm/fwd2D1p+3vNEJf8jRpvYGorewRrFiM1Nk=; b=BhkPYbE7gJHwnPZPanlfo81NZiNYPU3pUlQRgPPsVwF2iIRRzRA5gL+RYJ2hDgIHb3 aRU2eMEqs27g0lDG94wnqyLtTNN2ROeLl4IVsIRyl8hFyeYr6WQPEG2Qi9UXyVs3HHRz RubuD53ZgUcuVHBMhWAPnvqJvPzTPGJETf/mAkMykQaLCc8IRZU87pGIjCQw43fIeCHS WA87ZD/HIQ3sI5dVkDVDMt/g981l0umLfNThnpx1dG+ZSdtHuiPXkpjEF1/uQHd00Vgt TYLJffI9ZQblEFIescsXcuZVPO7gE9Y/f1FRv+oGSB95UJI7BxYMl/11mK5D2phSKWYf XQLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=JjVDuclbm/fwd2D1p+3vNEJf8jRpvYGorewRrFiM1Nk=; b=tHG3rV+pnFPDbC/yMzHEIYl9V52KhnklYX8i3taGOcrxZqUrau+eRlORBvbH8JsU0D 5qgDgak8NK/K+Caj5SUwhlTMAt4KTo0+I3dzK9mKheNNchdaIMbBPd5K27SjmpjP7/cG 4P1q7jHveuam+E/BLUeeeRHAYxMP76WwlPL00F+ThkaplNR7Q1ojd9DomFLtRYXsCRX6 HgWT8Vw4luOFUaSq8jNUIx6dULikgnyFsJuBy+Kn5bMMQG+93MoLArSMb4sUso1VdTRo D63FlkNyoSwYdZR63/Avz/MIW6w96sLbnPLzTxjYgR7+iFdIuDJUBOGFP0IhjugMkYBJ HZuQ== X-Gm-Message-State: AOAM531OIzYTTifU73UBm+UhjlpnNKOY/4Tgiq6mtJxVceEOU8FoRu1l 3A9OnmIXtu+SkdCb/GJ8hJemfw== X-Received: by 2002:a1c:19c1:: with SMTP id 184mr10699464wmz.61.1642715320804; Thu, 20 Jan 2022 13:48:40 -0800 (PST) Received: from localhost (82-65-169-74.subs.proxad.net. [82.65.169.74]) by smtp.gmail.com with ESMTPSA id o15sm4543402wri.86.2022.01.20.13.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 13:48:40 -0800 (PST) References: <20220118030911.12815-1-yu.tu@amlogic.com> <20220118030911.12815-4-yu.tu@amlogic.com> <7a8016ba-730b-f599-2032-31cf03990a55@kernel.org> User-agent: mu4e 1.6.10; emacs 27.1 From: Jerome Brunet To: Jiri Slaby , Yu Tu , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Neil Armstrong , Kevin Hilman , Martin Blumenstingl Subject: Re: [PATCH V6 3/5] tty: serial: meson: Describes the calculation of the UART baud rate clock using a clock frame Date: Thu, 20 Jan 2022 22:48:05 +0100 In-reply-to: <7a8016ba-730b-f599-2032-31cf03990a55@kernel.org> Message-ID: <1jbl062i4o.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 18 Jan 2022 at 10:39, Jiri Slaby wrote: > On 18. 01. 22, 4:09, Yu Tu wrote: >> Using the common Clock code to describe the UART baud rate clock >> makes it easier for the UART driver to be compatible with the >> baud rate requirements of the UART IP on different meson chips. > ... >> --- a/drivers/tty/serial/meson_uart.c >> +++ b/drivers/tty/serial/meson_uart.c > ... >> @@ -629,57 +640,105 @@ static struct uart_driver meson_uart_driver = { >> .cons = MESON_SERIAL_CONSOLE, >> }; >> -static inline struct clk *meson_uart_probe_clock(struct device *dev, >> - const char *id) >> -{ >> - struct clk *clk = NULL; >> - int ret; >> - >> - clk = devm_clk_get(dev, id); >> - if (IS_ERR(clk)) >> - return clk; >> - >> - ret = clk_prepare_enable(clk); >> - if (ret) { >> - dev_err(dev, "couldn't enable clk\n"); >> - return ERR_PTR(ret); >> - } >> - >> - devm_add_action_or_reset(dev, >> - (void(*)(void *))clk_disable_unprepare, >> - clk); >> - >> - return clk; >> -} >> +static struct clk_div_table xtal_div_table[] = { > > This can be const, right? > >> + {0, 3}, >> + {1, 1}, >> + {2, 2}, >> + {3, 2}, > > Not sure if you didn't remove too much whitespace. I think it should be > like: "{ 0, 3 },". But I actually don't care, it's a minor thing. Seconds It worth fixing in the next version > > I cannot comment on the rest (clk and OF part) as my knowledge is pretty > limited there. Leaving up to others. > > thanks,