da9063 113 drivers/mfd/da9063-core.c static int da9063_clear_fault_log(struct da9063 *da9063) da9063 118 drivers/mfd/da9063-core.c ret = regmap_read(da9063->regmap, DA9063_REG_FAULT_LOG, &fault_log); da9063 120 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Cannot read FAULT_LOG.\n"); da9063 126 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 129 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 132 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 135 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 138 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 141 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 144 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 147 drivers/mfd/da9063-core.c dev_dbg(da9063->dev, da9063 151 drivers/mfd/da9063-core.c ret = regmap_write(da9063->regmap, da9063 155 drivers/mfd/da9063-core.c dev_err(da9063->dev, da9063 161 drivers/mfd/da9063-core.c int da9063_device_init(struct da9063 *da9063, unsigned int irq) da9063 166 drivers/mfd/da9063-core.c ret = da9063_clear_fault_log(da9063); da9063 168 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Cannot clear fault log\n"); da9063 170 drivers/mfd/da9063-core.c da9063->flags = 0; da9063 171 drivers/mfd/da9063-core.c da9063->irq_base = -1; da9063 172 drivers/mfd/da9063-core.c da9063->chip_irq = irq; da9063 174 drivers/mfd/da9063-core.c ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_ID, &model); da9063 176 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Cannot read chip model id.\n"); da9063 180 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Invalid chip model id: 0x%02x\n", model); da9063 184 drivers/mfd/da9063-core.c ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_VARIANT, &variant_id); da9063 186 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Cannot read chip variant id.\n"); da9063 192 drivers/mfd/da9063-core.c dev_info(da9063->dev, da9063 197 drivers/mfd/da9063-core.c dev_err(da9063->dev, da9063 202 drivers/mfd/da9063-core.c da9063->variant_code = variant_code; da9063 204 drivers/mfd/da9063-core.c ret = da9063_irq_init(da9063); da9063 206 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Cannot initialize interrupts.\n"); da9063 210 drivers/mfd/da9063-core.c da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq); da9063 212 drivers/mfd/da9063-core.c ret = devm_mfd_add_devices(da9063->dev, PLATFORM_DEVID_NONE, da9063 215 drivers/mfd/da9063-core.c NULL, da9063->irq_base, NULL); da9063 217 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Failed to add child devices\n"); da9063 221 drivers/mfd/da9063-core.c if (da9063->type == PMIC_TYPE_DA9063) { da9063 222 drivers/mfd/da9063-core.c ret = devm_mfd_add_devices(da9063->dev, PLATFORM_DEVID_NONE, da9063 224 drivers/mfd/da9063-core.c NULL, da9063->irq_base, NULL); da9063 226 drivers/mfd/da9063-core.c dev_err(da9063->dev, "Failed to add child devices\n"); da9063 190 drivers/mfd/da9063-i2c.c struct da9063 *da9063; da9063 193 drivers/mfd/da9063-i2c.c da9063 = devm_kzalloc(&i2c->dev, sizeof(struct da9063), GFP_KERNEL); da9063 194 drivers/mfd/da9063-i2c.c if (da9063 == NULL) da9063 197 drivers/mfd/da9063-i2c.c i2c_set_clientdata(i2c, da9063); da9063 198 drivers/mfd/da9063-i2c.c da9063->dev = &i2c->dev; da9063 199 drivers/mfd/da9063-i2c.c da9063->chip_irq = i2c->irq; da9063 200 drivers/mfd/da9063-i2c.c da9063->type = id->driver_data; da9063 202 drivers/mfd/da9063-i2c.c if (da9063->variant_code == PMIC_DA9063_AD) { da9063 206 drivers/mfd/da9063-i2c.c } else if (da9063->type == PMIC_TYPE_DA9063L) { da9063 216 drivers/mfd/da9063-i2c.c da9063->regmap = devm_regmap_init_i2c(i2c, &da9063_regmap_config); da9063 217 drivers/mfd/da9063-i2c.c if (IS_ERR(da9063->regmap)) { da9063 218 drivers/mfd/da9063-i2c.c ret = PTR_ERR(da9063->regmap); da9063 219 drivers/mfd/da9063-i2c.c dev_err(da9063->dev, "Failed to allocate register map: %d\n", da9063 224 drivers/mfd/da9063-i2c.c return da9063_device_init(da9063, i2c->irq); da9063 171 drivers/mfd/da9063-irq.c int da9063_irq_init(struct da9063 *da9063) da9063 176 drivers/mfd/da9063-irq.c if (!da9063->chip_irq) { da9063 177 drivers/mfd/da9063-irq.c dev_err(da9063->dev, "No IRQ configured\n"); da9063 181 drivers/mfd/da9063-irq.c if (da9063->type == PMIC_TYPE_DA9063) da9063 186 drivers/mfd/da9063-irq.c ret = devm_regmap_add_irq_chip(da9063->dev, da9063->regmap, da9063 187 drivers/mfd/da9063-irq.c da9063->chip_irq, da9063 189 drivers/mfd/da9063-irq.c da9063->irq_base, irq_chip, &da9063->regmap_irq); da9063 191 drivers/mfd/da9063-irq.c dev_err(da9063->dev, "Failed to reguest IRQ %d: %d\n", da9063 192 drivers/mfd/da9063-irq.c da9063->chip_irq, ret); da9063 142 drivers/regulator/da9063-regulator.c struct da9063 *hw; da9063 597 drivers/regulator/da9063-regulator.c struct da9063 *hw = regulators->regulator[0].hw; da9063 664 drivers/regulator/da9063-regulator.c struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent); da9063 671 drivers/regulator/da9063-regulator.c if (da9063->type == PMIC_TYPE_DA9063L) da9063 717 drivers/regulator/da9063-regulator.c struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent); da9063 737 drivers/regulator/da9063-regulator.c if (model->type == da9063->type) da9063 742 drivers/regulator/da9063-regulator.c da9063->type); da9063 746 drivers/regulator/da9063-regulator.c ret = regmap_read(da9063->regmap, DA9063_REG_CONFIG_H, &val); da9063 810 drivers/regulator/da9063-regulator.c regl->hw = da9063; da9063 818 drivers/regulator/da9063-regulator.c da9063->regmap, regl->info->mode); da9063 825 drivers/regulator/da9063-regulator.c da9063->regmap, regl->info->suspend); da9063 832 drivers/regulator/da9063-regulator.c da9063->regmap, regl->info->sleep); da9063 839 drivers/regulator/da9063-regulator.c da9063->regmap, regl->info->suspend_sleep); da9063 851 drivers/regulator/da9063-regulator.c config.regmap = da9063->regmap; da9063 396 drivers/rtc/rtc-da9063.c struct da9063 *chip = dev_get_drvdata(pdev->dev.parent); da9063 51 drivers/watchdog/da9063_wdt.c static unsigned int da9063_wdt_is_running(struct da9063 *da9063) da9063 55 drivers/watchdog/da9063_wdt.c regmap_read(da9063->regmap, DA9063_REG_CONTROL_D, &val); da9063 60 drivers/watchdog/da9063_wdt.c static int da9063_wdt_disable_timer(struct da9063 *da9063) da9063 62 drivers/watchdog/da9063_wdt.c return regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D, da9063 68 drivers/watchdog/da9063_wdt.c da9063_wdt_update_timeout(struct da9063 *da9063, unsigned int timeout) da9063 81 drivers/watchdog/da9063_wdt.c ret = da9063_wdt_disable_timer(da9063); da9063 88 drivers/watchdog/da9063_wdt.c return regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D, da9063 94 drivers/watchdog/da9063_wdt.c struct da9063 *da9063 = watchdog_get_drvdata(wdd); da9063 97 drivers/watchdog/da9063_wdt.c ret = da9063_wdt_update_timeout(da9063, wdd->timeout); da9063 99 drivers/watchdog/da9063_wdt.c dev_err(da9063->dev, "Watchdog failed to start (err = %d)\n", da9063 107 drivers/watchdog/da9063_wdt.c struct da9063 *da9063 = watchdog_get_drvdata(wdd); da9063 110 drivers/watchdog/da9063_wdt.c ret = da9063_wdt_disable_timer(da9063); da9063 112 drivers/watchdog/da9063_wdt.c dev_alert(da9063->dev, "Watchdog failed to stop (err = %d)\n", da9063 120 drivers/watchdog/da9063_wdt.c struct da9063 *da9063 = watchdog_get_drvdata(wdd); da9063 123 drivers/watchdog/da9063_wdt.c ret = regmap_write(da9063->regmap, DA9063_REG_CONTROL_F, da9063 126 drivers/watchdog/da9063_wdt.c dev_alert(da9063->dev, "Failed to ping the watchdog (err = %d)\n", da9063 135 drivers/watchdog/da9063_wdt.c struct da9063 *da9063 = watchdog_get_drvdata(wdd); da9063 149 drivers/watchdog/da9063_wdt.c ret = da9063_wdt_update_timeout(da9063, timeout); da9063 152 drivers/watchdog/da9063_wdt.c dev_err(da9063->dev, "Failed to set watchdog timeout (err = %d)\n", da9063 163 drivers/watchdog/da9063_wdt.c struct da9063 *da9063 = watchdog_get_drvdata(wdd); da9063 166 drivers/watchdog/da9063_wdt.c ret = regmap_write(da9063->regmap, DA9063_REG_CONTROL_F, da9063 169 drivers/watchdog/da9063_wdt.c dev_alert(da9063->dev, "Failed to shutdown (err = %d)\n", da9063 192 drivers/watchdog/da9063_wdt.c struct da9063 *da9063; da9063 198 drivers/watchdog/da9063_wdt.c da9063 = dev_get_drvdata(dev->parent); da9063 199 drivers/watchdog/da9063_wdt.c if (!da9063) da9063 215 drivers/watchdog/da9063_wdt.c watchdog_set_drvdata(wdd, da9063); da9063 223 drivers/watchdog/da9063_wdt.c if (da9063_wdt_is_running(da9063)) { da9063 224 drivers/watchdog/da9063_wdt.c da9063_wdt_update_timeout(da9063, wdd->timeout); da9063 89 include/linux/mfd/da9063/core.h int da9063_device_init(struct da9063 *da9063, unsigned int irq); da9063 90 include/linux/mfd/da9063/core.h int da9063_irq_init(struct da9063 *da9063);