• Home
  • Raw
  • Download

Lines Matching refs:client

100 	struct i2c_client		*client;  member
109 static int fsa9480_write_reg(struct i2c_client *client, in fsa9480_write_reg() argument
114 ret = i2c_smbus_write_byte_data(client, reg, value); in fsa9480_write_reg()
117 dev_err(&client->dev, "%s: err %d\n", __func__, ret); in fsa9480_write_reg()
122 static int fsa9480_read_reg(struct i2c_client *client, int reg) in fsa9480_read_reg() argument
126 ret = i2c_smbus_read_byte_data(client, reg); in fsa9480_read_reg()
129 dev_err(&client->dev, "%s: err %d\n", __func__, ret); in fsa9480_read_reg()
134 static int fsa9480_read_irq(struct i2c_client *client, int *value) in fsa9480_read_irq() argument
138 ret = i2c_smbus_read_i2c_block_data(client, in fsa9480_read_irq()
143 dev_err(&client->dev, "%s: err %d\n", __func__, ret); in fsa9480_read_irq()
151 struct i2c_client *client = usbsw->client; in fsa9480_set_switch() local
155 value = fsa9480_read_reg(client, FSA9480_REG_CTRL); in fsa9480_set_switch()
178 fsa9480_write_reg(client, FSA9480_REG_MANSW1, path); in fsa9480_set_switch()
179 fsa9480_write_reg(client, FSA9480_REG_CTRL, value); in fsa9480_set_switch()
185 struct i2c_client *client = usbsw->client; in fsa9480_get_switch() local
188 value = fsa9480_read_reg(client, FSA9480_REG_MANSW1); in fsa9480_get_switch()
209 struct i2c_client *client = usbsw->client; in fsa9480_show_device() local
212 dev1 = fsa9480_read_reg(client, FSA9480_REG_DEV_T1); in fsa9480_show_device()
213 dev2 = fsa9480_read_reg(client, FSA9480_REG_DEV_T2); in fsa9480_show_device()
271 struct i2c_client *client = usbsw->client; in fsa9480_detect_dev() local
273 val1 = fsa9480_read_reg(client, FSA9480_REG_DEV_T1); in fsa9480_detect_dev()
274 val2 = fsa9480_read_reg(client, FSA9480_REG_DEV_T2); in fsa9480_detect_dev()
275 ctrl = fsa9480_read_reg(client, FSA9480_REG_CTRL); in fsa9480_detect_dev()
277 dev_info(&client->dev, "intr: 0x%x, dev1: 0x%x, dev2: 0x%x\n", in fsa9480_detect_dev()
290 fsa9480_write_reg(client, in fsa9480_detect_dev()
301 fsa9480_write_reg(client, in fsa9480_detect_dev()
350 fsa9480_write_reg(client, FSA9480_REG_CTRL, ctrl); in fsa9480_detect_dev()
356 struct i2c_client *client = usbsw->client; in fsa9480_irq_handler() local
360 fsa9480_read_irq(client, &intr); in fsa9480_irq_handler()
371 struct i2c_client *client = usbsw->client; in fsa9480_irq_init() local
377 fsa9480_read_irq(client, &intr); in fsa9480_irq_init()
380 fsa9480_write_reg(client, FSA9480_REG_INT1_MASK, 0xfc); in fsa9480_irq_init()
381 fsa9480_write_reg(client, FSA9480_REG_INT2_MASK, 0x1f); in fsa9480_irq_init()
383 usbsw->mansw = fsa9480_read_reg(client, FSA9480_REG_MANSW1); in fsa9480_irq_init()
388 fsa9480_write_reg(client, FSA9480_REG_CTRL, ctrl); in fsa9480_irq_init()
393 if (client->irq) { in fsa9480_irq_init()
394 ret = request_threaded_irq(client->irq, NULL, in fsa9480_irq_init()
399 dev_err(&client->dev, "failed to reqeust IRQ\n"); in fsa9480_irq_init()
404 device_init_wakeup(&client->dev, pdata->wakeup); in fsa9480_irq_init()
410 static int fsa9480_probe(struct i2c_client *client, in fsa9480_probe() argument
413 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); in fsa9480_probe()
422 dev_err(&client->dev, "failed to allocate driver data\n"); in fsa9480_probe()
426 usbsw->client = client; in fsa9480_probe()
427 usbsw->pdata = client->dev.platform_data; in fsa9480_probe()
431 i2c_set_clientdata(client, usbsw); in fsa9480_probe()
437 ret = sysfs_create_group(&client->dev.kobj, &fsa9480_group); in fsa9480_probe()
439 dev_err(&client->dev, in fsa9480_probe()
445 fsa9480_write_reg(client, FSA9480_REG_TIMING1, 0x6); in fsa9480_probe()
453 pm_runtime_set_active(&client->dev); in fsa9480_probe()
458 if (client->irq) in fsa9480_probe()
459 free_irq(client->irq, usbsw); in fsa9480_probe()
465 static int fsa9480_remove(struct i2c_client *client) in fsa9480_remove() argument
467 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); in fsa9480_remove()
468 if (client->irq) in fsa9480_remove()
469 free_irq(client->irq, usbsw); in fsa9480_remove()
471 sysfs_remove_group(&client->dev.kobj, &fsa9480_group); in fsa9480_remove()
472 device_init_wakeup(&client->dev, 0); in fsa9480_remove()
481 struct i2c_client *client = to_i2c_client(dev); in fsa9480_suspend() local
482 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); in fsa9480_suspend()
485 if (device_may_wakeup(&client->dev) && client->irq) in fsa9480_suspend()
486 enable_irq_wake(client->irq); in fsa9480_suspend()
496 struct i2c_client *client = to_i2c_client(dev); in fsa9480_resume() local
497 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); in fsa9480_resume()
500 if (device_may_wakeup(&client->dev) && client->irq) in fsa9480_resume()
501 disable_irq_wake(client->irq); in fsa9480_resume()
508 fsa9480_read_reg(client, FSA9480_REG_INT1); in fsa9480_resume()
509 fsa9480_read_reg(client, FSA9480_REG_INT2); in fsa9480_resume()
511 dev1 = fsa9480_read_reg(client, FSA9480_REG_DEV_T1); in fsa9480_resume()
512 dev2 = fsa9480_read_reg(client, FSA9480_REG_DEV_T2); in fsa9480_resume()