diff options
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 14e83d0aac8c..4443d3bb3fbf 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
| @@ -839,9 +839,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
| 839 | { | 839 | { |
| 840 | struct pxa_i2c *i2c = &i2c_pxa; | 840 | struct pxa_i2c *i2c = &i2c_pxa; |
| 841 | struct resource *res; | 841 | struct resource *res; |
| 842 | #ifdef CONFIG_I2C_PXA_SLAVE | ||
| 843 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; | 842 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; |
| 844 | #endif | ||
| 845 | int ret; | 843 | int ret; |
| 846 | int irq; | 844 | int irq; |
| 847 | 845 | ||
| @@ -889,14 +887,14 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
| 889 | pxa_gpio_mode(GPIO117_I2CSCL_MD); | 887 | pxa_gpio_mode(GPIO117_I2CSCL_MD); |
| 890 | pxa_gpio_mode(GPIO118_I2CSDA_MD); | 888 | pxa_gpio_mode(GPIO118_I2CSDA_MD); |
| 891 | #endif | 889 | #endif |
| 892 | pxa_set_cken(CKEN14_I2C, 1); | 890 | pxa_set_cken(CKEN_I2C, 1); |
| 893 | break; | 891 | break; |
| 894 | #ifdef CONFIG_PXA27x | 892 | #ifdef CONFIG_PXA27x |
| 895 | case 1: | 893 | case 1: |
| 896 | local_irq_disable(); | 894 | local_irq_disable(); |
| 897 | PCFR |= PCFR_PI2CEN; | 895 | PCFR |= PCFR_PI2CEN; |
| 898 | local_irq_enable(); | 896 | local_irq_enable(); |
| 899 | pxa_set_cken(CKEN15_PWRI2C, 1); | 897 | pxa_set_cken(CKEN_PWRI2C, 1); |
| 900 | #endif | 898 | #endif |
| 901 | } | 899 | } |
| 902 | 900 | ||
| @@ -911,6 +909,10 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
| 911 | i2c->adap.algo_data = i2c; | 909 | i2c->adap.algo_data = i2c; |
| 912 | i2c->adap.dev.parent = &dev->dev; | 910 | i2c->adap.dev.parent = &dev->dev; |
| 913 | 911 | ||
| 912 | if (plat) { | ||
| 913 | i2c->adap.class = plat->class; | ||
| 914 | } | ||
| 915 | |||
| 914 | ret = i2c_add_adapter(&i2c->adap); | 916 | ret = i2c_add_adapter(&i2c->adap); |
| 915 | if (ret < 0) { | 917 | if (ret < 0) { |
| 916 | printk(KERN_INFO "I2C: Failed to add bus\n"); | 918 | printk(KERN_INFO "I2C: Failed to add bus\n"); |
| @@ -933,11 +935,11 @@ eadapt: | |||
| 933 | ereqirq: | 935 | ereqirq: |
| 934 | switch (dev->id) { | 936 | switch (dev->id) { |
| 935 | case 0: | 937 | case 0: |
| 936 | pxa_set_cken(CKEN14_I2C, 0); | 938 | pxa_set_cken(CKEN_I2C, 0); |
| 937 | break; | 939 | break; |
| 938 | #ifdef CONFIG_PXA27x | 940 | #ifdef CONFIG_PXA27x |
| 939 | case 1: | 941 | case 1: |
| 940 | pxa_set_cken(CKEN15_PWRI2C, 0); | 942 | pxa_set_cken(CKEN_PWRI2C, 0); |
| 941 | local_irq_disable(); | 943 | local_irq_disable(); |
| 942 | PCFR &= ~PCFR_PI2CEN; | 944 | PCFR &= ~PCFR_PI2CEN; |
| 943 | local_irq_enable(); | 945 | local_irq_enable(); |
| @@ -960,11 +962,11 @@ static int i2c_pxa_remove(struct platform_device *dev) | |||
| 960 | free_irq(i2c->irq, i2c); | 962 | free_irq(i2c->irq, i2c); |
| 961 | switch (dev->id) { | 963 | switch (dev->id) { |
| 962 | case 0: | 964 | case 0: |
| 963 | pxa_set_cken(CKEN14_I2C, 0); | 965 | pxa_set_cken(CKEN_I2C, 0); |
| 964 | break; | 966 | break; |
| 965 | #ifdef CONFIG_PXA27x | 967 | #ifdef CONFIG_PXA27x |
| 966 | case 1: | 968 | case 1: |
| 967 | pxa_set_cken(CKEN15_PWRI2C, 0); | 969 | pxa_set_cken(CKEN_PWRI2C, 0); |
| 968 | local_irq_disable(); | 970 | local_irq_disable(); |
| 969 | PCFR &= ~PCFR_PI2CEN; | 971 | PCFR &= ~PCFR_PI2CEN; |
| 970 | local_irq_enable(); | 972 | local_irq_enable(); |
