Lines Matching +full:spkvddr +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-only
40 mutex_lock(&arizona->clk_lock); in arizona_clk32k_enable()
42 arizona->clk32k_ref++; in arizona_clk32k_enable()
44 if (arizona->clk32k_ref == 1) { in arizona_clk32k_enable()
45 switch (arizona->pdata.clk32k_src) { in arizona_clk32k_enable()
47 ret = pm_runtime_resume_and_get(arizona->dev); in arizona_clk32k_enable()
50 ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]); in arizona_clk32k_enable()
52 pm_runtime_put_sync(arizona->dev); in arizona_clk32k_enable()
57 ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]); in arizona_clk32k_enable()
63 ret = regmap_update_bits(arizona->regmap, ARIZONA_CLOCK_32K_1, in arizona_clk32k_enable()
70 arizona->clk32k_ref--; in arizona_clk32k_enable()
72 mutex_unlock(&arizona->clk_lock); in arizona_clk32k_enable()
80 mutex_lock(&arizona->clk_lock); in arizona_clk32k_disable()
82 WARN_ON(arizona->clk32k_ref <= 0); in arizona_clk32k_disable()
84 arizona->clk32k_ref--; in arizona_clk32k_disable()
86 if (arizona->clk32k_ref == 0) { in arizona_clk32k_disable()
87 regmap_update_bits(arizona->regmap, ARIZONA_CLOCK_32K_1, in arizona_clk32k_disable()
90 switch (arizona->pdata.clk32k_src) { in arizona_clk32k_disable()
92 pm_runtime_put_sync(arizona->dev); in arizona_clk32k_disable()
93 clk_disable_unprepare(arizona->mclk[ARIZONA_MCLK1]); in arizona_clk32k_disable()
96 clk_disable_unprepare(arizona->mclk[ARIZONA_MCLK2]); in arizona_clk32k_disable()
101 mutex_unlock(&arizona->clk_lock); in arizona_clk32k_disable()
111 dev_err(arizona->dev, "CLKGEN error\n"); in arizona_clkgen_err()
122 ret = regmap_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_8, in arizona_underclocked()
125 dev_err(arizona->dev, "Failed to read underclock status: %d\n", in arizona_underclocked()
131 dev_err(arizona->dev, "AIF3 underclocked\n"); in arizona_underclocked()
133 dev_err(arizona->dev, "AIF2 underclocked\n"); in arizona_underclocked()
135 dev_err(arizona->dev, "AIF1 underclocked\n"); in arizona_underclocked()
137 dev_err(arizona->dev, "ISRC3 underclocked\n"); in arizona_underclocked()
139 dev_err(arizona->dev, "ISRC2 underclocked\n"); in arizona_underclocked()
141 dev_err(arizona->dev, "ISRC1 underclocked\n"); in arizona_underclocked()
143 dev_err(arizona->dev, "FX underclocked\n"); in arizona_underclocked()
145 dev_err(arizona->dev, "ASRC underclocked\n"); in arizona_underclocked()
147 dev_err(arizona->dev, "DAC underclocked\n"); in arizona_underclocked()
149 dev_err(arizona->dev, "ADC underclocked\n"); in arizona_underclocked()
151 dev_err(arizona->dev, "Mixer dropped sample\n"); in arizona_underclocked()
162 ret = regmap_bulk_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_6, in arizona_overclocked()
165 dev_err(arizona->dev, "Failed to read overclock status: %d\n", in arizona_overclocked()
170 switch (arizona->type) { in arizona_overclocked()
185 dev_err(arizona->dev, "PWM overclocked\n"); in arizona_overclocked()
187 dev_err(arizona->dev, "FX core overclocked\n"); in arizona_overclocked()
189 dev_err(arizona->dev, "DAC SYS overclocked\n"); in arizona_overclocked()
191 dev_err(arizona->dev, "DAC WARP overclocked\n"); in arizona_overclocked()
193 dev_err(arizona->dev, "ADC overclocked\n"); in arizona_overclocked()
195 dev_err(arizona->dev, "Mixer overclocked\n"); in arizona_overclocked()
197 dev_err(arizona->dev, "AIF3 overclocked\n"); in arizona_overclocked()
199 dev_err(arizona->dev, "AIF2 overclocked\n"); in arizona_overclocked()
201 dev_err(arizona->dev, "AIF1 overclocked\n"); in arizona_overclocked()
203 dev_err(arizona->dev, "Pad control overclocked\n"); in arizona_overclocked()
206 dev_err(arizona->dev, "Slimbus subsystem overclocked\n"); in arizona_overclocked()
208 dev_err(arizona->dev, "Slimbus async overclocked\n"); in arizona_overclocked()
210 dev_err(arizona->dev, "Slimbus sync overclocked\n"); in arizona_overclocked()
212 dev_err(arizona->dev, "ASRC async system overclocked\n"); in arizona_overclocked()
214 dev_err(arizona->dev, "ASRC async WARP overclocked\n"); in arizona_overclocked()
216 dev_err(arizona->dev, "ASRC sync system overclocked\n"); in arizona_overclocked()
218 dev_err(arizona->dev, "ASRC sync WARP overclocked\n"); in arizona_overclocked()
220 dev_err(arizona->dev, "DSP1 overclocked\n"); in arizona_overclocked()
222 dev_err(arizona->dev, "ISRC3 overclocked\n"); in arizona_overclocked()
224 dev_err(arizona->dev, "ISRC2 overclocked\n"); in arizona_overclocked()
226 dev_err(arizona->dev, "ISRC1 overclocked\n"); in arizona_overclocked()
229 dev_err(arizona->dev, "SPDIF overclocked\n"); in arizona_overclocked()
255 ret = regmap_read(arizona->regmap, reg, &val); in arizona_poll_reg()
262 dev_err(arizona->dev, "Failed polling reg 0x%x: %d\n", in arizona_poll_reg()
267 dev_err(arizona->dev, "Polling reg 0x%x timed out: %x\n", reg, val); in arizona_poll_reg()
268 return -ETIMEDOUT; in arizona_poll_reg()
284 regmap_write(arizona->regmap, ARIZONA_INTERRUPT_STATUS_5, in arizona_wait_for_boot()
287 pm_runtime_mark_last_busy(arizona->dev); in arizona_wait_for_boot()
294 if (arizona->pdata.reset) in arizona_enable_reset()
295 gpiod_set_raw_value_cansleep(arizona->pdata.reset, 0); in arizona_enable_reset()
300 if (arizona->pdata.reset) { in arizona_disable_reset()
301 switch (arizona->type) { in arizona_disable_reset()
311 gpiod_set_raw_value_cansleep(arizona->pdata.reset, 1); in arizona_disable_reset()
327 ret = regmap_read(arizona->regmap, ARIZONA_FLL1_CONTROL_1, &state->fll); in arizona_enable_freerun_sysclk()
329 dev_err(arizona->dev, "Failed to cache FLL settings: %d\n", in arizona_enable_freerun_sysclk()
333 ret = regmap_read(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, in arizona_enable_freerun_sysclk()
334 &state->sysclk); in arizona_enable_freerun_sysclk()
336 dev_err(arizona->dev, "Failed to cache SYSCLK settings: %d\n", in arizona_enable_freerun_sysclk()
342 ret = regmap_write(arizona->regmap, ARIZONA_FLL1_CONTROL_1, in arizona_enable_freerun_sysclk()
345 dev_err(arizona->dev, in arizona_enable_freerun_sysclk()
356 ret = regmap_write(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, 0x0144); in arizona_enable_freerun_sysclk()
358 dev_err(arizona->dev, "Failed to start SYSCLK: %d\n", ret); in arizona_enable_freerun_sysclk()
365 err = regmap_write(arizona->regmap, ARIZONA_FLL1_CONTROL_1, state->fll); in arizona_enable_freerun_sysclk()
367 dev_err(arizona->dev, in arizona_enable_freerun_sysclk()
368 "Failed to re-apply old FLL settings: %d\n", err); in arizona_enable_freerun_sysclk()
378 ret = regmap_write(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, in arizona_disable_freerun_sysclk()
379 state->sysclk); in arizona_disable_freerun_sysclk()
381 dev_err(arizona->dev, in arizona_disable_freerun_sysclk()
382 "Failed to re-apply old SYSCLK settings: %d\n", ret); in arizona_disable_freerun_sysclk()
386 ret = regmap_write(arizona->regmap, ARIZONA_FLL1_CONTROL_1, state->fll); in arizona_disable_freerun_sysclk()
388 dev_err(arizona->dev, in arizona_disable_freerun_sysclk()
389 "Failed to re-apply old FLL settings: %d\n", ret); in arizona_disable_freerun_sysclk()
406 ret = regmap_write(arizona->regmap, ARIZONA_WRITE_SEQUENCER_CTRL_0, in wm5102_apply_hardware_patch()
409 dev_err(arizona->dev, "Failed to start write sequencer: %d\n", in wm5102_apply_hardware_patch()
417 regmap_write(arizona->regmap, ARIZONA_WRITE_SEQUENCER_CTRL_0, in wm5102_apply_hardware_patch()
446 ret = regmap_multi_reg_write_bypassed(arizona->regmap, in wm5110_apply_sleep_patch()
459 ret = regmap_write(arizona->regmap, ARIZONA_WRITE_SEQUENCER_CTRL_3, in wm5102_clear_write_sequencer()
462 dev_err(arizona->dev, in wm5102_clear_write_sequencer()
468 regulator_disable(arizona->dcvdd); in wm5102_clear_write_sequencer()
472 ret = regulator_enable(arizona->dcvdd); in wm5102_clear_write_sequencer()
474 dev_err(arizona->dev, "Failed to re-enable DCVDD: %d\n", ret); in wm5102_clear_write_sequencer()
486 ret = regmap_update_bits(arizona->regmap, in arizona_isolate_dcvdd()
491 dev_err(arizona->dev, "Failed to isolate DCVDD: %d\n", ret); in arizona_isolate_dcvdd()
500 ret = regmap_update_bits(arizona->regmap, in arizona_connect_dcvdd()
504 dev_err(arizona->dev, "Failed to connect DCVDD: %d\n", ret); in arizona_connect_dcvdd()
514 ret = regmap_read(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, &val); in arizona_is_jack_det_active()
516 dev_err(arizona->dev, in arizona_is_jack_det_active()
531 dev_dbg(arizona->dev, "Leaving AoD mode\n"); in arizona_runtime_resume()
533 if (arizona->has_fully_powered_off) { in arizona_runtime_resume()
534 dev_dbg(arizona->dev, "Re-enabling core supplies\n"); in arizona_runtime_resume()
536 ret = regulator_bulk_enable(arizona->num_core_supplies, in arizona_runtime_resume()
537 arizona->core_supplies); in arizona_runtime_resume()
545 ret = regulator_enable(arizona->dcvdd); in arizona_runtime_resume()
547 dev_err(arizona->dev, "Failed to enable DCVDD: %d\n", ret); in arizona_runtime_resume()
548 if (arizona->has_fully_powered_off) in arizona_runtime_resume()
549 regulator_bulk_disable(arizona->num_core_supplies, in arizona_runtime_resume()
550 arizona->core_supplies); in arizona_runtime_resume()
554 if (arizona->has_fully_powered_off) { in arizona_runtime_resume()
556 enable_irq(arizona->irq); in arizona_runtime_resume()
557 arizona->has_fully_powered_off = false; in arizona_runtime_resume()
560 regcache_cache_only(arizona->regmap, false); in arizona_runtime_resume()
562 switch (arizona->type) { in arizona_runtime_resume()
564 if (arizona->external_dcvdd) { in arizona_runtime_resume()
572 dev_err(arizona->dev, "Failed to apply patch: %d\n", in arizona_runtime_resume()
579 dev_err(arizona->dev, in arizona_runtime_resume()
591 if (arizona->external_dcvdd) { in arizona_runtime_resume()
601 ret = regulator_set_voltage(arizona->dcvdd, in arizona_runtime_resume()
604 dev_err(arizona->dev, in arizona_runtime_resume()
613 dev_err(arizona->dev, in arizona_runtime_resume()
614 "Failed to re-apply sleep patch: %d\n", in arizona_runtime_resume()
630 if (arizona->external_dcvdd) { in arizona_runtime_resume()
638 ret = regcache_sync(arizona->regmap); in arizona_runtime_resume()
640 dev_err(arizona->dev, "Failed to restore register cache\n"); in arizona_runtime_resume()
647 regcache_cache_only(arizona->regmap, true); in arizona_runtime_resume()
648 regulator_disable(arizona->dcvdd); in arizona_runtime_resume()
658 dev_dbg(arizona->dev, "Entering AoD mode\n"); in arizona_runtime_suspend()
660 switch (arizona->type) { in arizona_runtime_suspend()
667 if (arizona->external_dcvdd) { in arizona_runtime_suspend()
677 ret = regulator_set_voltage(arizona->dcvdd, in arizona_runtime_suspend()
680 dev_err(arizona->dev, in arizona_runtime_suspend()
692 if (arizona->external_dcvdd) { in arizona_runtime_suspend()
699 ret = regmap_write(arizona->regmap, in arizona_runtime_suspend()
702 dev_err(arizona->dev, in arizona_runtime_suspend()
717 if (arizona->external_dcvdd) { in arizona_runtime_suspend()
725 regcache_cache_only(arizona->regmap, true); in arizona_runtime_suspend()
726 regcache_mark_dirty(arizona->regmap); in arizona_runtime_suspend()
727 regulator_disable(arizona->dcvdd); in arizona_runtime_suspend()
731 dev_dbg(arizona->dev, "Fully powering off\n"); in arizona_runtime_suspend()
733 arizona->has_fully_powered_off = true; in arizona_runtime_suspend()
735 disable_irq_nosync(arizona->irq); in arizona_runtime_suspend()
737 regulator_bulk_disable(arizona->num_core_supplies, in arizona_runtime_suspend()
738 arizona->core_supplies); in arizona_runtime_suspend()
748 dev_dbg(arizona->dev, "Suspend, disabling IRQ\n"); in arizona_suspend()
749 disable_irq(arizona->irq); in arizona_suspend()
758 dev_dbg(arizona->dev, "Late suspend, reenabling IRQ\n"); in arizona_suspend_noirq()
759 enable_irq(arizona->irq); in arizona_suspend_noirq()
768 dev_dbg(arizona->dev, "Early resume, disabling IRQ\n"); in arizona_resume_noirq()
769 disable_irq(arizona->irq); in arizona_resume_noirq()
778 dev_dbg(arizona->dev, "Resume, reenabling IRQ\n"); in arizona_resume()
779 enable_irq(arizona->irq); in arizona_resume()
796 struct arizona_pdata *pdata = &arizona->pdata; in arizona_of_get_core_pdata()
799 /* Handle old non-standard DT binding */ in arizona_of_get_core_pdata()
800 pdata->reset = devm_gpiod_get(arizona->dev, "wlf,reset", GPIOD_OUT_LOW); in arizona_of_get_core_pdata()
801 if (IS_ERR(pdata->reset)) { in arizona_of_get_core_pdata()
802 ret = PTR_ERR(pdata->reset); in arizona_of_get_core_pdata()
809 if (ret == -EPROBE_DEFER) in arizona_of_get_core_pdata()
811 else if (ret != -ENOENT && ret != -ENOSYS) in arizona_of_get_core_pdata()
812 dev_err(arizona->dev, "Reset GPIO malformed: %d\n", in arizona_of_get_core_pdata()
815 pdata->reset = NULL; in arizona_of_get_core_pdata()
818 ret = of_property_read_u32_array(arizona->dev->of_node, in arizona_of_get_core_pdata()
819 "wlf,gpio-defaults", in arizona_of_get_core_pdata()
820 pdata->gpio_defaults, in arizona_of_get_core_pdata()
821 ARRAY_SIZE(pdata->gpio_defaults)); in arizona_of_get_core_pdata()
829 for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) { in arizona_of_get_core_pdata()
830 if (pdata->gpio_defaults[i] > 0xffff) in arizona_of_get_core_pdata()
831 pdata->gpio_defaults[i] = 0; in arizona_of_get_core_pdata()
832 else if (pdata->gpio_defaults[i] == 0) in arizona_of_get_core_pdata()
833 pdata->gpio_defaults[i] = 0x10000; in arizona_of_get_core_pdata()
836 dev_err(arizona->dev, "Failed to parse GPIO defaults: %d\n", in arizona_of_get_core_pdata()
850 { .name = "arizona-ldo1" },
859 "SPKVDDR",
863 { .name = "arizona-micsupp" },
864 { .name = "arizona-gpio" },
865 { .name = "arizona-haptics" },
866 { .name = "arizona-pwm" },
868 .name = "wm5102-codec",
875 { .name = "arizona-micsupp" },
876 { .name = "arizona-gpio" },
877 { .name = "arizona-haptics" },
878 { .name = "arizona-pwm" },
880 .name = "wm5110-codec",
893 { .name = "arizona-gpio" },
894 { .name = "arizona-haptics" },
895 { .name = "arizona-pwm" },
897 .name = "cs47l24-codec",
911 { .name = "arizona-micsupp" },
912 { .name = "arizona-gpio" },
913 { .name = "arizona-haptics" },
914 { .name = "arizona-pwm" },
916 .name = "wm8997-codec",
923 { .name = "arizona-micsupp" },
924 { .name = "arizona-gpio" },
925 { .name = "arizona-haptics" },
926 { .name = "arizona-pwm" },
928 .name = "wm8998-codec",
937 struct device *dev = arizona->dev; in arizona_dev_init()
944 dev_set_drvdata(arizona->dev, arizona); in arizona_dev_init()
945 mutex_init(&arizona->clk_lock); in arizona_dev_init()
947 if (dev_get_platdata(arizona->dev)) { in arizona_dev_init()
948 memcpy(&arizona->pdata, dev_get_platdata(arizona->dev), in arizona_dev_init()
949 sizeof(arizona->pdata)); in arizona_dev_init()
956 BUILD_BUG_ON(ARRAY_SIZE(arizona->mclk) != ARRAY_SIZE(mclk_name)); in arizona_dev_init()
957 for (i = 0; i < ARRAY_SIZE(arizona->mclk); i++) { in arizona_dev_init()
958 arizona->mclk[i] = devm_clk_get(arizona->dev, mclk_name[i]); in arizona_dev_init()
959 if (IS_ERR(arizona->mclk[i])) { in arizona_dev_init()
960 dev_info(arizona->dev, "Failed to get %s: %ld\n", in arizona_dev_init()
961 mclk_name[i], PTR_ERR(arizona->mclk[i])); in arizona_dev_init()
962 arizona->mclk[i] = NULL; in arizona_dev_init()
966 regcache_cache_only(arizona->regmap, true); in arizona_dev_init()
968 switch (arizona->type) { in arizona_dev_init()
978 arizona->core_supplies[i].supply in arizona_dev_init()
980 arizona->num_core_supplies = ARRAY_SIZE(wm5102_core_supplies); in arizona_dev_init()
983 dev_err(arizona->dev, "Unknown device type %d\n", in arizona_dev_init()
984 arizona->type); in arizona_dev_init()
985 return -ENODEV; in arizona_dev_init()
989 arizona->external_dcvdd = true; in arizona_dev_init()
991 switch (arizona->type) { in arizona_dev_init()
996 ret = mfd_add_devices(arizona->dev, -1, early_devs, in arizona_dev_init()
1005 ret = devm_regulator_bulk_get(dev, arizona->num_core_supplies, in arizona_dev_init()
1006 arizona->core_supplies); in arizona_dev_init()
1019 arizona->dcvdd = regulator_get(arizona->dev, "DCVDD"); in arizona_dev_init()
1020 if (IS_ERR(arizona->dcvdd)) { in arizona_dev_init()
1021 ret = PTR_ERR(arizona->dcvdd); in arizona_dev_init()
1026 if (!arizona->pdata.reset) { in arizona_dev_init()
1028 arizona->pdata.reset = devm_gpiod_get(arizona->dev, "reset", in arizona_dev_init()
1030 if (IS_ERR(arizona->pdata.reset)) { in arizona_dev_init()
1031 ret = PTR_ERR(arizona->pdata.reset); in arizona_dev_init()
1032 if (ret == -EPROBE_DEFER) in arizona_dev_init()
1035 dev_err(arizona->dev, in arizona_dev_init()
1038 arizona->pdata.reset = NULL; in arizona_dev_init()
1042 ret = regulator_bulk_enable(arizona->num_core_supplies, in arizona_dev_init()
1043 arizona->core_supplies); in arizona_dev_init()
1050 ret = regulator_enable(arizona->dcvdd); in arizona_dev_init()
1058 regcache_cache_only(arizona->regmap, false); in arizona_dev_init()
1061 ret = regmap_read(arizona->regmap, ARIZONA_SOFTWARE_RESET, ®); in arizona_dev_init()
1075 dev_err(arizona->dev, "Unknown device ID: %x\n", reg); in arizona_dev_init()
1076 ret = -ENODEV; in arizona_dev_init()
1081 if (!arizona->pdata.reset) { in arizona_dev_init()
1082 ret = regmap_write(arizona->regmap, ARIZONA_SOFTWARE_RESET, 0); in arizona_dev_init()
1092 switch (arizona->type) { in arizona_dev_init()
1094 ret = regmap_read(arizona->regmap, in arizona_dev_init()
1112 dev_err(arizona->dev, "Device failed initial boot: %d\n", ret); in arizona_dev_init()
1117 ret = regmap_read(arizona->regmap, ARIZONA_SOFTWARE_RESET, ®); in arizona_dev_init()
1123 ret = regmap_read(arizona->regmap, ARIZONA_DEVICE_REVISION, in arizona_dev_init()
1124 &arizona->rev); in arizona_dev_init()
1129 arizona->rev &= ARIZONA_DEVICE_REVISION_MASK; in arizona_dev_init()
1135 if (arizona->type != WM5102) { in arizona_dev_init()
1136 dev_warn(arizona->dev, in arizona_dev_init()
1138 arizona->type); in arizona_dev_init()
1139 arizona->type = WM5102; in arizona_dev_init()
1143 arizona->rev &= 0x7; in arizona_dev_init()
1150 switch (arizona->type) { in arizona_dev_init()
1159 dev_warn(arizona->dev, in arizona_dev_init()
1161 arizona->type); in arizona_dev_init()
1162 arizona->type = WM5110; in arizona_dev_init()
1173 switch (arizona->type) { in arizona_dev_init()
1183 dev_warn(arizona->dev, in arizona_dev_init()
1185 arizona->type); in arizona_dev_init()
1186 arizona->type = CS47L24; in arizona_dev_init()
1198 if (arizona->type != WM8997) { in arizona_dev_init()
1199 dev_warn(arizona->dev, in arizona_dev_init()
1201 arizona->type); in arizona_dev_init()
1202 arizona->type = WM8997; in arizona_dev_init()
1212 switch (arizona->type) { in arizona_dev_init()
1223 dev_warn(arizona->dev, in arizona_dev_init()
1225 arizona->type); in arizona_dev_init()
1226 arizona->type = WM8998; in arizona_dev_init()
1235 dev_err(arizona->dev, "Unknown device ID %x\n", reg); in arizona_dev_init()
1236 ret = -ENODEV; in arizona_dev_init()
1241 dev_err(arizona->dev, in arizona_dev_init()
1243 ret = -ENODEV; in arizona_dev_init()
1247 dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A'); in arizona_dev_init()
1252 dev_err(arizona->dev, "Failed to apply patch: %d\n", in arizona_dev_init()
1257 switch (arizona->type) { in arizona_dev_init()
1261 dev_err(arizona->dev, in arizona_dev_init()
1271 dev_err(arizona->dev, in arizona_dev_init()
1282 for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) { in arizona_dev_init()
1283 if (!arizona->pdata.gpio_defaults[i]) in arizona_dev_init()
1286 regmap_write(arizona->regmap, ARIZONA_GPIO1_CTRL + i, in arizona_dev_init()
1287 arizona->pdata.gpio_defaults[i]); in arizona_dev_init()
1291 if (!arizona->pdata.clk32k_src) in arizona_dev_init()
1292 arizona->pdata.clk32k_src = ARIZONA_32KZ_MCLK2; in arizona_dev_init()
1294 switch (arizona->pdata.clk32k_src) { in arizona_dev_init()
1297 regmap_update_bits(arizona->regmap, ARIZONA_CLOCK_32K_1, in arizona_dev_init()
1299 arizona->pdata.clk32k_src - 1); in arizona_dev_init()
1303 regmap_update_bits(arizona->regmap, ARIZONA_CLOCK_32K_1, in arizona_dev_init()
1307 dev_err(arizona->dev, "Invalid 32kHz clock source: %d\n", in arizona_dev_init()
1308 arizona->pdata.clk32k_src); in arizona_dev_init()
1309 ret = -EINVAL; in arizona_dev_init()
1314 if (!arizona->pdata.micbias[i].mV && in arizona_dev_init()
1315 !arizona->pdata.micbias[i].bypass) in arizona_dev_init()
1319 if (!arizona->pdata.micbias[i].mV) in arizona_dev_init()
1320 arizona->pdata.micbias[i].mV = 2800; in arizona_dev_init()
1322 val = (arizona->pdata.micbias[i].mV - 1500) / 100; in arizona_dev_init()
1326 if (arizona->pdata.micbias[i].ext_cap) in arizona_dev_init()
1329 if (arizona->pdata.micbias[i].discharge) in arizona_dev_init()
1332 if (arizona->pdata.micbias[i].soft_start) in arizona_dev_init()
1335 if (arizona->pdata.micbias[i].bypass) in arizona_dev_init()
1338 regmap_update_bits(arizona->regmap, in arizona_dev_init()
1347 pm_runtime_set_active(arizona->dev); in arizona_dev_init()
1348 pm_runtime_enable(arizona->dev); in arizona_dev_init()
1355 pm_runtime_set_autosuspend_delay(arizona->dev, 100); in arizona_dev_init()
1356 pm_runtime_use_autosuspend(arizona->dev); in arizona_dev_init()
1365 ret = mfd_add_devices(arizona->dev, PLATFORM_DEVID_NONE, in arizona_dev_init()
1369 dev_err(arizona->dev, "Failed to add subdevices: %d\n", ret); in arizona_dev_init()
1378 pm_runtime_disable(arizona->dev); in arizona_dev_init()
1380 switch (arizona->pdata.clk32k_src) { in arizona_dev_init()
1390 regulator_disable(arizona->dcvdd); in arizona_dev_init()
1392 regulator_bulk_disable(arizona->num_core_supplies, in arizona_dev_init()
1393 arizona->core_supplies); in arizona_dev_init()
1395 regulator_put(arizona->dcvdd); in arizona_dev_init()
1404 disable_irq(arizona->irq); in arizona_dev_exit()
1405 pm_runtime_disable(arizona->dev); in arizona_dev_exit()
1407 regulator_disable(arizona->dcvdd); in arizona_dev_exit()
1408 regulator_put(arizona->dcvdd); in arizona_dev_exit()
1410 switch (arizona->pdata.clk32k_src) { in arizona_dev_exit()
1419 mfd_remove_devices(arizona->dev); in arizona_dev_exit()
1426 regulator_bulk_disable(arizona->num_core_supplies, in arizona_dev_exit()
1427 arizona->core_supplies); in arizona_dev_exit()