i2c: aspeed: Fix initial values of master and slave state
authorJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Mon, 2 Jul 2018 21:20:28 +0000 (14:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:05 +0000 (08:38 +0200)
commita8c0b9acf08f39e3b6fcf518fc0732f6fad64698
treedddce730496cb691c77c2d7f94a476d7ebd35e72
parentab605544f62b5151c2cb276f6771a8c423378926
i2c: aspeed: Fix initial values of master and slave state

[ Upstream commit 517fde0eb5a8f46c54ba6e2c36e32563b23cb14f ]

This patch changes the order of enum aspeed_i2c_master_state and
enum aspeed_i2c_slave_state defines to make their initial value to
ASPEED_I2C_MASTER_INACTIVE and ASPEED_I2C_SLAVE_STOP respectively.
In case of multi-master use, if a slave data comes ahead of the
first master xfer, master_state starts from an invalid state so
this change fixes the issue.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-aspeed.c