pchg 248 drivers/infiniband/hw/qib/qib_tx.c u64 pchbusy, pchg, piov, pnew; pchg 251 drivers/infiniband/hw/qib/qib_tx.c pchg = dd->pioavailkernel[i] & pchg 253 drivers/infiniband/hw/qib/qib_tx.c pchbusy = pchg << QLOGIC_IB_SENDPIOAVAIL_BUSY_SHIFT; pchg 254 drivers/infiniband/hw/qib/qib_tx.c if (pchg && (pchbusy & dd->pioavailshadow[i])) { pchg 101 drivers/power/supply/lp8727_charger.c static int lp8727_read_bytes(struct lp8727_chg *pchg, u8 reg, u8 *data, u8 len) pchg 105 drivers/power/supply/lp8727_charger.c mutex_lock(&pchg->xfer_lock); pchg 106 drivers/power/supply/lp8727_charger.c ret = i2c_smbus_read_i2c_block_data(pchg->client, reg, len, data); pchg 107 drivers/power/supply/lp8727_charger.c mutex_unlock(&pchg->xfer_lock); pchg 112 drivers/power/supply/lp8727_charger.c static inline int lp8727_read_byte(struct lp8727_chg *pchg, u8 reg, u8 *data) pchg 114 drivers/power/supply/lp8727_charger.c return lp8727_read_bytes(pchg, reg, data, 1); pchg 117 drivers/power/supply/lp8727_charger.c static int lp8727_write_byte(struct lp8727_chg *pchg, u8 reg, u8 data) pchg 121 drivers/power/supply/lp8727_charger.c mutex_lock(&pchg->xfer_lock); pchg 122 drivers/power/supply/lp8727_charger.c ret = i2c_smbus_write_byte_data(pchg->client, reg, data); pchg 123 drivers/power/supply/lp8727_charger.c mutex_unlock(&pchg->xfer_lock); pchg 138 drivers/power/supply/lp8727_charger.c static int lp8727_init_device(struct lp8727_chg *pchg) pchg 145 drivers/power/supply/lp8727_charger.c ret = lp8727_read_bytes(pchg, LP8727_INT1, intstat, LP8788_NUM_INTREGS); pchg 150 drivers/power/supply/lp8727_charger.c ret = lp8727_write_byte(pchg, LP8727_CTRL1, val); pchg 155 drivers/power/supply/lp8727_charger.c return lp8727_write_byte(pchg, LP8727_CTRL2, val); pchg 158 drivers/power/supply/lp8727_charger.c static int lp8727_is_dedicated_charger(struct lp8727_chg *pchg) pchg 162 drivers/power/supply/lp8727_charger.c lp8727_read_byte(pchg, LP8727_STATUS1, &val); pchg 166 drivers/power/supply/lp8727_charger.c static int lp8727_is_usb_charger(struct lp8727_chg *pchg) pchg 170 drivers/power/supply/lp8727_charger.c lp8727_read_byte(pchg, LP8727_STATUS1, &val); pchg 174 drivers/power/supply/lp8727_charger.c static inline void lp8727_ctrl_switch(struct lp8727_chg *pchg, u8 sw) pchg 176 drivers/power/supply/lp8727_charger.c lp8727_write_byte(pchg, LP8727_SWCTRL, sw); pchg 179 drivers/power/supply/lp8727_charger.c static void lp8727_id_detection(struct lp8727_chg *pchg, u8 id, int vbusin) pchg 181 drivers/power/supply/lp8727_charger.c struct lp8727_platform_data *pdata = pchg->pdata; pchg 188 drivers/power/supply/lp8727_charger.c pchg->chg_param = pdata ? pdata->ac : NULL; pchg 191 drivers/power/supply/lp8727_charger.c if (lp8727_is_dedicated_charger(pchg)) { pchg 192 drivers/power/supply/lp8727_charger.c pchg->chg_param = pdata ? pdata->ac : NULL; pchg 194 drivers/power/supply/lp8727_charger.c } else if (lp8727_is_usb_charger(pchg)) { pchg 195 drivers/power/supply/lp8727_charger.c pchg->chg_param = pdata ? pdata->usb : NULL; pchg 205 drivers/power/supply/lp8727_charger.c pchg->chg_param = NULL; pchg 209 drivers/power/supply/lp8727_charger.c pchg->devid = devid; pchg 210 drivers/power/supply/lp8727_charger.c lp8727_ctrl_switch(pchg, swctrl); pchg 213 drivers/power/supply/lp8727_charger.c static void lp8727_enable_chgdet(struct lp8727_chg *pchg) pchg 217 drivers/power/supply/lp8727_charger.c lp8727_read_byte(pchg, LP8727_CTRL2, &val); pchg 219 drivers/power/supply/lp8727_charger.c lp8727_write_byte(pchg, LP8727_CTRL2, val); pchg 224 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = container_of(_work, struct lp8727_chg, pchg 230 drivers/power/supply/lp8727_charger.c if (lp8727_read_bytes(pchg, LP8727_INT1, intstat, LP8788_NUM_INTREGS)) { pchg 231 drivers/power/supply/lp8727_charger.c dev_err(pchg->dev, "can not read INT registers\n"); pchg 238 drivers/power/supply/lp8727_charger.c lp8727_id_detection(pchg, idno, vbus); pchg 239 drivers/power/supply/lp8727_charger.c lp8727_enable_chgdet(pchg); pchg 241 drivers/power/supply/lp8727_charger.c power_supply_changed(pchg->psy->ac); pchg 242 drivers/power/supply/lp8727_charger.c power_supply_changed(pchg->psy->usb); pchg 243 drivers/power/supply/lp8727_charger.c power_supply_changed(pchg->psy->batt); pchg 248 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = ptr; pchg 250 drivers/power/supply/lp8727_charger.c schedule_delayed_work(&pchg->work, pchg->debounce_jiffies); pchg 254 drivers/power/supply/lp8727_charger.c static int lp8727_setup_irq(struct lp8727_chg *pchg) pchg 257 drivers/power/supply/lp8727_charger.c int irq = pchg->client->irq; pchg 258 drivers/power/supply/lp8727_charger.c unsigned delay_msec = pchg->pdata ? pchg->pdata->debounce_msec : pchg 261 drivers/power/supply/lp8727_charger.c INIT_DELAYED_WORK(&pchg->work, lp8727_delayed_func); pchg 264 drivers/power/supply/lp8727_charger.c dev_warn(pchg->dev, "invalid irq number: %d\n", irq); pchg 270 drivers/power/supply/lp8727_charger.c "lp8727_irq", pchg); pchg 275 drivers/power/supply/lp8727_charger.c pchg->irq = irq; pchg 276 drivers/power/supply/lp8727_charger.c pchg->debounce_jiffies = msecs_to_jiffies(delay_msec); pchg 281 drivers/power/supply/lp8727_charger.c static void lp8727_release_irq(struct lp8727_chg *pchg) pchg 283 drivers/power/supply/lp8727_charger.c cancel_delayed_work_sync(&pchg->work); pchg 285 drivers/power/supply/lp8727_charger.c if (pchg->irq) pchg 286 drivers/power/supply/lp8727_charger.c free_irq(pchg->irq, pchg); pchg 310 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = dev_get_drvdata(psy->dev.parent); pchg 315 drivers/power/supply/lp8727_charger.c val->intval = lp8727_is_charger_attached(psy->desc->name, pchg->devid); pchg 336 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = dev_get_drvdata(psy->dev.parent); pchg 337 drivers/power/supply/lp8727_charger.c struct lp8727_platform_data *pdata = pchg->pdata; pchg 343 drivers/power/supply/lp8727_charger.c if (!lp8727_is_charger_attached(psy->desc->name, pchg->devid)) { pchg 348 drivers/power/supply/lp8727_charger.c lp8727_read_byte(pchg, LP8727_STATUS1, &read); pchg 355 drivers/power/supply/lp8727_charger.c lp8727_read_byte(pchg, LP8727_STATUS2, &read); pchg 399 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = dev_get_drvdata(psy->dev.parent); pchg 405 drivers/power/supply/lp8727_charger.c if (!lp8727_is_charger_attached(psy->desc->name, pchg->devid)) pchg 409 drivers/power/supply/lp8727_charger.c if (pchg->chg_param) { pchg 410 drivers/power/supply/lp8727_charger.c eoc_level = pchg->chg_param->eoc_level; pchg 411 drivers/power/supply/lp8727_charger.c ichg = pchg->chg_param->ichg; pchg 413 drivers/power/supply/lp8727_charger.c lp8727_write_byte(pchg, LP8727_CHGCTRL2, val); pchg 442 drivers/power/supply/lp8727_charger.c static int lp8727_register_psy(struct lp8727_chg *pchg) pchg 447 drivers/power/supply/lp8727_charger.c psy = devm_kzalloc(pchg->dev, sizeof(*psy), GFP_KERNEL); pchg 451 drivers/power/supply/lp8727_charger.c pchg->psy = psy; pchg 456 drivers/power/supply/lp8727_charger.c psy->ac = power_supply_register(pchg->dev, &lp8727_ac_desc, &psy_cfg); pchg 460 drivers/power/supply/lp8727_charger.c psy->usb = power_supply_register(pchg->dev, &lp8727_usb_desc, pchg 465 drivers/power/supply/lp8727_charger.c psy->batt = power_supply_register(pchg->dev, &lp8727_batt_desc, NULL); pchg 479 drivers/power/supply/lp8727_charger.c static void lp8727_unregister_psy(struct lp8727_chg *pchg) pchg 481 drivers/power/supply/lp8727_charger.c struct lp8727_psy *psy = pchg->psy; pchg 545 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg; pchg 560 drivers/power/supply/lp8727_charger.c pchg = devm_kzalloc(&cl->dev, sizeof(*pchg), GFP_KERNEL); pchg 561 drivers/power/supply/lp8727_charger.c if (!pchg) pchg 564 drivers/power/supply/lp8727_charger.c pchg->client = cl; pchg 565 drivers/power/supply/lp8727_charger.c pchg->dev = &cl->dev; pchg 566 drivers/power/supply/lp8727_charger.c pchg->pdata = pdata; pchg 567 drivers/power/supply/lp8727_charger.c i2c_set_clientdata(cl, pchg); pchg 569 drivers/power/supply/lp8727_charger.c mutex_init(&pchg->xfer_lock); pchg 571 drivers/power/supply/lp8727_charger.c ret = lp8727_init_device(pchg); pchg 573 drivers/power/supply/lp8727_charger.c dev_err(pchg->dev, "i2c communication err: %d", ret); pchg 577 drivers/power/supply/lp8727_charger.c ret = lp8727_register_psy(pchg); pchg 579 drivers/power/supply/lp8727_charger.c dev_err(pchg->dev, "power supplies register err: %d", ret); pchg 583 drivers/power/supply/lp8727_charger.c ret = lp8727_setup_irq(pchg); pchg 585 drivers/power/supply/lp8727_charger.c dev_err(pchg->dev, "irq handler err: %d", ret); pchg 586 drivers/power/supply/lp8727_charger.c lp8727_unregister_psy(pchg); pchg 595 drivers/power/supply/lp8727_charger.c struct lp8727_chg *pchg = i2c_get_clientdata(cl); pchg 597 drivers/power/supply/lp8727_charger.c lp8727_release_irq(pchg); pchg 598 drivers/power/supply/lp8727_charger.c lp8727_unregister_psy(pchg); pchg 133 drivers/power/supply/lp8788-charger.c static bool lp8788_is_charger_detected(struct lp8788_charger *pchg) pchg 137 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_STATUS, &data); pchg 147 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = dev_get_drvdata(psy->dev.parent); pchg 152 drivers/power/supply/lp8788-charger.c val->intval = lp8788_is_charger_detected(pchg); pchg 155 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_IDCIN, &read); pchg 166 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_status(struct lp8788_charger *pchg, pchg 173 drivers/power/supply/lp8788-charger.c ret = lp8788_read_byte(pchg->lp, LP8788_CHG_STATUS, &data); pchg 199 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_health(struct lp8788_charger *pchg, pchg 205 drivers/power/supply/lp8788-charger.c ret = lp8788_read_byte(pchg->lp, LP8788_CHG_STATUS, &data); pchg 219 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_present(struct lp8788_charger *pchg, pchg 225 drivers/power/supply/lp8788-charger.c ret = lp8788_read_byte(pchg->lp, LP8788_CHG_STATUS, &data); pchg 233 drivers/power/supply/lp8788-charger.c static int lp8788_get_vbatt_adc(struct lp8788_charger *pchg, int *result) pchg 235 drivers/power/supply/lp8788-charger.c struct iio_channel *channel = pchg->chan[LP8788_VBATT]; pchg 243 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_voltage(struct lp8788_charger *pchg, pchg 246 drivers/power/supply/lp8788-charger.c return lp8788_get_vbatt_adc(pchg, &val->intval); pchg 249 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_capacity(struct lp8788_charger *pchg, pchg 252 drivers/power/supply/lp8788-charger.c struct lp8788 *lp = pchg->lp; pchg 253 drivers/power/supply/lp8788-charger.c struct lp8788_charger_platform_data *pdata = pchg->pdata; pchg 276 drivers/power/supply/lp8788-charger.c ret = lp8788_get_vbatt_adc(pchg, &vbatt); pchg 287 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_temperature(struct lp8788_charger *pchg, pchg 290 drivers/power/supply/lp8788-charger.c struct iio_channel *channel = pchg->chan[LP8788_BATT_TEMP]; pchg 307 drivers/power/supply/lp8788-charger.c static int lp8788_get_battery_charging_current(struct lp8788_charger *pchg, pchg 312 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_IBATT, &read); pchg 320 drivers/power/supply/lp8788-charger.c static int lp8788_get_charging_termination_voltage(struct lp8788_charger *pchg, pchg 325 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_VTERM, &read); pchg 336 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = dev_get_drvdata(psy->dev.parent); pchg 340 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_status(pchg, val); pchg 342 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_health(pchg, val); pchg 344 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_present(pchg, val); pchg 346 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_voltage(pchg, val); pchg 348 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_capacity(pchg, val); pchg 350 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_temperature(pchg, val); pchg 352 drivers/power/supply/lp8788-charger.c return lp8788_get_battery_charging_current(pchg, val); pchg 354 drivers/power/supply/lp8788-charger.c return lp8788_get_charging_termination_voltage(pchg, val); pchg 366 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg) pchg 368 drivers/power/supply/lp8788-charger.c struct lp8788 *lp = pchg->lp; pchg 369 drivers/power/supply/lp8788-charger.c struct lp8788_charger_platform_data *pdata = pchg->pdata; pchg 409 drivers/power/supply/lp8788-charger.c static void lp8788_psy_unregister(struct lp8788_charger *pchg) pchg 411 drivers/power/supply/lp8788-charger.c power_supply_unregister(pchg->battery); pchg 412 drivers/power/supply/lp8788-charger.c power_supply_unregister(pchg->charger); pchg 417 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = pchg 419 drivers/power/supply/lp8788-charger.c struct lp8788_charger_platform_data *pdata = pchg->pdata; pchg 420 drivers/power/supply/lp8788-charger.c enum lp8788_charger_event event = lp8788_is_charger_detected(pchg); pchg 422 drivers/power/supply/lp8788-charger.c pdata->charger_event(pchg->lp, event); pchg 425 drivers/power/supply/lp8788-charger.c static bool lp8788_find_irq_id(struct lp8788_charger *pchg, int virq, int *id) pchg 430 drivers/power/supply/lp8788-charger.c for (i = 0; i < pchg->num_irqs; i++) { pchg 431 drivers/power/supply/lp8788-charger.c if (pchg->irqs[i].virq == virq) { pchg 432 drivers/power/supply/lp8788-charger.c *id = pchg->irqs[i].which; pchg 443 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = ptr; pchg 444 drivers/power/supply/lp8788-charger.c struct lp8788_charger_platform_data *pdata = pchg->pdata; pchg 447 drivers/power/supply/lp8788-charger.c if (!lp8788_find_irq_id(pchg, virq, &id)) pchg 456 drivers/power/supply/lp8788-charger.c power_supply_changed(pchg->charger); pchg 457 drivers/power/supply/lp8788-charger.c power_supply_changed(pchg->battery); pchg 468 drivers/power/supply/lp8788-charger.c schedule_work(&pchg->charger_work); pchg 475 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg, const char *name) pchg 478 drivers/power/supply/lp8788-charger.c struct irq_domain *irqdm = pchg->lp->irqdm; pchg 495 drivers/power/supply/lp8788-charger.c nr_irq = pchg->num_irqs; pchg 498 drivers/power/supply/lp8788-charger.c pchg->irqs[nr_irq].virq = virq; pchg 499 drivers/power/supply/lp8788-charger.c pchg->irqs[nr_irq].which = i; pchg 500 drivers/power/supply/lp8788-charger.c pchg->num_irqs++; pchg 504 drivers/power/supply/lp8788-charger.c 0, name, pchg); pchg 515 drivers/power/supply/lp8788-charger.c for (i = 0; i < pchg->num_irqs; i++) pchg 516 drivers/power/supply/lp8788-charger.c free_irq(pchg->irqs[i].virq, pchg); pchg 521 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg) pchg 529 drivers/power/supply/lp8788-charger.c INIT_WORK(&pchg->charger_work, lp8788_charger_event); pchg 530 drivers/power/supply/lp8788-charger.c pchg->num_irqs = 0; pchg 533 drivers/power/supply/lp8788-charger.c ret = lp8788_set_irqs(pdev, pchg, name[i]); pchg 540 drivers/power/supply/lp8788-charger.c if (pchg->num_irqs > LP8788_MAX_CHG_IRQS) { pchg 542 drivers/power/supply/lp8788-charger.c pchg->num_irqs); pchg 551 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg) pchg 556 drivers/power/supply/lp8788-charger.c for (i = 0; i < pchg->num_irqs; i++) { pchg 557 drivers/power/supply/lp8788-charger.c irq = pchg->irqs[i].virq; pchg 561 drivers/power/supply/lp8788-charger.c free_irq(irq, pchg); pchg 566 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg) pchg 568 drivers/power/supply/lp8788-charger.c struct lp8788_charger_platform_data *pdata = pchg->pdata; pchg 576 drivers/power/supply/lp8788-charger.c pchg->chan[LP8788_VBATT] = IS_ERR(chan) ? NULL : chan; pchg 580 drivers/power/supply/lp8788-charger.c pchg->chan[LP8788_BATT_TEMP] = IS_ERR(chan) ? NULL : chan; pchg 583 drivers/power/supply/lp8788-charger.c static void lp8788_release_adc_channel(struct lp8788_charger *pchg) pchg 588 drivers/power/supply/lp8788-charger.c if (!pchg->chan[i]) pchg 591 drivers/power/supply/lp8788-charger.c iio_channel_release(pchg->chan[i]); pchg 592 drivers/power/supply/lp8788-charger.c pchg->chan[i] = NULL; pchg 599 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = dev_get_drvdata(dev); pchg 615 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_STATUS, &data); pchg 624 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = dev_get_drvdata(dev); pchg 631 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_EOC, &val); pchg 641 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = dev_get_drvdata(dev); pchg 652 drivers/power/supply/lp8788-charger.c lp8788_read_byte(pchg->lp, LP8788_CHG_EOC, &val); pchg 675 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg) pchg 683 drivers/power/supply/lp8788-charger.c pchg->charger = power_supply_register(&pdev->dev, pchg 686 drivers/power/supply/lp8788-charger.c if (IS_ERR(pchg->charger)) pchg 689 drivers/power/supply/lp8788-charger.c pchg->battery = power_supply_register(&pdev->dev, pchg 691 drivers/power/supply/lp8788-charger.c if (IS_ERR(pchg->battery)) { pchg 692 drivers/power/supply/lp8788-charger.c power_supply_unregister(pchg->charger); pchg 702 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg; pchg 706 drivers/power/supply/lp8788-charger.c pchg = devm_kzalloc(dev, sizeof(struct lp8788_charger), GFP_KERNEL); pchg 707 drivers/power/supply/lp8788-charger.c if (!pchg) pchg 710 drivers/power/supply/lp8788-charger.c pchg->lp = lp; pchg 711 drivers/power/supply/lp8788-charger.c pchg->pdata = lp->pdata ? lp->pdata->chg_pdata : NULL; pchg 712 drivers/power/supply/lp8788-charger.c platform_set_drvdata(pdev, pchg); pchg 714 drivers/power/supply/lp8788-charger.c ret = lp8788_update_charger_params(pdev, pchg); pchg 718 drivers/power/supply/lp8788-charger.c lp8788_setup_adc_channel(&pdev->dev, pchg); pchg 720 drivers/power/supply/lp8788-charger.c ret = lp8788_psy_register(pdev, pchg); pchg 724 drivers/power/supply/lp8788-charger.c ret = lp8788_irq_register(pdev, pchg); pchg 733 drivers/power/supply/lp8788-charger.c struct lp8788_charger *pchg = platform_get_drvdata(pdev); pchg 735 drivers/power/supply/lp8788-charger.c flush_work(&pchg->charger_work); pchg 736 drivers/power/supply/lp8788-charger.c lp8788_irq_unregister(pdev, pchg); pchg 737 drivers/power/supply/lp8788-charger.c lp8788_psy_unregister(pchg); pchg 738 drivers/power/supply/lp8788-charger.c lp8788_release_adc_channel(pchg);