]> asedeno.scripts.mit.edu Git - linux.git/commit
i2c: tegra: Add DMA support
authorSowjanya Komatineni <skomatineni@nvidia.com>
Tue, 12 Feb 2019 19:06:46 +0000 (11:06 -0800)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 14 Feb 2019 16:48:26 +0000 (17:48 +0100)
commit86c92b9965ff1758952cd0d6c5f19eeeef291eea
tree4b41280c6c9ea1459b34f1d8438884c297f792ce
parentb03ff2a23359d0dd6f0a1516c6a9e9c4760ed230
i2c: tegra: Add DMA support

This patch adds DMA support for Tegra I2C.

Tegra I2C TX and RX FIFO depth is 8 words. PIO mode is used for
transfer size of the max FIFO depth and DMA mode is used for
transfer size higher than max FIFO depth to save CPU overhead.

PIO mode needs full intervention of CPU to fill or empty FIFO's
and also need to service multiple data requests interrupt for the
same transaction. This adds delay between data bytes of the same
transfer when CPU is fully loaded and some slave devices has
internal timeout for no bus activity and stops transaction to
avoid bus hang. DMA mode is helpful in such cases.

DMA mode is also helpful for Large transfers during downloading or
uploading FW over I2C to some external devices.

Tegra210 and prior Tegra chips use APBDMA driver which is replaced
with GPCDMA on Tegra186 and Tegra194.
This patch uses has_apb_dma flag in hw_feature to differentiate
DMA driver change between Tegra chipset.

APBDMA driver is registered from module-init level and this patch
also has a change to register I2C driver at module-init level
rather than subsys-init to avoid deferring I2C probe till APBDMA
driver is registered.

Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-tegra.c