• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/mfd/

Lines Matching refs:tps

197 	struct tps65010	*tps = s->private;
203 switch (tps->model) {
213 mutex_lock(&tps->lock);
216 seq_printf(s, "%scharging\n\n", tps->charging ? "" : "(not) ");
222 value = i2c_smbus_read_byte_data(tps->client, TPS_CHGCONFIG);
223 dbg_chgconf(tps->por, buf, sizeof buf, value);
226 value = i2c_smbus_read_byte_data(tps->client, TPS_CHGSTATUS);
229 value = i2c_smbus_read_byte_data(tps->client, TPS_MASK1);
234 value = i2c_smbus_read_byte_data(tps->client, TPS_REGSTATUS);
237 value = i2c_smbus_read_byte_data(tps->client, TPS_MASK2);
242 (void) schedule_delayed_work(&tps->work, POWER_POLL_DELAY);
246 value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1);
250 value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC2);
254 value = i2c_smbus_read_byte_data(tps->client, TPS_VREGS1);
259 value = i2c_smbus_read_byte_data(tps->client, TPS_LED1_ON);
260 v2 = i2c_smbus_read_byte_data(tps->client, TPS_LED1_PER);
268 value = i2c_smbus_read_byte_data(tps->client, TPS_LED2_ON);
269 v2 = i2c_smbus_read_byte_data(tps->client, TPS_LED2_PER);
277 value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
278 v2 = i2c_smbus_read_byte_data(tps->client, TPS_MASK3);
292 mutex_unlock(&tps->lock);
317 static void tps65010_interrupt(struct tps65010 *tps)
327 if (tps->nmask2) {
328 tmp = i2c_smbus_read_byte_data(tps->client, TPS_REGSTATUS);
329 mask = tmp ^ tps->regstatus;
330 tps->regstatus = tmp;
331 mask &= tps->nmask2;
335 tps->regstatus = tmp;
346 if (tps->nmask1) {
347 tmp = i2c_smbus_read_byte_data(tps->client, TPS_CHGSTATUS);
348 mask = tmp ^ tps->chgstatus;
349 tps->chgstatus = tmp;
350 mask &= tps->nmask1;
358 show_chgconfig(tps->por, "conf", tps->chgconf);
364 if (!(tps->chgstatus & ~(TPS_CHG_USB|TPS_CHG_AC))
365 && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))
366 && (tps->chgconf & TPS_CHARGE_ENABLE)
368 if (tps->chgstatus & TPS_CHG_USB) {
371 set_bit(FLAG_VBUS_CHANGED, &tps->flags);
373 } else if (tps->chgstatus & TPS_CHG_AC)
376 if (charging != tps->charging) {
377 tps->charging = charging;
380 ((tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))
388 if ((tps->model != TPS65013 || !tps->charging)
389 && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC)))
392 (void) schedule_delayed_work(&tps->work, POWER_POLL_DELAY);
400 struct tps65010 *tps;
402 tps = container_of(work, struct tps65010, work.work);
403 mutex_lock(&tps->lock);
405 tps65010_interrupt(tps);
407 if (test_and_clear_bit(FLAG_VBUS_CHANGED, &tps->flags)) {
411 chgconfig = i2c_smbus_read_byte_data(tps->client,
414 if (tps->vbus == 500)
416 else if (tps->vbus >= 100)
419 status = i2c_smbus_write_byte_data(tps->client,
423 tmp = i2c_smbus_read_byte_data(tps->client, TPS_CHGCONFIG);
424 tps->chgconf = tmp;
425 show_chgconfig(tps->por, "update vbus", tmp);
428 if (test_and_clear_bit(FLAG_IRQ_ENABLE, &tps->flags))
429 enable_irq(tps->client->irq);
431 mutex_unlock(&tps->lock);
436 struct tps65010 *tps = _tps;
439 set_bit(FLAG_IRQ_ENABLE, &tps->flags);
440 (void) schedule_work(&tps->work.work);
466 struct tps65010 *tps;
468 tps = container_of(chip, struct tps65010, chip);
469 if (!(tps->outmask & (1 << offset)))
483 struct tps65010 *tps;
485 tps = container_of(chip, struct tps65010, chip);
488 value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
508 struct tps65010 *tps = i2c_get_clientdata(client);
518 free_irq(client->irq, tps);
519 cancel_delayed_work(&tps->work);
521 debugfs_remove(tps->file);
522 kfree(tps);
530 struct tps65010 *tps;
542 tps = kzalloc(sizeof *tps, GFP_KERNEL);
543 if (!tps)
546 mutex_init(&tps->lock);
547 INIT_DELAYED_WORK(&tps->work, tps65010_work);
548 tps->client = client;
549 tps->model = id->driver_data;
557 DRIVER_NAME, tps);
564 set_bit(FLAG_IRQ_ENABLE, &tps->flags);
569 switch (tps->model) {
572 tps->por = 1;
576 tps->chgconf = i2c_smbus_read_byte_data(client, TPS_CHGCONFIG);
577 show_chgconfig(tps->por, "conf/init", tps->chgconf);
592 i2c_set_clientdata(client, tps);
593 the_tps = tps;
600 tps->vbus = 100;
607 tps->nmask1 = ~0;
608 (void) i2c_smbus_write_byte_data(client, TPS_MASK1, ~tps->nmask1);
610 tps->nmask2 = TPS_REG_ONOFF;
611 if (tps->model == TPS65013)
612 tps->nmask2 |= TPS_REG_NO_CHG;
613 (void) i2c_smbus_write_byte_data(client, TPS_MASK2, ~tps->nmask2);
618 tps65010_work(&tps->work.work);
620 tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL,
621 tps, DEBUG_FOPS);
625 tps->outmask = board->outmask;
627 tps->chip.label = client->name;
628 tps->chip.dev = &client->dev;
629 tps->chip.owner = THIS_MODULE;
631 tps->chip.set = tps65010_gpio_set;
632 tps->chip.direction_output = tps65010_output;
635 tps->chip.get = tps65010_gpio_get;
637 tps->chip.base = board->base;
638 tps->chip.ngpio = 7;
639 tps->chip.can_sleep = 1;
641 status = gpiochip_add(&tps->chip);
658 kfree(tps);