mbox series

[v3,0/2] i2c: i2c-stm32f7: allow range of I2C bus frequency

Message ID 1587394677-6872-1-git-send-email-alain.volmat@st.com
Headers show
Series i2c: i2c-stm32f7: allow range of I2C bus frequency | expand

Message

Alain Volmat April 20, 2020, 2:57 p.m. UTC
This serie introduces the possibility to set bus frequency other
than 100KHz, 400KHz and 1MHz.

Changelog:
v3: fix i2c: i2c-stm32f7: allows for any bus frequency patch
v2: fix i2c: i2c-stm32f7: allows for any bus frequency patch

Alain Volmat (2):
  dt-bindings: i2c: i2c-stm32f7: allow clock-frequency range
  i2c: i2c-stm32f7: allows for any bus frequency

 .../devicetree/bindings/i2c/st,stm32-i2c.yaml      |   8 +-
 drivers/i2c/busses/i2c-stm32f7.c                   | 125 +++++++++++----------
 2 files changed, 68 insertions(+), 65 deletions(-)

Comments

Wolfram Sang April 26, 2020, 7:54 a.m. UTC | #1
On Mon, Apr 20, 2020 at 04:57:57PM +0200, 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.
> 
> Signed-off-by: Alain Volmat <alain.volmat@st.com>
> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>

Fixed this checkpatch CHECK:

CHECK: Macro argument 'rate' may be better as '(rate)' to avoid precedence issues
#133: FILE: drivers/i2c/busses/i2c-stm32f7.c:413:
+#define	RATE_MIN(rate)	(rate * 8 / 10)

and applied to for-next.

If you could drop the 'i2c-' prefix in $subject, that would save me one
step.

Thanks!