From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [EXT] Re: [PATCH 1/2] i2c: imx: I2C Driver doesn't consider I2C_IPGCLK_SEL RCW bit when using ls1046a SoC Date: Thu, 9 May 2019 09:55:28 +0200 Message-ID: <20190509075528.obzchc3midbjpvzs@katana> References: <20190430044719.30720-1-chuanhua.han@nxp.com> <20190430125043.weqwzim4gpsvtkfe@pengutronix.de> <20190506073735.ctzybytamu44pbvv@pengutronix.de> <20190509074851.czcjlpfm2iooqjv4@pengutronix.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gv6qjm3xh6s2jhl3" Return-path: Content-Disposition: inline In-Reply-To: <20190509074851.czcjlpfm2iooqjv4@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org To: Sascha Hauer Cc: Sumit Batra , Chuanhua Han , "shawnguo@kernel.org" , Leo Li , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "festevam@gmail.com" , dl-linux-imx , "wsa+renesas@sang-engineering.com" , "u.kleine-koenig@pengutronix.de" , "eha@deif.com" "linux@rempel-privat.de" List-Id: linux-i2c@vger.kernel.org --gv6qjm3xh6s2jhl3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > There are 2 places where clock division takes place - > >=20 > > 1) There is a clock divider outside of I2C block, which makes the clock= reaching > > I2C module as - Platform Clock/2 > > 2) There is another clock divider which specifically divides the clock = to the I2C block, > > based on RCW bit 424 (if 424th bit is 0 then the baud clock source i= s Platform Clock/4, > > if 424th bit is 1 then it remains Platform Clock/2) >=20 > So there is a clock divider which based on RCW bit 424 divides the clock > *to* the i2c module. This suggests the divider is outside of the i2c > module itself and thus part of the clock module. >=20 > We could argue that this divider sits between the clock module and the > i2c module, but for sure it's not in the i2c module. I really suggest to > put this SoC specific into the SoC specific clock driver rather than > littering the i2c driver with it. I am with Sascha here. The fact that you need to of_ioremap some registers is a really strong indication that the code should go somewhere else. I can't tell the best place (clock driver or seperate GUTS driver or syscon driver), but the I2C bus driver seems not suitable. --gv6qjm3xh6s2jhl3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlzT3OsACgkQFA3kzBSg KbbgNQ/8CGasqnfiTpZ11DFig8JEAVVpHiW7URbOcwfSNliiGRcajU0Z15c9dQrB FXq50Xgz1DAf+yhNgfWk28gZ9DdbGEdEvRUyZsW1oq/Vf2vJEx5wBQUB04Rw12KS 6OjdgBK1mWDHsbRcI7/Ug9nL2gWPTz/u0bzL9btM/AT7CDnKi+CiLlcjqrLGWT0b KasALzS/AfnrtXTqyNL2wdqkTZC6wrdjgiUswYQ1Yr065NZnHxrH/zR6RgOIA1ya p5A//ME3DiCQRLToYXM8KU8Rb/PW29n1GtefaiFyrrhXAg7ZPfR4y8n+AQTkgPUq 2Mcpz2nRod1e79YpgYm5+XpcTD7bgV7XZD8RH9uPKfpAW0W33QP0OFKG92RigTTW 6mJRvtus8S3VfaHatBupH/kQsnoyZXktZXRAdgWEa713zybXoGUzwvQICnJAUp5T sB2LxykMYyb8T862XbNzQtC+0cCDotY4ZZ2plIOlUrNomf37ZunQu5/uEecPf6s6 2MlVlzgTYTwG6lz5WxkZ6A2RTnx8rXvcr7jwo7wwVcjf9W2erTR18+tqU7bmtrol qh1V0XeufPewhKfCmSR+9yyP029AP4cwdRHNQNsg9oDQGzqYZxhHSKH1IMBt2PI1 Ozxlx/gjom3K5yCe1tWBIG0yzxnFvXJBHgGKimBFmYt4I8Eh2Uo= =q/1n -----END PGP SIGNATURE----- --gv6qjm3xh6s2jhl3--