diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2017-01-16 09:49:38 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-01-25 16:07:40 -0500 |
commit | 0e1929dedea36781e25902118c93edd8d8f09af1 (patch) | |
tree | 5e353f42c88f892c20528b8a4c28856919594944 | |
parent | 7a308bb3016f57e5be11a677d15b821536419d36 (diff) |
i2c: i2c-cadence: Initialize configuration before probing devices
The cadence I2C driver calls cdns_i2c_writereg(..) to setup a workaround
in the controller, but did so after calling i2c_add_adapter() which starts
probing devices on the bus. Change the order so that the configuration is
completely finished before using the adapter.
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | drivers/i2c/busses/i2c-cadence.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 686971263bef..45d6771fac8c 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c | |||
@@ -962,10 +962,6 @@ static int cdns_i2c_probe(struct platform_device *pdev) | |||
962 | goto err_clk_dis; | 962 | goto err_clk_dis; |
963 | } | 963 | } |
964 | 964 | ||
965 | ret = i2c_add_adapter(&id->adap); | ||
966 | if (ret < 0) | ||
967 | goto err_clk_dis; | ||
968 | |||
969 | /* | 965 | /* |
970 | * Cadence I2C controller has a bug wherein it generates | 966 | * Cadence I2C controller has a bug wherein it generates |
971 | * invalid read transaction after HW timeout in master receiver mode. | 967 | * invalid read transaction after HW timeout in master receiver mode. |
@@ -975,6 +971,10 @@ static int cdns_i2c_probe(struct platform_device *pdev) | |||
975 | */ | 971 | */ |
976 | cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET); | 972 | cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET); |
977 | 973 | ||
974 | ret = i2c_add_adapter(&id->adap); | ||
975 | if (ret < 0) | ||
976 | goto err_clk_dis; | ||
977 | |||
978 | dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n", | 978 | dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n", |
979 | id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq); | 979 | id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq); |
980 | 980 | ||