Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp329792ybv; Sat, 22 Feb 2020 04:35:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxVmp8E6wSeyhcghmJ4HtRsX8KgTQY1CBZ3PpJYhvcFSTSMo8FQzY7N7+hWm51iX+Nq8k4u X-Received: by 2002:a9d:5d07:: with SMTP id b7mr33622092oti.209.1582374939817; Sat, 22 Feb 2020 04:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582374939; cv=none; d=google.com; s=arc-20160816; b=P+3RRx4xf9e1gJOArUrLnSmNCqQgB01LXVluOKbjp+due3KQ8gUU7Hc/V5c2/C7HE9 C1kMw+kq7nrbUdDDjNxKl4Cc5HtzF7OXx3BxB2t2+9MV3HI1/56o/XKYMPs3q38AhW6q LSDEIxbC7iat5RXiBta9zF6KEenH7v9RcX81P3KY8YzBHWCJazGGUwHF24oIgTfxBXGa OshN4qvssKhwentGB7u7w3d5DJiT74ACNIiDqJg+ZP0qSQebWZabt6Y+nswrcURnhqOL hbAlQreWpf7KeIPG6Eg2ASwMAacld8cIfYrdhVkpjQkqpl3zvwthd49p+2yN4h8HUqpx tkow== 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=CqcIfe5aI67rQ+fLnnATK6B7rwxTPtmr+8UpQtKZaqM=; b=NhUU6Ovg4JUp3GKH1bVDJ9qNibSxdNLtLGh3WuAYINFE0064IqWfHvL4mvoNvJL0Y6 iPFEse9jVnzOWZtIlkPbz0F4w0TNDPr0g1dhgCnc6KSsNS/Jyu7CdRA9zd09PFA276fE PSgl9206AEeMg+pW5CZ2icET8/gAHSMu0CjafXZC3Ist2OpArt66ZR6bIHx65v4LRY9y oFWH7YYxWLW8jVWpJGgmK3QdpXsBtMWb96NiJqry7qVkLkcrRhRic+YmKi+aSRNXoPgQ FkjEp3t5OrEnrG8LhDEw2As1fMCJD68ccPGyxcwHqdmwH/kh75RhSBjTaHrtz4/Y/HmS wIcA== 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 w20si2316033oic.103.2020.02.22.04.35.27; Sat, 22 Feb 2020 04:35:39 -0800 (PST) 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 S1727339AbgBVMfA (ORCPT + 99 others); Sat, 22 Feb 2020 07:35:00 -0500 Received: from sauhun.de ([88.99.104.3]:53602 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgBVMfA (ORCPT ); Sat, 22 Feb 2020 07:35:00 -0500 Received: from localhost (p5486C6B7.dip0.t-ipconnect.de [84.134.198.183]) by pokefinder.org (Postfix) with ESMTPSA id F30102C07F9; Sat, 22 Feb 2020 13:34:57 +0100 (CET) Date: Sat, 22 Feb 2020 13:34:57 +0100 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 1/5] i2c: i2c-stm32f7: disable/restore Fast Mode Plus bits in low power modes Message-ID: <20200222123457.GG1716@kunai> References: <1579795970-22319-1-git-send-email-alain.volmat@st.com> <1579795970-22319-2-git-send-email-alain.volmat@st.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IuhbYIxU28t+Kd57" Content-Disposition: inline In-Reply-To: <1579795970-22319-2-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 --IuhbYIxU28t+Kd57 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alain, thanks for the patch. A few comments: > @@ -303,6 +303,8 @@ struct stm32f7_i2c_msg { > * @dma: dma data > * @use_dma: boolean to know if dma is used in the current transfer > * @regmap: holds SYSCFG phandle for Fast Mode Plus bits > + * @regmap_reg: register address for setting Fast Mode Plus bits > + * @regmap_mask: mask for Fast Mode Plus bits in set register > * @wakeup_src: boolean to know if the device is a wakeup source > */ > struct stm32f7_i2c_dev { > @@ -326,6 +328,8 @@ struct stm32f7_i2c_dev { > struct stm32_i2c_dma *dma; > bool use_dma; > struct regmap *regmap; > + u32 regmap_reg; > + u32 regmap_mask; Is this really a descriptive naming? From looking at the code, 'syscfg_reg' or 'fmp_reg' sound more suitable to me? > +{ > + if (i2c_dev->speed !=3D STM32_I2C_SPEED_FAST_PLUS || > + IS_ERR_OR_NULL(i2c_dev->regmap)) { > + /* Optional */ > + return 0; > + } No brackets needed here. > - ret =3D of_property_read_u32_index(np, "st,syscfg-fmp", 2, &mask); > + ret =3D of_property_read_u32_index(np, "st,syscfg-fmp", 2, > + &i2c_dev->regmap_mask); > if (ret) > return ret; > =20 > - return regmap_update_bits(i2c_dev->regmap, reg, mask, mask); > + return 0; Can be shortened now to return of_property_read_u32_index(...); > + ret =3D stm32f7_i2c_write_fm_plus_bits(i2c_dev, 1); The type of the last parameter is bool, so using 'true/false' instead of '1/0' is a tad more readable, I think. Regards, Wolfram --IuhbYIxU28t+Kd57 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl5RH/EACgkQFA3kzBSg KbavNg/9GAfGIB4N92n2trj9XDA9COdUjFm1R4Ll9GV1q55OEyFvjsYjVYJ7HNaV oRJWmf+gP9YqJ3UAkTLLSSxtL5fzy6qZA7AK8is3x4ujhLJSUgUladxMDj2iYdeu jkcCBpz7qVEJuHmfUb+E+7jtTLDhYPiaWMuYcZxu56lOCRfyS9eQNXUXneYkRxZf S3WC9j9/6ePMl/GzT5bR9xDdEsyfH34NgPuDKS4Q/ctEJIvprOKZ3rx8ydOiK5Xt kTTvH27KzoAmUpB7uvMCiedvHDqe2n3iApM1J5A4b9InH+2bLq0TbzDNFHYxDGZL BH6HGMKyMBSRejbY52ZKD8ppwgE5QSl1/S12801F1HDNV37gjkh+1j163+x8Km0w yb/erg1hXCvgE8z6KT7ulFDp6PCvhbaMG7c1mQFfut5Uc+ZRNSVqkEMgoxhCV39/ U8IfeO9dd6Sa3oPgCH7MH5SXw4887sSgj+6n4Ft1UX2rIC1UPyx2l0mPo0Y458ZT 0zEAGlOoStKH9JlcHzZFRppTBQXgg64DG7DzdBNFR/+ZVlp6jKHosOn3cpCvtIVG VwlK16wVO0I7Iy4Jffm+VTlycexDet7pNK+GeD3VCQEk65/gJSh5Tq5tnEfTY8/g DFM/GdKlFVSM/CN9PZKD/tTpTlNh2k5MSmmrjLY8A+vnpERPKpU= =KSsS -----END PGP SIGNATURE----- --IuhbYIxU28t+Kd57--