Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp650644ybz; Wed, 15 Apr 2020 15:58:47 -0700 (PDT) X-Google-Smtp-Source: APiQypIC7TkMy8l5kqPkV84rRokst7OC67r6tgZPM4V+NCSsIe5RG1rJfYQKf8SOrbpVGJ0HOh8k X-Received: by 2002:a50:81c5:: with SMTP id 63mr3327652ede.115.1586991527497; Wed, 15 Apr 2020 15:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586991527; cv=none; d=google.com; s=arc-20160816; b=OaIRCgMHg+OrMNXvl1o/X9ixDNAZEnUXOBpGdxC/pioQnB5+JUJLhMQ8bknFKQpYM/ GckQRQjVuGntf8IBmqYYE4B2TOsoCs6YDVJ+tLFVfCWt7c1EgNhN8LGPdqKMX2gOG/3c qpmB4G1jQugwgSrZswVNwFvs9MPUeZSQfKE2z611qWdeat2mVHtnC49HS19Iq3elJvTw TqERdjrDPglgX0ynxVUOxiQ8BZH2WIos/Uh8b2fx9U0VcIOcoICATRPTFE+Ch6QkStPZ E8UDal3c+EJyo5mCTKaLifBrhpOv4vrZo5iB9XiPIyVN37AHn1r4Q2VjP7hsxSwrLuQ1 CkDg== 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=OqFQxlRGDlIbvri5wdXUxH9+p66pmQnxbzHsgkd4DLE=; b=p0oWpMLuDrGl1pl1sBfLmtUOQxc54C4Yqvb2QxFowNMVSsMEo4Vn7O9gsFM2mYk/e6 o95ddazirNceO21vCNgv7o+33ENVLolk5Zj19uuR747CM7GzarV3+HeDPJtuG1juDTEW I14T/HDnDuP8A36yyL8lfBnaH4nKcGOWpBk1W3JbkNjFWbFfA5sGPqBPHD58uKtcLdyJ SqYQ0sN46oPmPqXUjjLqBMWr5/Iu1w2s1XLWiRLLb/76fg0sMpBpetl6jRrG9h+P5OGk VBTeNm9lYxk4bET822L9nBrRQnlIrZTCLLgyTg6OUznhX8DkPos/V2+9595OSg0dDo/v a96g== 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 y24si10749308ejr.132.2020.04.15.15.58.24; Wed, 15 Apr 2020 15:58:47 -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 S2404175AbgDOLJe (ORCPT + 99 others); Wed, 15 Apr 2020 07:09:34 -0400 Received: from sauhun.de ([88.99.104.3]:52766 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393925AbgDOLJS (ORCPT ); Wed, 15 Apr 2020 07:09:18 -0400 Received: from localhost (p54B33507.dip0.t-ipconnect.de [84.179.53.7]) by pokefinder.org (Postfix) with ESMTPSA id 958422C1FF1; Wed, 15 Apr 2020 13:09:16 +0200 (CEST) Date: Wed, 15 Apr 2020 13:09:16 +0200 From: Wolfram Sang To: Alain Volmat Cc: robh+dt@kernel.org, mark.rutland@arm.com, pierre-yves.mordret@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fabrice.gasnier@st.com Subject: Re: [PATCH v2 2/2] i2c: i2c-stm32f7: allows for any bus frequency Message-ID: <20200415110916.GO1141@ninjato> References: <1585226661-26262-1-git-send-email-alain.volmat@st.com> <1585226661-26262-3-git-send-email-alain.volmat@st.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Iys0Un1O+0sigPHU" Content-Disposition: inline In-Reply-To: <1585226661-26262-3-git-send-email-alain.volmat@st.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Iys0Un1O+0sigPHU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alain, On Thu, Mar 26, 2020 at 01:44:21PM +0100, Alain Volmat wrote: > Do not limitate to the 3 (100KHz, 400KHz, 1MHz) bus frequency but > instead allows any frequency (if it matches timing requirements). > Depending on the requested frequency, use the spec data from either > Standard, Fast or Fast Plus mode. >=20 > Hardcoding of min/max bus frequencies is removed and is instead computed. >=20 > The driver do not use anymore speed identifier but instead handle > directly the frequency and figure out the spec data (necessary > for the computation of the timing register) based on the frequency. Useful improvement! > +static struct stm32f7_i2c_spec *get_specs(u32 rate) This is quite a generic namespace. Can we prefix stm32f7_ here? > + if (rate <=3D i2c_specs[i].rate) > + return &i2c_specs[i]; Same for i2c_specs here? > +static u32 get_lower_rate(u32 rate) Here, too. Rest looks good to me. Regards, Wolfram --Iys0Un1O+0sigPHU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl6W61wACgkQFA3kzBSg KbZhDA//QrjQyZGByv+sQkmvBPGnIsAXz2Nca2UGy56ln4/UAfHo1NvwTx3mqBJ3 ovBURYObhG5pCwDi0hi/T0jQTXjTHy5KsA/F/OoF/KnJwruXcUa+vLGfcWztPc3c B/n22uncMOcZ84AadcTWe6wBQOQojeV25sEjfkSMMuFvfzRM/r5NXARqxDdIqsV0 lEtTPBe6ol9wwAZJwYZR3ErrDkic3GBE9aMP8TQzfvsvmMgN/qBWlSEI5Sp9930e XSVymfMPebXhdUH6cbfTUZ8S+0+c5i/l3KA/BpV1weltc/EueYz9HH/fCsF2FHNW 5RNWV9XHSzkhe0f9ryVPmuNuTFNz9/GRzR1TIio3n/VTemC7cZxCVUQo5VURHWc0 D87DMgOz5dFL48zHLessi8n8/vOpOpweDgMHtPfYzEsIfZIRCjJxXEO+QIMD7cSp PT26ks9/zK36lqydCx6Jpo1TLTDNlr/dJY8ag6iQjjSWgxQxm354yFTavOds15Ua i1bGeKwYXkhFyH/TsnzX0I503nQpebW+StiPCIUOnKWS5pWA/8YvDVOAdAULOp0s pJags5YBAv0Bd8v/mCVnbbzUKXbTuZDIT2f1rbQxl2T4//AfeLhMJ5UPVmczr4DH 08VuS7rAy0VGCvxXrWnoBgcR99qkXG8jHyecTgZzVVPHLVLT5uo= =rnTO -----END PGP SIGNATURE----- --Iys0Un1O+0sigPHU--