Lines Matching refs:ldo
156 struct ldo_regulator *ldo; member
778 struct ldo_regulator *ldo = rdev_get_drvdata(dev); in ldo_regulator_is_enabled() local
780 return ldo->enabled; in ldo_regulator_is_enabled()
785 struct ldo_regulator *ldo = rdev_get_drvdata(dev); in ldo_regulator_enable() local
786 struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data; in ldo_regulator_enable()
793 reg = (1600 - ldo->voltage / 1000) / 50; in ldo_regulator_enable()
797 ldo->voltage = (1600 - reg * 50) * 1000; in ldo_regulator_enable()
812 ldo->enabled = 1; in ldo_regulator_enable()
818 struct ldo_regulator *ldo = rdev_get_drvdata(dev); in ldo_regulator_disable() local
819 struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data; in ldo_regulator_disable()
829 ldo->enabled = 0; in ldo_regulator_disable()
836 struct ldo_regulator *ldo = rdev_get_drvdata(dev); in ldo_regulator_get_voltage() local
838 return ldo->voltage; in ldo_regulator_get_voltage()
852 struct ldo_regulator *ldo; in ldo_regulator_register() local
854 ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL); in ldo_regulator_register()
856 if (!ldo) { in ldo_regulator_register()
861 ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL); in ldo_regulator_register()
862 if (!ldo->desc.name) { in ldo_regulator_register()
863 kfree(ldo); in ldo_regulator_register()
868 ldo->desc.type = REGULATOR_VOLTAGE; in ldo_regulator_register()
869 ldo->desc.owner = THIS_MODULE; in ldo_regulator_register()
870 ldo->desc.ops = &ldo_regulator_ops; in ldo_regulator_register()
871 ldo->desc.n_voltages = 1; in ldo_regulator_register()
873 ldo->codec_data = codec; in ldo_regulator_register()
874 ldo->voltage = voltage; in ldo_regulator_register()
876 ldo->dev = regulator_register(&ldo->desc, codec->dev, in ldo_regulator_register()
877 init_data, ldo); in ldo_regulator_register()
878 if (IS_ERR(ldo->dev)) { in ldo_regulator_register()
879 int ret = PTR_ERR(ldo->dev); in ldo_regulator_register()
882 kfree(ldo->desc.name); in ldo_regulator_register()
883 kfree(ldo); in ldo_regulator_register()
894 struct ldo_regulator *ldo = sgtl5000->ldo; in ldo_regulator_remove() local
896 if (!ldo) in ldo_regulator_remove()
899 regulator_unregister(ldo->dev); in ldo_regulator_remove()
900 kfree(ldo->desc.name); in ldo_regulator_remove()
901 kfree(ldo); in ldo_regulator_remove()