Lines Matching refs:mantis
26 static int mantis_i2c_read(struct mantis_pci *mantis, const struct i2c_msg *msg) in mantis_i2c_read() argument
72 static int mantis_i2c_write(struct mantis_pci *mantis, const struct i2c_msg *msg) in mantis_i2c_write() argument
120 struct mantis_pci *mantis; in mantis_i2c_xfer() local
123 mantis = i2c_get_adapdata(adapter); in mantis_i2c_xfer()
124 BUG_ON(!mantis); in mantis_i2c_xfer()
125 config = mantis->hwconfig; in mantis_i2c_xfer()
129 mutex_lock(&mantis->i2c_lock); in mantis_i2c_xfer()
178 ret = mantis_i2c_read(mantis, &msgs[i]); in mantis_i2c_xfer()
180 ret = mantis_i2c_write(mantis, &msgs[i]); in mantis_i2c_xfer()
189 mutex_unlock(&mantis->i2c_lock); in mantis_i2c_xfer()
194 mutex_unlock(&mantis->i2c_lock); in mantis_i2c_xfer()
208 int mantis_i2c_init(struct mantis_pci *mantis) in mantis_i2c_init() argument
211 struct i2c_adapter *i2c_adapter = &mantis->adapter; in mantis_i2c_init()
212 struct pci_dev *pdev = mantis->pdev; in mantis_i2c_init()
214 init_waitqueue_head(&mantis->i2c_wq); in mantis_i2c_init()
215 mutex_init(&mantis->i2c_lock); in mantis_i2c_init()
217 i2c_set_adapdata(i2c_adapter, mantis); in mantis_i2c_init()
226 mantis->i2c_rc = i2c_add_adapter(i2c_adapter); in mantis_i2c_init()
227 if (mantis->i2c_rc < 0) in mantis_i2c_init()
228 return mantis->i2c_rc; in mantis_i2c_init()
236 mantis_mask_ints(mantis, MANTIS_INT_I2CDONE); in mantis_i2c_init()
242 int mantis_i2c_exit(struct mantis_pci *mantis) in mantis_i2c_exit() argument
245 mantis_mask_ints(mantis, MANTIS_INT_I2CDONE); in mantis_i2c_exit()
248 i2c_del_adapter(&mantis->adapter); in mantis_i2c_exit()