Lines Matching refs:wm8350
96 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_enable() local
101 switch (wm8350->pmic.isink_A_dcdc) { in wm8350_isink_enable()
104 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_enable()
106 wm8350_set_bits(wm8350, WM8350_CSA_FLASH_CONTROL, in wm8350_isink_enable()
108 wm8350_set_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_enable()
109 1 << (wm8350->pmic.isink_A_dcdc - in wm8350_isink_enable()
117 switch (wm8350->pmic.isink_B_dcdc) { in wm8350_isink_enable()
120 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_enable()
122 wm8350_set_bits(wm8350, WM8350_CSB_FLASH_CONTROL, in wm8350_isink_enable()
124 wm8350_set_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_enable()
125 1 << (wm8350->pmic.isink_B_dcdc - in wm8350_isink_enable()
140 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_disable() local
145 switch (wm8350->pmic.isink_A_dcdc) { in wm8350_isink_disable()
148 wm8350_clear_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_disable()
149 1 << (wm8350->pmic.isink_A_dcdc - in wm8350_isink_disable()
151 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_disable()
159 switch (wm8350->pmic.isink_B_dcdc) { in wm8350_isink_disable()
162 wm8350_clear_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_disable()
163 1 << (wm8350->pmic.isink_B_dcdc - in wm8350_isink_disable()
165 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_disable()
180 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_is_enabled() local
185 return wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_A) & in wm8350_isink_is_enabled()
188 return wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_B) & in wm8350_isink_is_enabled()
196 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_enable_time() local
202 reg = wm8350_reg_read(wm8350, WM8350_CSA_FLASH_CONTROL); in wm8350_isink_enable_time()
205 reg = wm8350_reg_read(wm8350, WM8350_CSB_FLASH_CONTROL); in wm8350_isink_enable_time()
239 int wm8350_isink_set_flash(struct wm8350 *wm8350, int isink, u16 mode, in wm8350_isink_set_flash() argument
245 wm8350_reg_write(wm8350, WM8350_CSA_FLASH_CONTROL, in wm8350_isink_set_flash()
251 wm8350_reg_write(wm8350, WM8350_CSB_FLASH_CONTROL, in wm8350_isink_set_flash()
265 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_set_suspend_voltage() local
269 dev_dbg(wm8350->dev, "%s %d mV %d\n", __func__, dcdc, uV / 1000); in wm8350_dcdc_set_suspend_voltage()
295 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_DC1_VSEL_MASK; in wm8350_dcdc_set_suspend_voltage()
296 wm8350_reg_write(wm8350, volt_reg, val | sel); in wm8350_dcdc_set_suspend_voltage()
302 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_set_suspend_enable() local
308 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER) in wm8350_dcdc_set_suspend_enable()
310 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER, in wm8350_dcdc_set_suspend_enable()
311 val | wm8350->pmic.dcdc1_hib_mode); in wm8350_dcdc_set_suspend_enable()
314 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER) in wm8350_dcdc_set_suspend_enable()
316 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER, in wm8350_dcdc_set_suspend_enable()
317 val | wm8350->pmic.dcdc3_hib_mode); in wm8350_dcdc_set_suspend_enable()
320 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER) in wm8350_dcdc_set_suspend_enable()
322 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER, in wm8350_dcdc_set_suspend_enable()
323 val | wm8350->pmic.dcdc4_hib_mode); in wm8350_dcdc_set_suspend_enable()
326 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER) in wm8350_dcdc_set_suspend_enable()
328 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER, in wm8350_dcdc_set_suspend_enable()
329 val | wm8350->pmic.dcdc6_hib_mode); in wm8350_dcdc_set_suspend_enable()
342 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_set_suspend_disable() local
348 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER); in wm8350_dcdc_set_suspend_disable()
349 wm8350->pmic.dcdc1_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_dcdc_set_suspend_disable()
350 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER, in wm8350_dcdc_set_suspend_disable()
354 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER); in wm8350_dcdc_set_suspend_disable()
355 wm8350->pmic.dcdc3_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_dcdc_set_suspend_disable()
356 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER, in wm8350_dcdc_set_suspend_disable()
360 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER); in wm8350_dcdc_set_suspend_disable()
361 wm8350->pmic.dcdc4_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_dcdc_set_suspend_disable()
362 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER, in wm8350_dcdc_set_suspend_disable()
366 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER); in wm8350_dcdc_set_suspend_disable()
367 wm8350->pmic.dcdc6_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_dcdc_set_suspend_disable()
368 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER, in wm8350_dcdc_set_suspend_disable()
382 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc25_set_suspend_enable() local
388 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL) in wm8350_dcdc25_set_suspend_enable()
390 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val | in wm8350_dcdc25_set_suspend_enable()
394 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL) in wm8350_dcdc25_set_suspend_enable()
396 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val | in wm8350_dcdc25_set_suspend_enable()
407 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc25_set_suspend_disable() local
413 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL) in wm8350_dcdc25_set_suspend_disable()
415 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val | in wm8350_dcdc25_set_suspend_disable()
419 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL) in wm8350_dcdc25_set_suspend_disable()
421 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val | in wm8350_dcdc25_set_suspend_disable()
433 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_set_suspend_mode() local
439 hib_mode = &wm8350->pmic.dcdc1_hib_mode; in wm8350_dcdc_set_suspend_mode()
442 hib_mode = &wm8350->pmic.dcdc3_hib_mode; in wm8350_dcdc_set_suspend_mode()
445 hib_mode = &wm8350->pmic.dcdc4_hib_mode; in wm8350_dcdc_set_suspend_mode()
448 hib_mode = &wm8350->pmic.dcdc6_hib_mode; in wm8350_dcdc_set_suspend_mode()
480 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_ldo_set_suspend_voltage() local
484 dev_dbg(wm8350->dev, "%s %d mV %d\n", __func__, ldo, uV / 1000); in wm8350_ldo_set_suspend_voltage()
508 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK; in wm8350_ldo_set_suspend_voltage()
509 wm8350_reg_write(wm8350, volt_reg, val | sel); in wm8350_ldo_set_suspend_voltage()
515 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_ldo_set_suspend_enable() local
537 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_HIB_MODE_MASK; in wm8350_ldo_set_suspend_enable()
538 wm8350_reg_write(wm8350, volt_reg, val); in wm8350_ldo_set_suspend_enable()
544 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_ldo_set_suspend_disable() local
566 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_HIB_MODE_MASK; in wm8350_ldo_set_suspend_disable()
567 wm8350_reg_write(wm8350, volt_reg, val | WM8350_LDO1_HIB_MODE_DIS); in wm8350_ldo_set_suspend_disable()
571 int wm8350_dcdc_set_slot(struct wm8350 *wm8350, int dcdc, u16 start, in wm8350_dcdc_set_slot() argument
577 dev_dbg(wm8350->dev, "%s %d start %d stop %d\n", in wm8350_dcdc_set_slot()
607 val = wm8350_reg_read(wm8350, slot_reg) & in wm8350_dcdc_set_slot()
610 wm8350_reg_write(wm8350, slot_reg, in wm8350_dcdc_set_slot()
619 int wm8350_ldo_set_slot(struct wm8350 *wm8350, int ldo, u16 start, u16 stop) in wm8350_ldo_set_slot() argument
624 dev_dbg(wm8350->dev, "%s %d start %d stop %d\n", in wm8350_ldo_set_slot()
648 val = wm8350_reg_read(wm8350, slot_reg) & ~WM8350_LDO1_SDSLOT_MASK; in wm8350_ldo_set_slot()
649 wm8350_reg_write(wm8350, slot_reg, val | ((start << 10) | (stop << 6))); in wm8350_ldo_set_slot()
654 int wm8350_dcdc25_set_mode(struct wm8350 *wm8350, int dcdc, u16 mode, in wm8350_dcdc25_set_mode() argument
659 dev_dbg(wm8350->dev, "%s %d mode: %s %s\n", __func__, dcdc, in wm8350_dcdc25_set_mode()
664 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL) in wm8350_dcdc25_set_mode()
667 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val | in wm8350_dcdc25_set_mode()
674 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL) in wm8350_dcdc25_set_mode()
677 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val | in wm8350_dcdc25_set_mode()
691 static int force_continuous_enable(struct wm8350 *wm8350, int dcdc, int enable) in force_continuous_enable() argument
713 ret = wm8350_set_bits(wm8350, reg, in force_continuous_enable()
716 ret = wm8350_clear_bits(wm8350, reg, in force_continuous_enable()
723 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_set_mode() local
738 wm8350_set_bits(wm8350, WM8350_DCDC_ACTIVE_OPTIONS, val); in wm8350_dcdc_set_mode()
739 wm8350_clear_bits(wm8350, WM8350_DCDC_SLEEP_OPTIONS, val); in wm8350_dcdc_set_mode()
740 force_continuous_enable(wm8350, dcdc, 1); in wm8350_dcdc_set_mode()
744 wm8350_set_bits(wm8350, WM8350_DCDC_ACTIVE_OPTIONS, val); in wm8350_dcdc_set_mode()
745 wm8350_clear_bits(wm8350, WM8350_DCDC_SLEEP_OPTIONS, val); in wm8350_dcdc_set_mode()
746 force_continuous_enable(wm8350, dcdc, 0); in wm8350_dcdc_set_mode()
750 force_continuous_enable(wm8350, dcdc, 0); in wm8350_dcdc_set_mode()
751 wm8350_clear_bits(wm8350, WM8350_DCDC_SLEEP_OPTIONS, val); in wm8350_dcdc_set_mode()
752 wm8350_clear_bits(wm8350, WM8350_DCDC_ACTIVE_OPTIONS, val); in wm8350_dcdc_set_mode()
756 force_continuous_enable(wm8350, dcdc, 0); in wm8350_dcdc_set_mode()
757 wm8350_set_bits(wm8350, WM8350_DCDC_SLEEP_OPTIONS, val); in wm8350_dcdc_set_mode()
766 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_dcdc_get_mode() local
790 active = wm8350_reg_read(wm8350, WM8350_DCDC_ACTIVE_OPTIONS) & mask; in wm8350_dcdc_get_mode()
791 force = wm8350_reg_read(wm8350, reg) & WM8350_DCDC1_FORCE_PWM_ENA; in wm8350_dcdc_get_mode()
792 sleep = wm8350_reg_read(wm8350, WM8350_DCDC_SLEEP_OPTIONS) & mask; in wm8350_dcdc_get_mode()
794 dev_dbg(wm8350->dev, "mask %x active %x sleep %x force %x", in wm8350_dcdc_get_mode()
1108 struct wm8350 *wm8350 = dev_get_drvdata(&pdev->dev); in wm8350_regulator_probe() local
1120 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER); in wm8350_regulator_probe()
1121 wm8350->pmic.dcdc1_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_regulator_probe()
1124 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER); in wm8350_regulator_probe()
1125 wm8350->pmic.dcdc3_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_regulator_probe()
1128 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER); in wm8350_regulator_probe()
1129 wm8350->pmic.dcdc4_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_regulator_probe()
1132 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER); in wm8350_regulator_probe()
1133 wm8350->pmic.dcdc6_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; in wm8350_regulator_probe()
1140 config.regmap = wm8350->regmap; in wm8350_regulator_probe()
1152 ret = wm8350_register_irq(wm8350, wm8350_reg[pdev->id].irq, in wm8350_regulator_probe()
1166 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_regulator_remove() local
1168 wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev); in wm8350_regulator_remove()
1173 int wm8350_register_regulator(struct wm8350 *wm8350, int reg, in wm8350_register_regulator() argument
1181 if (wm8350->pmic.pdev[reg]) in wm8350_register_regulator()
1185 reg > wm8350->pmic.max_dcdc) in wm8350_register_regulator()
1188 reg > wm8350->pmic.max_isink) in wm8350_register_regulator()
1195 wm8350->pmic.pdev[reg] = pdev; in wm8350_register_regulator()
1197 initdata->driver_data = wm8350; in wm8350_register_regulator()
1200 pdev->dev.parent = wm8350->dev; in wm8350_register_regulator()
1201 platform_set_drvdata(pdev, wm8350); in wm8350_register_regulator()
1206 dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", in wm8350_register_regulator()
1209 wm8350->pmic.pdev[reg] = NULL; in wm8350_register_regulator()
1232 int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink, in wm8350_register_led() argument
1239 if (lednum >= ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) { in wm8350_register_led()
1240 dev_err(wm8350->dev, "Invalid LED index %d\n", lednum); in wm8350_register_led()
1244 led = &wm8350->pmic.led[lednum]; in wm8350_register_led()
1247 dev_err(wm8350->dev, "LED %d already allocated\n", lednum); in wm8350_register_led()
1253 dev_err(wm8350->dev, "Failed to allocate LED %d\n", lednum); in wm8350_register_led()
1266 ret = wm8350_register_regulator(wm8350, isink, &led->isink_init); in wm8350_register_led()
1278 ret = wm8350_register_regulator(wm8350, dcdc, &led->dcdc_init); in wm8350_register_led()
1286 wm8350->pmic.isink_A_dcdc = dcdc; in wm8350_register_led()
1289 wm8350->pmic.isink_B_dcdc = dcdc; in wm8350_register_led()
1294 pdev->dev.parent = wm8350->dev; in wm8350_register_led()
1297 dev_err(wm8350->dev, "Failed to register LED %d: %d\n", in wm8350_register_led()