Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3723322ybz; Mon, 20 Apr 2020 08:17:48 -0700 (PDT) X-Google-Smtp-Source: APiQypKMRw/gnEsoJR+bwfqU5tVFUbI4B8z6UbhQXznSgiIFQ1tncMQfdRTTfu1VRppDCVuGTQzA X-Received: by 2002:aa7:cd6a:: with SMTP id ca10mr14520457edb.332.1587395868685; Mon, 20 Apr 2020 08:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587395868; cv=none; d=google.com; s=arc-20160816; b=QO7ZAJDX4TjFEQB/GqVItQLmxoAcz5OQQEYE13LuhuQVzjl/JT6HQUqrIRIryp3IAG uYzSXmOw+eZYRz6QjW0mlF/faN9lEBerqEMS8p/dYmDwTANUiCa8JXbWK55smZ3RWv+M hT2cBVcVDGvaI75Ae3B1+NMO4BacAYXtUb5rxfBNUptf8UoXp6Q98u2DpoOyQWTf+usC 9Kmn5IA2GJ1juaI9ztCo4/AeKXZsqA1NIjHbB5+TRu9BZLmXNrxMH7ExidPT6TteTHq0 xMawRnQdwOqJQWOAqIyQL9s61BW+qi7Ea6TkxGQ2MNnZfYkbBMNGOkfj7NfmoL7cpIQ4 a2cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=LFbHXDYgAgs4Hcvg9/e01AWVNn3apQsBjy+Cy3nDA1c=; b=gYcM/sEuUE34zkvGeE4cOXszKj5yveFpoVuCGVlp4gTGgHaIHd0Lj05pOztswiqgjR zxEqHagZa/wL0tesvLdT+WpmRdfzs50O3wCR0ge2T5Yyhthu+VHa70Iw8VR/coxR+H81 CdtAG3TaykhMDDXsseCWZTjEPK0aME+Q0eqYNZv6qwVdu9x+YZC4h1re4zsWLSAVrWVZ mrH/tbqE2UY5if+jOIn446JJRFuYSUAPXBJL5HBArBONPC9V1/80dpHTDIiw8a/7Dfvp TWUMBeZqZBgKd3yyXz8G+JoB0GUKSAsafrLdRo5pyQ7kg0YrJQaUuRTwr3/8EPpXQNK/ aUww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=lQQHFOMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si748274ejj.44.2020.04.20.08.17.24; Mon, 20 Apr 2020 08:17:48 -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; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=lQQHFOMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbgDTPAt (ORCPT + 99 others); Mon, 20 Apr 2020 11:00:49 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:2504 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726615AbgDTPAs (ORCPT ); Mon, 20 Apr 2020 11:00:48 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03KEwrKp027524; Mon, 20 Apr 2020 17:00:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=STMicroelectronics; bh=LFbHXDYgAgs4Hcvg9/e01AWVNn3apQsBjy+Cy3nDA1c=; b=lQQHFOMVMl7wYS2G9F1hLw0BI8eTx7z/+q3B3DFceEmfVXoYNKCRiGz/g/s7PYkAhuNq /Dv+nZY5so2PnL6/7aTWG6oxfcEEE8kPCtRe2SrwAKWkN66hWunDWk/yyI76EkTuQFcw Y8sACQw6lSJFXf8BCMP6/ERG57Bo59GOGXrHJZMe7oALD7p7K4CgSRUUa5l6W+G6cdZg 3nCe5DZGqLokDoxzaMBIV6QNHgszki0ZtXt65SluBOoaYVzXveUgRfyMTvGm9vM7XaUt BJjvn/VjhAoiTPWDK5acwgfEH0HT6B0khFYHu29sxxdWoi3MTmLuVoi41iXH5ThwjcAt gA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30fqaw2vn8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Apr 2020 17:00:35 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C2EB610002A; Mon, 20 Apr 2020 17:00:34 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B52292AA282; Mon, 20 Apr 2020 17:00:34 +0200 (CEST) Received: from gnbcxd0016.gnb.st.com (10.75.127.51) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 20 Apr 2020 17:00:34 +0200 Date: Mon, 20 Apr 2020 17:00:29 +0200 From: Alain Volmat To: Wolfram Sang CC: , , , , , , , , , , Subject: Re: [PATCH v2 2/2] i2c: i2c-stm32f7: allows for any bus frequency Message-ID: <20200420150029.GA6945@gnbcxd0016.gnb.st.com> Mail-Followup-To: Wolfram Sang , 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 References: <1585226661-26262-1-git-send-email-alain.volmat@st.com> <1585226661-26262-3-git-send-email-alain.volmat@st.com> <20200415110916.GO1141@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200415110916.GO1141@ninjato> X-Disclaimer: ce message est personnel / this message is private X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-20_05:2020-04-20,2020-04-20 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, On Wed, Apr 15, 2020 at 01:09:16PM +0200, Wolfram Sang wrote: > 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. > > > > Hardcoding of min/max bus frequencies is removed and is instead computed. > > > > 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? Done in v3 > > > + if (rate <= i2c_specs[i].rate) > > + return &i2c_specs[i]; > > Same for i2c_specs here? Done in v3 > > > +static u32 get_lower_rate(u32 rate) > > Here, too. Done in v3 > > Rest looks good to me. > > Regards, > > Wolfram > Regards, Alain