Changeset 25725


Ignore:
Timestamp:
2011-02-26T07:23:23+01:00 (5 years ago)
Author:
nbd
Message:

ixp4xx: fix the i2c pld driver for 2.6.37 - i2c uses a rt_mutex instead of a mutex now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch

    r23964 r25725  
    5252+ * The Gateworks I2C PLD chip does not properly send the acknowledge bit 
    5353+ * thus we cannot use standard i2c_smbus functions. We have recreated 
    54 + * our own here, but we still use the mutex_lock to lock the i2c_bus 
     54+ * our own here, but we still use the rt_mutex_lock to lock the i2c_bus 
    5555+ * as the device still exists on the I2C bus. 
    5656+*/ 
     
    180180+       struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); 
    181181+       struct i2c_adapter *adap = gpio->client->adapter; 
    182 +        
     182+ 
    183183+       if (in_atomic() || irqs_disabled()) { 
    184 +               ret = mutex_trylock(&adap->bus_lock); 
     184+               ret = rt_mutex_trylock(&adap->bus_lock); 
    185185+               if (!ret) 
    186186+                       /* I2C activity is ongoing. */ 
    187187+                       return -EAGAIN; 
    188188+       } else { 
    189 +               mutex_lock_nested(&adap->bus_lock, adap->level); 
     189+               rt_mutex_lock(&adap->bus_lock); 
    190190+       } 
    191191+ 
     
    194194+       ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); 
    195195+ 
    196 +       mutex_unlock(&adap->bus_lock); 
     196+       rt_mutex_unlock(&adap->bus_lock); 
    197197+ 
    198198+       return ret; 
     
    205205+       struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); 
    206206+       struct i2c_adapter *adap = gpio->client->adapter; 
    207 +        
     207+ 
    208208+       if (in_atomic() || irqs_disabled()) { 
    209 +               ret = mutex_trylock(&adap->bus_lock); 
     209+               ret = rt_mutex_trylock(&adap->bus_lock); 
    210210+               if (!ret) 
    211211+                       /* I2C activity is ongoing. */ 
    212212+                       return -EAGAIN; 
    213213+       } else { 
    214 +               mutex_lock_nested(&adap->bus_lock, adap->level); 
     214+               rt_mutex_lock(&adap->bus_lock); 
    215215+       } 
    216216+ 
    217217+       value = i2c_pld_read_byte(gpio->client->addr); 
    218218+ 
    219 +       mutex_unlock(&adap->bus_lock); 
     219+       rt_mutex_unlock(&adap->bus_lock); 
    220220+ 
    221221+       return (value < 0) ? 0 : (value & (1 << offset)); 
     
    230230+ 
    231231+       unsigned bit = 1 << offset; 
    232 +        
     232+ 
    233233+       if (in_atomic() || irqs_disabled()) { 
    234 +               ret = mutex_trylock(&adap->bus_lock); 
     234+               ret = rt_mutex_trylock(&adap->bus_lock); 
    235235+               if (!ret) 
    236236+                       /* I2C activity is ongoing. */ 
    237237+                       return -EAGAIN; 
    238238+       } else { 
    239 +               mutex_lock_nested(&adap->bus_lock, adap->level); 
     239+               rt_mutex_lock(&adap->bus_lock); 
    240240+       } 
    241241+ 
     
    248248+       ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); 
    249249+ 
    250 +       mutex_unlock(&adap->bus_lock); 
     250+       rt_mutex_unlock(&adap->bus_lock); 
    251251+ 
    252252+       return ret; 
Note: See TracChangeset for help on using the changeset viewer.