linux/drivers/i2c/busses
Michael Wu 61ab42c7f3 i2c: designware: determine HS tHIGH and tLOW based on HW parameters
In commit 35eba185fd ("i2c: designware: Calculate SCL timing parameter
for High Speed Mode") the SCL high period count and low period count for
high speed mode are calculated based on fixed tHIGH = 160 and tLOW = 120.
However, the set of two fixed values is only applicable to the combination
of hardware parameters IC_CAP_LOADING is 400 and IC_CLK_FREQ_OPTIMIZATION
is true. Outside of this combination, the SCL frequency may not reach
3.4 MHz because the fixed tHIGH and tLOW are not small enough.

If IC_CAP_LOADING is 400, it means the bus capacitance is 400pF;
Otherwise, 100 pF. If IC_CLK_FREQ_OPTIMIZATION is true, it means that the
hardware reduces its internal clock frequency by reducing the internal
latency required to generate the high period and low period of the SCL line.

Section 3.15.4.5 in DesignWare DW_apb_i2b Databook v2.03 says that when
IC_CLK_FREQ_OPTIMIZATION = 0,

    MIN_SCL_HIGHtime = 60 ns for 3.4 Mbps, bus loading = 100pF
		     = 120 ns for 3.4 Mbps, bus loading = 400pF
    MIN_SCL_LOWtime = 160 ns for 3.4 Mbps, bus loading = 100pF
		    = 320 ns for 3.4 Mbps, bus loading = 400pF

and section 3.15.4.6 says that when IC_CLK_FREQ_OPTIMIZATION = 1,

    MIN_SCL_HIGHtime = 60 ns for 3.4 Mbps, bus loading = 100pF
		     = 160 ns for 3.4 Mbps, bus loading = 400pF
    MIN_SCL_LOWtime = 120 ns for 3.4 Mbps, bus loading = 100pF
		    = 320 ns for 3.4 Mbps, bus loading = 400pF

In order to calculate more accurate SCL high period count and low period
count for high speed mode, two hardware parameters IC_CAP_LOADING and
IC_CLK_FREQ_OPTIMIZATION must be considered together. Since there're no
registers controlliing these these two hardware parameters, users can
declare them in the device tree so that the driver can obtain them.

Signed-off-by: Michael Wu <michael.wu@kneron.us>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-11-24 16:03:51 +01:00
..
i2c-acorn.c
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-altera.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-amd756.c i2c: Drop legacy muxing pseudo-drivers 2024-11-17 11:58:14 +01:00
i2c-amd8111.c
i2c-amd-asf-plat.c i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target 2024-11-17 11:57:29 +01:00
i2c-amd-mp2-pci.c
i2c-amd-mp2-plat.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-amd-mp2.h
i2c-aspeed.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-at91-core.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-at91-master.c
i2c-at91-slave.c
i2c-at91.h
i2c-au1550.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-axxia.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm2835.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm-iproc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-bcm-kona.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-brcmstb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cadence.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cbus-gpio.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ccgx-ucsi.c
i2c-ccgx-ucsi.h
i2c-cgbc.c
i2c-cht-wc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cp2615.c
i2c-cpm.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-cros-ec-tunnel.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-davinci.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-designware-amdpsp.c i2c: designware: Fix spelling and other issues in the comments 2024-11-13 23:29:47 +01:00
i2c-designware-baytrail.c
i2c-designware-common.c i2c: designware: determine HS tHIGH and tLOW based on HW parameters 2024-11-24 16:03:51 +01:00
i2c-designware-core.h i2c: designware: determine HS tHIGH and tLOW based on HW parameters 2024-11-24 16:03:51 +01:00
i2c-designware-master.c i2c: designware: determine HS tHIGH and tLOW based on HW parameters 2024-11-24 16:03:51 +01:00
i2c-designware-pcidrv.c i2c: designware: Use sda_hold_time variable name everywhere 2024-11-13 23:29:47 +01:00
i2c-designware-platdrv.c i2c: designware: Add ACPI HID for DWAPB I2C controller on FUJITSU-MONAKA 2024-11-24 16:03:50 +01:00
i2c-designware-slave.c i2c: designware: Fix spelling and other issues in the comments 2024-11-13 23:29:47 +01:00
i2c-digicolor.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-diolan-u2c.c
i2c-dln2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-eg20t.c
i2c-elektor.c
i2c-emev2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-exynos5.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-fsi.c
i2c-gpio.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-gxp.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-highlander.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-hisi.c
i2c-hix5hd2.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-hydra.c
i2c-i801.c i2c: i801: Add support for Intel Panther Lake 2024-11-13 23:29:46 +01:00
i2c-ibm_iic.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ibm_iic.h
i2c-icy.c
i2c-img-scb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-imx-lpi2c.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-imx.c i2c: imx: add support for S32G2/S32G3 SoCs 2024-11-17 11:58:56 +01:00
i2c-iop3xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-iop3xx.h
i2c-isch.c i2c: isch: Convert to kernel-doc 2024-11-13 23:29:46 +01:00
i2c-ismt.c
i2c-jz4780.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-keba.c
i2c-kempld.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ljca.c
i2c-lpc2k.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-ls2x.c
i2c-mchp-pci1xxxx.c
i2c-meson.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-microchip-corei2c.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mlxbf.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mlxcpld.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mpc.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mt65xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mt7621.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mv64xxx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-mxs.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-nforce2.c i2c: Drop legacy muxing pseudo-drivers 2024-11-17 11:58:14 +01:00
i2c-nomadik.c i2c: nomadik: support >=1MHz speed modes 2024-11-24 16:03:51 +01:00
i2c-npcm7xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-nvidia-gpu.c
i2c-ocores.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-octeon-core.c
i2c-octeon-core.h
i2c-octeon-platdrv.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-omap.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-opal.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-owl.c
i2c-parport.c
i2c-pasemi-core.c
i2c-pasemi-core.h
i2c-pasemi-pci.c
i2c-pasemi-platform.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-pca-isa.c
i2c-pca-platform.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-piix4.c i2c: amd-asf: Add ACPI support for AMD ASF Controller 2024-11-13 23:29:46 +01:00
i2c-piix4.h i2c: piix4: Export i2c_piix4 driver functions as library 2024-11-13 23:29:46 +01:00
i2c-pnx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-powermac.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-pxa-pci.c
i2c-pxa.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-qcom-cci.c i2c: qcom-cci: Remove unused struct member cci_clk_rate 2024-11-17 11:58:56 +01:00
i2c-qcom-geni.c i2c: qcom-geni: Keep comment why interrupts start disabled 2024-11-17 11:58:14 +01:00
i2c-qup.c i2c: qup: use generic device property accessors 2024-11-24 16:03:50 +01:00
i2c-rcar.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-riic.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-rk3x.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-robotfuzz-osif.c
i2c-rtl9300.c i2c: Add driver for the RTL9300 I2C controller 2024-11-17 11:58:57 +01:00
i2c-rzv2m.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-s3c2410.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-scmi.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sh7760.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sh_mobile.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sibyte.c
i2c-simtec.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-sprd.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-st.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-stm32.c
i2c-stm32.h
i2c-stm32f4.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-stm32f7.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-sun6i-p2wi.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-synquacer.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-taos-evm.c
i2c-tegra-bpmp.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-tegra.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-thunderx-pcidrv.c
i2c-tiny-usb.c
i2c-uniphier-f.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-uniphier.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-versatile.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-via.c
i2c-viai2c-common.c
i2c-viai2c-common.h
i2c-viai2c-wmt.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-viai2c-zhaoxin.c
i2c-viapro.c
i2c-viperboard.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-virtio.c
i2c-xgene-slimpro.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-xiic.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
i2c-xlp9xx.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00
Kconfig i2c-for-6.13-rc1 2024-11-21 13:19:29 -08:00
Makefile i2c-for-6.13-rc1 2024-11-21 13:19:29 -08:00
scx200_acb.c i2c: Switch back to struct platform_driver::remove() 2024-11-17 11:58:14 +01:00