i2c: xiic: Add SCL frequency configuration support
authorRaviteja Narayanam <raviteja.narayanam@xilinx.com>
Wed, 15 Feb 2023 13:32:24 +0000 (19:02 +0530)
committerWolfram Sang <wsa@kernel.org>
Fri, 17 Feb 2023 21:43:13 +0000 (22:43 +0100)
commit6d8ffbe6618c47021c48cfff31f5d9d354ca44b9
tree7d565f5b441fca709141cd6062a4e7ce961d59b4
parent9b97cd61ee1ca7ba9a7005afd52f963a811b492c
i2c: xiic: Add SCL frequency configuration support

From 'clock-frequency' device tree property, configure I2C SCL
frequency by calculating the timing register values according to
input clock.

After soft reset in reinit function, the timing registers are set
to default values (configured in design tool). So, setting SCL
frequency is done inside reinit function after the soft reset.
This allows configuration of SCL frequency exclusively through
software via device tree property, overriding the design.
If the clock-frequency parameter is not specified in DT, driver
doesn't configure frequency, making it backward compatible.

Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-xiic.c