diff options
| -rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 70f7ab829d36..86e2234faf80 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
| @@ -899,6 +899,12 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num | |||
| 899 | struct pxa_i2c *i2c = adap->algo_data; | 899 | struct pxa_i2c *i2c = adap->algo_data; |
| 900 | int ret, i; | 900 | int ret, i; |
| 901 | 901 | ||
| 902 | /* If the I2C controller is disabled we need to reset it (probably due | ||
| 903 | to a suspend/resume destroying state). We do this here as we can then | ||
| 904 | avoid worrying about resuming the controller before its users. */ | ||
| 905 | if (!(ICR & ICR_IUE)) | ||
| 906 | i2c_pxa_reset(i2c); | ||
| 907 | |||
| 902 | for (i = adap->retries; i >= 0; i--) { | 908 | for (i = adap->retries; i >= 0; i--) { |
| 903 | ret = i2c_pxa_do_xfer(i2c, msgs, num); | 909 | ret = i2c_pxa_do_xfer(i2c, msgs, num); |
| 904 | if (ret != I2C_RETRY) | 910 | if (ret != I2C_RETRY) |
| @@ -939,7 +945,9 @@ static struct pxa_i2c i2c_pxa = { | |||
| 939 | static int i2c_pxa_probe(struct platform_device *dev) | 945 | static int i2c_pxa_probe(struct platform_device *dev) |
| 940 | { | 946 | { |
| 941 | struct pxa_i2c *i2c = &i2c_pxa; | 947 | struct pxa_i2c *i2c = &i2c_pxa; |
| 948 | #ifdef CONFIG_I2C_PXA_SLAVE | ||
| 942 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; | 949 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; |
| 950 | #endif | ||
| 943 | int ret; | 951 | int ret; |
| 944 | 952 | ||
| 945 | #ifdef CONFIG_PXA27x | 953 | #ifdef CONFIG_PXA27x |
| @@ -1024,5 +1032,7 @@ static void i2c_adap_pxa_exit(void) | |||
| 1024 | return platform_driver_unregister(&i2c_pxa_driver); | 1032 | return platform_driver_unregister(&i2c_pxa_driver); |
| 1025 | } | 1033 | } |
| 1026 | 1034 | ||
| 1035 | MODULE_LICENSE("GPL"); | ||
| 1036 | |||
| 1027 | module_init(i2c_adap_pxa_init); | 1037 | module_init(i2c_adap_pxa_init); |
| 1028 | module_exit(i2c_adap_pxa_exit); | 1038 | module_exit(i2c_adap_pxa_exit); |
