i2c: meson: fix clock setting overwrite
authorJerome Brunet <jbrunet@baylibre.com>
Wed, 7 Oct 2020 08:07:49 +0000 (10:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 07:51:12 +0000 (09:51 +0200)
commit95ee9fe59ec81b2ff3205d34bf9854bdbe56a743
treec4c350a435da1b622d9e18d905b48fe74ae83c55
parent622d6a97851670dd2495340b4612d6b279d5de2f
i2c: meson: fix clock setting overwrite

commit 28683e847e2f20eed22cdd24f185d7783db396d3 upstream.

When the slave address is written in do_start(), SLAVE_ADDR is written
completely. This may overwrite some setting related to the clock rate
or signal filtering.

Fix this by writing only the bits related to slave address. To avoid
causing unexpected changed, explicitly disable filtering or high/low
clock mode which may have been left over by the bootloader.

Fixes: 30021e3707a7 ("i2c: add support for Amlogic Meson I2C controller")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-meson.c