aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index c059b27fa881..873544ab598e 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -852,9 +852,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
852{ 852{
853 struct pxa_i2c *i2c = &i2c_pxa; 853 struct pxa_i2c *i2c = &i2c_pxa;
854 struct resource *res; 854 struct resource *res;
855#ifdef CONFIG_I2C_PXA_SLAVE
856 struct i2c_pxa_platform_data *plat = dev->dev.platform_data; 855 struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
857#endif
858 int ret; 856 int ret;
859 int irq; 857 int irq;
860 858
@@ -902,14 +900,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
902 pxa_gpio_mode(GPIO117_I2CSCL_MD); 900 pxa_gpio_mode(GPIO117_I2CSCL_MD);
903 pxa_gpio_mode(GPIO118_I2CSDA_MD); 901 pxa_gpio_mode(GPIO118_I2CSDA_MD);
904#endif 902#endif
905 pxa_set_cken(CKEN14_I2C, 1); 903 pxa_set_cken(CKEN_I2C, 1);
906 break; 904 break;
907#ifdef CONFIG_PXA27x 905#ifdef CONFIG_PXA27x
908 case 1: 906 case 1:
909 local_irq_disable(); 907 local_irq_disable();
910 PCFR |= PCFR_PI2CEN; 908 PCFR |= PCFR_PI2CEN;
911 local_irq_enable(); 909 local_irq_enable();
912 pxa_set_cken(CKEN15_PWRI2C, 1); 910 pxa_set_cken(CKEN_PWRI2C, 1);
913#endif 911#endif
914 } 912 }
915 913
@@ -924,6 +922,10 @@ static int i2c_pxa_probe(struct platform_device *dev)
924 i2c->adap.algo_data = i2c; 922 i2c->adap.algo_data = i2c;
925 i2c->adap.dev.parent = &dev->dev; 923 i2c->adap.dev.parent = &dev->dev;
926 924
925 if (plat) {
926 i2c->adap.class = plat->class;
927 }
928
927 ret = i2c_add_adapter(&i2c->adap); 929 ret = i2c_add_adapter(&i2c->adap);
928 if (ret < 0) { 930 if (ret < 0) {
929 printk(KERN_INFO "I2C: Failed to add bus\n"); 931 printk(KERN_INFO "I2C: Failed to add bus\n");
@@ -946,11 +948,11 @@ eadapt:
946ereqirq: 948ereqirq:
947 switch (dev->id) { 949 switch (dev->id) {
948 case 0: 950 case 0:
949 pxa_set_cken(CKEN14_I2C, 0); 951 pxa_set_cken(CKEN_I2C, 0);
950 break; 952 break;
951#ifdef CONFIG_PXA27x 953#ifdef CONFIG_PXA27x
952 case 1: 954 case 1:
953 pxa_set_cken(CKEN15_PWRI2C, 0); 955 pxa_set_cken(CKEN_PWRI2C, 0);
954 local_irq_disable(); 956 local_irq_disable();
955 PCFR &= ~PCFR_PI2CEN; 957 PCFR &= ~PCFR_PI2CEN;
956 local_irq_enable(); 958 local_irq_enable();
@@ -973,11 +975,11 @@ static int i2c_pxa_remove(struct platform_device *dev)
973 free_irq(i2c->irq, i2c); 975 free_irq(i2c->irq, i2c);
974 switch (dev->id) { 976 switch (dev->id) {
975 case 0: 977 case 0:
976 pxa_set_cken(CKEN14_I2C, 0); 978 pxa_set_cken(CKEN_I2C, 0);
977 break; 979 break;
978#ifdef CONFIG_PXA27x 980#ifdef CONFIG_PXA27x
979 case 1: 981 case 1:
980 pxa_set_cken(CKEN15_PWRI2C, 0); 982 pxa_set_cken(CKEN_PWRI2C, 0);
981 local_irq_disable(); 983 local_irq_disable();
982 PCFR &= ~PCFR_PI2CEN; 984 PCFR &= ~PCFR_PI2CEN;
983 local_irq_enable(); 985 local_irq_enable();