Lines Matching +full:acquisition +full:- +full:time

6  * Author: Guenter Roeck <linux@roeck-us.net>
11 * Copyright (c) 2008-2009 Rodolfo Giometti <giometti@linux.it>
12 * Copyright (c) 2008-2009 Eurotech S.p.A. <info@eurotech.it>
23 #include <linux/i2c-mux.h>
36 * single-channel I2C bus multiplexer.
40 * that only one of the masters is instantiated at any given time.
68 #define ARB2_TIMEOUT (HZ / 4) /* 250 ms until acquisition failure */
97 * as they will try to lock the adapter a second time.
101 struct i2c_adapter *adap = client->adapter; in pca9541_reg_write()
104 return __i2c_smbus_xfer(adap, client->addr, client->flags, in pca9541_reg_write()
111 * as they will try to lock adapter a second time.
115 struct i2c_adapter *adap = client->adapter; in pca9541_reg_read()
119 ret = __i2c_smbus_xfer(adap, client->addr, client->flags, in pca9541_reg_read()
142 * Arbitration is defined as a two-step process. A bus master can only activate
144 * This multi-step process ensures that access contention is resolved
149 * ----------------------------------------------------
150 * off - yes wait for arbitration timeout or
154 * on yes - done
155 * on no - wait for arbitration timeout or
159 * request ownership at the same time. In this case, one master will turn on
196 || time_is_before_eq_jiffies(data->arb_timeout)) { in pca9541_arbitrate()
205 data->select_timeout = SELECT_DELAY_SHORT; in pca9541_arbitrate()
209 * Set extra long timeout to give it time to acquire it. in pca9541_arbitrate()
211 data->select_timeout = SELECT_DELAY_LONG * 2; in pca9541_arbitrate()
215 * Bus is on, and we own it. We are done with acquisition. in pca9541_arbitrate()
230 data->select_timeout = SELECT_DELAY_LONG; in pca9541_arbitrate()
231 if (time_is_before_eq_jiffies(data->arb_timeout)) { in pca9541_arbitrate()
232 /* Time is up, take the bus and reset it. */ in pca9541_arbitrate()
252 struct i2c_client *client = data->client; in pca9541_select_chan()
255 /* give up after this time */ in pca9541_select_chan()
257 data->arb_timeout = jiffies + ARB_TIMEOUT; in pca9541_select_chan()
258 /* force bus ownership after this time */ in pca9541_select_chan()
265 if (data->select_timeout == SELECT_DELAY_SHORT) in pca9541_select_chan()
266 udelay(data->select_timeout); in pca9541_select_chan()
268 msleep(data->select_timeout / 1000); in pca9541_select_chan()
271 return -ETIMEDOUT; in pca9541_select_chan()
277 struct i2c_client *client = data->client; in pca9541_release_chan()
288 struct i2c_adapter *adap = client->adapter; in pca9541_probe()
294 return -ENODEV; in pca9541_probe()
306 muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data), in pca9541_probe()
310 return -ENOMEM; in pca9541_probe()
313 data->client = client; in pca9541_probe()
321 dev_info(&client->dev, "registered master selector for I2C %s\n", in pca9541_probe()
322 client->name); in pca9541_probe()
346 MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");