Lines Matching +full:sw1 +full:- +full:3

1 // SPDX-License-Identifier: GPL-2.0
7 // Based on draft driver from Arnaud Patard <arnaud.patard@rtp-net.org>
23 #define MC13892_POWERCTL0_USEROFFSPI 3
80 #define MC13892_REGULATORSETTING0_VGEN1VSEL_M (3<<0)
81 #define MC13892_REGULATORSETTING0_VDIGVSEL_M (3<<4)
83 #define MC13892_REGULATORSETTING0_VPLLVSEL_M (3<<9)
84 #define MC13892_REGULATORSETTING0_VUSB2VSEL_M (3<<11)
86 #define MC13892_REGULATORSETTING0_VCAMVSEL_M (3<<16)
93 #define MC13892_REGULATORSETTING1_VVIDEOVSEL_M (3<<2)
94 #define MC13892_REGULATORSETTING1_VAUDIOVSEL_M (3<<4)
101 #define MC13892_REGULATORMODE0_VIOHIEN (1<<3)
144 #define MC13892_POWERMISC_PWGTSPI_M (3 << 15)
147 #define MC13892_USB1_VUSBEN (1<<3)
267 MC13892_SW_DEFINE(SW1, sw1, SWITCHERS0, SWITCHERS0, mc13892_sw1),
305 struct mc13xxx *mc13892 = priv->mc13xxx; in mc13892_powermisc_rmw()
311 mc13xxx_lock(priv->mc13xxx); in mc13892_powermisc_rmw()
317 priv->powermisc_pwgt_state = in mc13892_powermisc_rmw()
318 (priv->powermisc_pwgt_state & ~mask) | val; in mc13892_powermisc_rmw()
319 priv->powermisc_pwgt_state &= MC13892_POWERMISC_PWGTSPI_M; in mc13892_powermisc_rmw()
325 priv->powermisc_pwgt_state; in mc13892_powermisc_rmw()
329 mc13xxx_unlock(priv->mc13xxx); in mc13892_powermisc_rmw()
374 mc13xxx_lock(priv->mc13xxx); in mc13892_gpo_regulator_is_enabled()
375 ret = mc13xxx_reg_read(priv->mc13xxx, mc13892_regulators[id].reg, &val); in mc13892_gpo_regulator_is_enabled()
376 mc13xxx_unlock(priv->mc13xxx); in mc13892_gpo_regulator_is_enabled()
384 (priv->powermisc_pwgt_state ^ MC13892_POWERMISC_PWGTSPI_M); in mc13892_gpo_regulator_is_enabled()
406 mc13xxx_lock(priv->mc13xxx); in mc13892_sw_regulator_get_voltage_sel()
407 ret = mc13xxx_reg_read(priv->mc13xxx, in mc13892_sw_regulator_get_voltage_sel()
409 mc13xxx_unlock(priv->mc13xxx); in mc13892_sw_regulator_get_voltage_sel()
418 * According to the MC13892 documentation note 59 (Table 47) the SW1 in mc13892_sw_regulator_get_voltage_sel()
445 volt = rdev->desc->volt_table[selector]; in mc13892_sw_regulator_set_voltage_sel()
450 * Don't mess with the HI bit or support HI voltage offsets for SW1. in mc13892_sw_regulator_set_voltage_sel()
467 reg_value -= MC13892_SWxHI_SEL_OFFSET; in mc13892_sw_regulator_set_voltage_sel()
474 mc13xxx_lock(priv->mc13xxx); in mc13892_sw_regulator_set_voltage_sel()
475 ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13892_regulators[id].vsel_reg, in mc13892_sw_regulator_set_voltage_sel()
477 mc13xxx_unlock(priv->mc13xxx); in mc13892_sw_regulator_set_voltage_sel()
498 mc13xxx_lock(priv->mc13xxx); in mc13892_vcam_set_mode()
499 ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13892_regulators[id].reg, in mc13892_vcam_set_mode()
501 mc13xxx_unlock(priv->mc13xxx); in mc13892_vcam_set_mode()
512 mc13xxx_lock(priv->mc13xxx); in mc13892_vcam_get_mode()
513 ret = mc13xxx_reg_read(priv->mc13xxx, mc13892_regulators[id].reg, &val); in mc13892_vcam_get_mode()
514 mc13xxx_unlock(priv->mc13xxx); in mc13892_vcam_get_mode()
530 struct mc13xxx *mc13892 = dev_get_drvdata(pdev->dev.parent); in mc13892_regulator_probe()
532 dev_get_platdata(&pdev->dev); in mc13892_regulator_probe()
542 num_regulators = pdata->num_regulators; in mc13892_regulator_probe()
544 return -EINVAL; in mc13892_regulator_probe()
546 priv = devm_kzalloc(&pdev->dev, in mc13892_regulator_probe()
550 return -ENOMEM; in mc13892_regulator_probe()
552 priv->num_regulators = num_regulators; in mc13892_regulator_probe()
553 priv->mc13xxx_regulators = mc13892_regulators; in mc13892_regulator_probe()
554 priv->mc13xxx = mc13892; in mc13892_regulator_probe()
592 for (i = 0; i < priv->num_regulators; i++) { in mc13892_regulator_probe()
603 id = pdata->regulators[i].id; in mc13892_regulator_probe()
604 init_data = pdata->regulators[i].init_data; in mc13892_regulator_probe()
608 config.dev = &pdev->dev; in mc13892_regulator_probe()
613 priv->regulators[i] = devm_regulator_register(&pdev->dev, desc, in mc13892_regulator_probe()
615 if (IS_ERR(priv->regulators[i])) { in mc13892_regulator_probe()
616 dev_err(&pdev->dev, "failed to register regulator %s\n", in mc13892_regulator_probe()
618 return PTR_ERR(priv->regulators[i]); in mc13892_regulator_probe()
631 .name = "mc13892-regulator",
652 MODULE_ALIAS("platform:mc13892-regulator");