max8998 95 drivers/mfd/max8998-irq.c irq_to_max8998_irq(struct max8998_dev *max8998, struct irq_data *data) max8998 102 drivers/mfd/max8998-irq.c struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); max8998 104 drivers/mfd/max8998-irq.c mutex_lock(&max8998->irqlock); max8998 109 drivers/mfd/max8998-irq.c struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); max8998 112 drivers/mfd/max8998-irq.c for (i = 0; i < ARRAY_SIZE(max8998->irq_masks_cur); i++) { max8998 117 drivers/mfd/max8998-irq.c if (max8998->irq_masks_cur[i] != max8998->irq_masks_cache[i]) { max8998 118 drivers/mfd/max8998-irq.c max8998->irq_masks_cache[i] = max8998->irq_masks_cur[i]; max8998 119 drivers/mfd/max8998-irq.c max8998_write_reg(max8998->i2c, MAX8998_REG_IRQM1 + i, max8998 120 drivers/mfd/max8998-irq.c max8998->irq_masks_cur[i]); max8998 124 drivers/mfd/max8998-irq.c mutex_unlock(&max8998->irqlock); max8998 129 drivers/mfd/max8998-irq.c struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); max8998 130 drivers/mfd/max8998-irq.c struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data); max8998 132 drivers/mfd/max8998-irq.c max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask; max8998 137 drivers/mfd/max8998-irq.c struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); max8998 138 drivers/mfd/max8998-irq.c struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data); max8998 140 drivers/mfd/max8998-irq.c max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask; max8998 153 drivers/mfd/max8998-irq.c struct max8998_dev *max8998 = data; max8998 158 drivers/mfd/max8998-irq.c ret = max8998_bulk_read(max8998->i2c, MAX8998_REG_IRQ1, max8998 161 drivers/mfd/max8998-irq.c dev_err(max8998->dev, "Failed to read interrupt register: %d\n", max8998 168 drivers/mfd/max8998-irq.c irq_reg[i] &= ~max8998->irq_masks_cur[i]; max8998 173 drivers/mfd/max8998-irq.c irq = irq_find_mapping(max8998->irq_domain, i); max8998 175 drivers/mfd/max8998-irq.c disable_irq_nosync(max8998->irq); max8998 185 drivers/mfd/max8998-irq.c int max8998_irq_resume(struct max8998_dev *max8998) max8998 187 drivers/mfd/max8998-irq.c if (max8998->irq && max8998->irq_domain) max8998 188 drivers/mfd/max8998-irq.c max8998_irq_thread(max8998->irq, max8998); max8998 195 drivers/mfd/max8998-irq.c struct max8997_dev *max8998 = d->host_data; max8998 197 drivers/mfd/max8998-irq.c irq_set_chip_data(irq, max8998); max8998 209 drivers/mfd/max8998-irq.c int max8998_irq_init(struct max8998_dev *max8998) max8998 215 drivers/mfd/max8998-irq.c if (!max8998->irq) { max8998 216 drivers/mfd/max8998-irq.c dev_warn(max8998->dev, max8998 221 drivers/mfd/max8998-irq.c mutex_init(&max8998->irqlock); max8998 225 drivers/mfd/max8998-irq.c max8998->irq_masks_cur[i] = 0xff; max8998 226 drivers/mfd/max8998-irq.c max8998->irq_masks_cache[i] = 0xff; max8998 227 drivers/mfd/max8998-irq.c max8998_write_reg(max8998->i2c, MAX8998_REG_IRQM1 + i, 0xff); max8998 230 drivers/mfd/max8998-irq.c max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM1, 0xff); max8998 231 drivers/mfd/max8998-irq.c max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM2, 0xff); max8998 234 drivers/mfd/max8998-irq.c max8998->irq_base, &max8998_irq_domain_ops, max8998); max8998 236 drivers/mfd/max8998-irq.c dev_err(max8998->dev, "could not create irq domain\n"); max8998 239 drivers/mfd/max8998-irq.c max8998->irq_domain = domain; max8998 241 drivers/mfd/max8998-irq.c ret = request_threaded_irq(max8998->irq, NULL, max8998_irq_thread, max8998 243 drivers/mfd/max8998-irq.c "max8998-irq", max8998); max8998 245 drivers/mfd/max8998-irq.c dev_err(max8998->dev, "Failed to request IRQ %d: %d\n", max8998 246 drivers/mfd/max8998-irq.c max8998->irq, ret); max8998 250 drivers/mfd/max8998-irq.c if (!max8998->ono) max8998 253 drivers/mfd/max8998-irq.c ret = request_threaded_irq(max8998->ono, NULL, max8998_irq_thread, max8998 255 drivers/mfd/max8998-irq.c IRQF_ONESHOT, "max8998-ono", max8998); max8998 257 drivers/mfd/max8998-irq.c dev_err(max8998->dev, "Failed to request IRQ %d: %d\n", max8998 258 drivers/mfd/max8998-irq.c max8998->ono, ret); max8998 263 drivers/mfd/max8998-irq.c void max8998_irq_exit(struct max8998_dev *max8998) max8998 265 drivers/mfd/max8998-irq.c if (max8998->ono) max8998 266 drivers/mfd/max8998-irq.c free_irq(max8998->ono, max8998); max8998 268 drivers/mfd/max8998-irq.c if (max8998->irq) max8998 269 drivers/mfd/max8998-irq.c free_irq(max8998->irq, max8998); max8998 44 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 47 drivers/mfd/max8998.c mutex_lock(&max8998->iolock); max8998 49 drivers/mfd/max8998.c mutex_unlock(&max8998->iolock); max8998 61 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 64 drivers/mfd/max8998.c mutex_lock(&max8998->iolock); max8998 66 drivers/mfd/max8998.c mutex_unlock(&max8998->iolock); max8998 76 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 79 drivers/mfd/max8998.c mutex_lock(&max8998->iolock); max8998 81 drivers/mfd/max8998.c mutex_unlock(&max8998->iolock); max8998 88 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 91 drivers/mfd/max8998.c mutex_lock(&max8998->iolock); max8998 93 drivers/mfd/max8998.c mutex_unlock(&max8998->iolock); max8998 103 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 106 drivers/mfd/max8998.c mutex_lock(&max8998->iolock); max8998 113 drivers/mfd/max8998.c mutex_unlock(&max8998->iolock); max8998 171 drivers/mfd/max8998.c struct max8998_dev *max8998; max8998 174 drivers/mfd/max8998.c max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev), max8998 176 drivers/mfd/max8998.c if (max8998 == NULL) max8998 185 drivers/mfd/max8998.c i2c_set_clientdata(i2c, max8998); max8998 186 drivers/mfd/max8998.c max8998->dev = &i2c->dev; max8998 187 drivers/mfd/max8998.c max8998->i2c = i2c; max8998 188 drivers/mfd/max8998.c max8998->irq = i2c->irq; max8998 189 drivers/mfd/max8998.c max8998->type = max8998_i2c_get_driver_data(i2c, id); max8998 190 drivers/mfd/max8998.c max8998->pdata = pdata; max8998 192 drivers/mfd/max8998.c max8998->ono = pdata->ono; max8998 193 drivers/mfd/max8998.c max8998->irq_base = pdata->irq_base; max8998 194 drivers/mfd/max8998.c max8998->wakeup = pdata->wakeup; max8998 196 drivers/mfd/max8998.c mutex_init(&max8998->iolock); max8998 198 drivers/mfd/max8998.c max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR); max8998 199 drivers/mfd/max8998.c if (IS_ERR(max8998->rtc)) { max8998 201 drivers/mfd/max8998.c return PTR_ERR(max8998->rtc); max8998 203 drivers/mfd/max8998.c i2c_set_clientdata(max8998->rtc, max8998); max8998 205 drivers/mfd/max8998.c max8998_irq_init(max8998); max8998 207 drivers/mfd/max8998.c pm_runtime_set_active(max8998->dev); max8998 209 drivers/mfd/max8998.c switch (max8998->type) { max8998 211 drivers/mfd/max8998.c ret = mfd_add_devices(max8998->dev, -1, max8998 216 drivers/mfd/max8998.c ret = mfd_add_devices(max8998->dev, -1, max8998 227 drivers/mfd/max8998.c device_init_wakeup(max8998->dev, max8998->wakeup); max8998 232 drivers/mfd/max8998.c mfd_remove_devices(max8998->dev); max8998 233 drivers/mfd/max8998.c max8998_irq_exit(max8998); max8998 234 drivers/mfd/max8998.c i2c_unregister_device(max8998->rtc); max8998 247 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 250 drivers/mfd/max8998.c irq_set_irq_wake(max8998->irq, 1); max8998 257 drivers/mfd/max8998.c struct max8998_dev *max8998 = i2c_get_clientdata(i2c); max8998 260 drivers/mfd/max8998.c irq_set_irq_wake(max8998->irq, 0); max8998 33 drivers/power/supply/max8998_charger.c struct max8998_battery_data *max8998 = power_supply_get_drvdata(psy); max8998 34 drivers/power/supply/max8998_charger.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 77 drivers/power/supply/max8998_charger.c struct max8998_battery_data *max8998; max8998 86 drivers/power/supply/max8998_charger.c max8998 = devm_kzalloc(&pdev->dev, sizeof(struct max8998_battery_data), max8998 88 drivers/power/supply/max8998_charger.c if (!max8998) max8998 91 drivers/power/supply/max8998_charger.c max8998->dev = &pdev->dev; max8998 92 drivers/power/supply/max8998_charger.c max8998->iodev = iodev; max8998 93 drivers/power/supply/max8998_charger.c platform_set_drvdata(pdev, max8998); max8998 94 drivers/power/supply/max8998_charger.c i2c = max8998->iodev->i2c; max8998 103 drivers/power/supply/max8998_charger.c dev_dbg(max8998->dev, max8998 106 drivers/power/supply/max8998_charger.c dev_err(max8998->dev, "Invalid EOC value\n"); max8998 125 drivers/power/supply/max8998_charger.c dev_dbg(max8998->dev, max8998 129 drivers/power/supply/max8998_charger.c dev_err(max8998->dev, "Invalid Restart Level\n"); max8998 148 drivers/power/supply/max8998_charger.c dev_dbg(max8998->dev, max8998 152 drivers/power/supply/max8998_charger.c dev_err(max8998->dev, "Invalid Full Timeout value\n"); max8998 156 drivers/power/supply/max8998_charger.c psy_cfg.drv_data = max8998; max8998 158 drivers/power/supply/max8998_charger.c max8998->battery = devm_power_supply_register(max8998->dev, max8998 161 drivers/power/supply/max8998_charger.c if (IS_ERR(max8998->battery)) { max8998 162 drivers/power/supply/max8998_charger.c ret = PTR_ERR(max8998->battery); max8998 163 drivers/power/supply/max8998_charger.c dev_err(max8998->dev, "failed: power supply register: %d\n", max8998 75 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 76 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 93 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 94 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 106 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 107 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 121 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 158 drivers/regulator/max8998.c reg = MAX8998_REG_BUCK1_VOLTAGE1 + max8998->buck1_idx; max8998 161 drivers/regulator/max8998.c reg = MAX8998_REG_BUCK2_VOLTAGE1 + max8998->buck2_idx; max8998 182 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 183 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 204 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 205 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 231 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 232 drivers/regulator/max8998.c struct max8998_platform_data *pdata = max8998->iodev->pdata; max8998 233 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 244 drivers/regulator/max8998.c dev_dbg(max8998->dev, max8998 247 drivers/regulator/max8998.c selector, max8998->buck1_vol[0], max8998->buck1_vol[1], max8998 248 drivers/regulator/max8998.c max8998->buck1_vol[2], max8998->buck1_vol[3]); max8998 255 drivers/regulator/max8998.c for (j = 0; j < ARRAY_SIZE(max8998->buck1_vol); j++) { max8998 256 drivers/regulator/max8998.c if (max8998->buck1_vol[j] == selector) { max8998 257 drivers/regulator/max8998.c max8998->buck1_idx = j; max8998 268 drivers/regulator/max8998.c max8998->buck1_idx = (buck1_last_val % 2) + 2; max8998 269 drivers/regulator/max8998.c dev_dbg(max8998->dev, "max8998->buck1_idx:%d\n", max8998 270 drivers/regulator/max8998.c max8998->buck1_idx); max8998 271 drivers/regulator/max8998.c max8998->buck1_vol[max8998->buck1_idx] = selector; max8998 277 drivers/regulator/max8998.c pdata->buck1_set2, max8998->buck1_idx); max8998 280 drivers/regulator/max8998.c dev_dbg(max8998->dev, "%s: SET1:%d, SET2:%d\n", max8998 290 drivers/regulator/max8998.c dev_dbg(max8998->dev, max8998 292 drivers/regulator/max8998.c selector, max8998->buck2_vol[0], max8998->buck2_vol[1]); max8998 297 drivers/regulator/max8998.c for (j = 0; j < ARRAY_SIZE(max8998->buck2_vol); j++) { max8998 298 drivers/regulator/max8998.c if (max8998->buck2_vol[j] == selector) { max8998 299 drivers/regulator/max8998.c max8998->buck2_idx = j; max8998 311 drivers/regulator/max8998.c max8998->buck2_vol[max8998->buck2_idx] = selector; max8998 312 drivers/regulator/max8998.c buck2_gpio_set(pdata->buck2_set3, max8998->buck2_idx); max8998 314 drivers/regulator/max8998.c dev_dbg(max8998->dev, "%s: SET3:%d\n", i2c->name, max8998 335 drivers/regulator/max8998.c struct max8998_data *max8998 = rdev_get_drvdata(rdev); max8998 336 drivers/regulator/max8998.c struct i2c_client *i2c = max8998->iodev->i2c; max8998 351 drivers/regulator/max8998.c if (max8998->iodev->type == TYPE_MAX8998 && !(val & MAX8998_ENRAMP)) max8998 562 drivers/regulator/max8998.c struct max8998_data *max8998; max8998 578 drivers/regulator/max8998.c max8998 = devm_kzalloc(&pdev->dev, sizeof(struct max8998_data), max8998 580 drivers/regulator/max8998.c if (!max8998) max8998 583 drivers/regulator/max8998.c max8998->dev = &pdev->dev; max8998 584 drivers/regulator/max8998.c max8998->iodev = iodev; max8998 585 drivers/regulator/max8998.c max8998->num_regulators = pdata->num_regulators; max8998 586 drivers/regulator/max8998.c platform_set_drvdata(pdev, max8998); max8998 587 drivers/regulator/max8998.c i2c = max8998->iodev->i2c; max8998 589 drivers/regulator/max8998.c max8998->buck1_idx = pdata->buck1_default_idx; max8998 590 drivers/regulator/max8998.c max8998->buck2_idx = pdata->buck2_default_idx; max8998 616 drivers/regulator/max8998.c max8998->buck1_idx & 0x1); max8998 621 drivers/regulator/max8998.c (max8998->buck1_idx >> 1) & 0x1); max8998 633 drivers/regulator/max8998.c max8998->buck1_vol[v] = i; max8998 651 drivers/regulator/max8998.c max8998->buck2_idx & 0x1); max8998 663 drivers/regulator/max8998.c max8998->buck2_vol[v] = i; max8998 674 drivers/regulator/max8998.c config.dev = max8998->dev; max8998 677 drivers/regulator/max8998.c config.driver_data = max8998; max8998 683 drivers/regulator/max8998.c dev_err(max8998->dev, "regulator %s init failed (%d)\n", max8998 68 drivers/rtc/rtc-max8998.c struct max8998_dev *max8998; max8998 249 drivers/rtc/rtc-max8998.c struct max8998_dev *max8998 = dev_get_drvdata(pdev->dev.parent); max8998 250 drivers/rtc/rtc-max8998.c struct max8998_platform_data *pdata = max8998->pdata; max8998 260 drivers/rtc/rtc-max8998.c info->max8998 = max8998; max8998 261 drivers/rtc/rtc-max8998.c info->rtc = max8998->rtc; max8998 274 drivers/rtc/rtc-max8998.c if (!max8998->irq_domain) max8998 277 drivers/rtc/rtc-max8998.c info->irq = irq_create_mapping(max8998->irq_domain, MAX8998_IRQ_ALARM0); max8998 157 include/linux/mfd/max8998-private.h int max8998_irq_init(struct max8998_dev *max8998); max8998 158 include/linux/mfd/max8998-private.h void max8998_irq_exit(struct max8998_dev *max8998); max8998 159 include/linux/mfd/max8998-private.h int max8998_irq_resume(struct max8998_dev *max8998);