Lines Matching +full:x +full:- +full:powers
2 * MFD core driver for the X-Powers' Power Management ICs
4 * AXP20x typically comprises an adaptive USB-Compatible PWM charger, BUCK DC-DC
5 * converters, LDOs, multiple 12-bit ADCs of voltage, current and temperature
588 .name = "axp20x-gpio",
589 .of_compatible = "x-powers,axp209-gpio",
591 .name = "axp20x-pek",
595 .name = "axp20x-regulator",
597 .name = "axp20x-adc",
598 .of_compatible = "x-powers,axp209-adc",
600 .name = "axp20x-battery-power-supply",
601 .of_compatible = "x-powers,axp209-battery-power-supply",
603 .name = "axp20x-ac-power-supply",
604 .of_compatible = "x-powers,axp202-ac-power-supply",
608 .name = "axp20x-usb-power-supply",
609 .of_compatible = "x-powers,axp202-usb-power-supply",
617 .name = "axp221-pek",
621 .name = "axp20x-regulator",
623 .name = "axp22x-adc",
624 .of_compatible = "x-powers,axp221-adc",
626 .name = "axp20x-ac-power-supply",
627 .of_compatible = "x-powers,axp221-ac-power-supply",
631 .name = "axp20x-battery-power-supply",
632 .of_compatible = "x-powers,axp221-battery-power-supply",
634 .name = "axp20x-usb-power-supply",
635 .of_compatible = "x-powers,axp221-usb-power-supply",
643 .name = "axp221-pek",
647 .name = "axp22x-adc",
648 .of_compatible = "x-powers,axp221-adc",
650 .name = "axp20x-battery-power-supply",
651 .of_compatible = "x-powers,axp221-battery-power-supply",
653 .name = "axp20x-regulator",
655 .name = "axp20x-ac-power-supply",
656 .of_compatible = "x-powers,axp221-ac-power-supply",
660 .name = "axp20x-usb-power-supply",
661 .of_compatible = "x-powers,axp223-usb-power-supply",
669 .name = "axp20x-pek",
716 .name = "axp221-pek",
726 .name = "axp221-pek",
730 .name = "axp20x-gpio",
731 .of_compatible = "x-powers,axp813-gpio",
733 .name = "axp813-adc",
734 .of_compatible = "x-powers,axp813-adc",
736 .name = "axp20x-battery-power-supply",
737 .of_compatible = "x-powers,axp813-battery-power-supply",
739 .name = "axp20x-ac-power-supply",
740 .of_compatible = "x-powers,axp813-ac-power-supply",
744 { .name = "axp20x-regulator" },
749 .name = "axp221-pek",
753 { .name = "axp20x-regulator" },
759 .name = "axp20x-regulator",
765 .name = "axp221-pek",
770 .name = "axp20x-regulator",
776 .name = "axp221-pek",
780 .name = "axp20x-regulator",
782 .name = "axp20x-gpio",
783 .of_compatible = "x-powers,axp813-gpio",
785 .name = "axp813-adc",
786 .of_compatible = "x-powers,axp813-adc",
788 .name = "axp20x-battery-power-supply",
789 .of_compatible = "x-powers,axp813-battery-power-supply",
791 .name = "axp20x-ac-power-supply",
792 .of_compatible = "x-powers,axp813-ac-power-supply",
801 if (axp20x_pm_power_off->variant == AXP288_ID) in axp20x_power_off()
804 regmap_write(axp20x_pm_power_off->regmap, AXP20X_OFF_CTRL, in axp20x_power_off()
813 struct device *dev = axp20x->dev; in axp20x_match_device()
817 if (dev->of_node) { in axp20x_match_device()
818 of_id = of_match_device(dev->driver->of_match_table, dev); in axp20x_match_device()
821 return -ENODEV; in axp20x_match_device()
823 axp20x->variant = (long)of_id->data; in axp20x_match_device()
825 acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); in axp20x_match_device()
826 if (!acpi_id || !acpi_id->driver_data) { in axp20x_match_device()
828 return -ENODEV; in axp20x_match_device()
830 axp20x->variant = (long)acpi_id->driver_data; in axp20x_match_device()
833 switch (axp20x->variant) { in axp20x_match_device()
835 axp20x->nr_cells = ARRAY_SIZE(axp152_cells); in axp20x_match_device()
836 axp20x->cells = axp152_cells; in axp20x_match_device()
837 axp20x->regmap_cfg = &axp152_regmap_config; in axp20x_match_device()
838 axp20x->regmap_irq_chip = &axp152_regmap_irq_chip; in axp20x_match_device()
842 axp20x->nr_cells = ARRAY_SIZE(axp20x_cells); in axp20x_match_device()
843 axp20x->cells = axp20x_cells; in axp20x_match_device()
844 axp20x->regmap_cfg = &axp20x_regmap_config; in axp20x_match_device()
845 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip; in axp20x_match_device()
848 axp20x->nr_cells = ARRAY_SIZE(axp221_cells); in axp20x_match_device()
849 axp20x->cells = axp221_cells; in axp20x_match_device()
850 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
851 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
854 axp20x->nr_cells = ARRAY_SIZE(axp223_cells); in axp20x_match_device()
855 axp20x->cells = axp223_cells; in axp20x_match_device()
856 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
857 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
860 axp20x->cells = axp288_cells; in axp20x_match_device()
861 axp20x->nr_cells = ARRAY_SIZE(axp288_cells); in axp20x_match_device()
862 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
863 axp20x->regmap_irq_chip = &axp288_regmap_irq_chip; in axp20x_match_device()
864 axp20x->irq_flags = IRQF_TRIGGER_LOW; in axp20x_match_device()
867 axp20x->nr_cells = ARRAY_SIZE(axp803_cells); in axp20x_match_device()
868 axp20x->cells = axp803_cells; in axp20x_match_device()
869 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
870 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
873 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_match_device()
874 "x-powers,self-working-mode")) { in axp20x_match_device()
875 axp20x->nr_cells = ARRAY_SIZE(axp806_self_working_cells); in axp20x_match_device()
876 axp20x->cells = axp806_self_working_cells; in axp20x_match_device()
878 axp20x->nr_cells = ARRAY_SIZE(axp806_cells); in axp20x_match_device()
879 axp20x->cells = axp806_cells; in axp20x_match_device()
881 axp20x->regmap_cfg = &axp806_regmap_config; in axp20x_match_device()
882 axp20x->regmap_irq_chip = &axp806_regmap_irq_chip; in axp20x_match_device()
885 axp20x->nr_cells = ARRAY_SIZE(axp809_cells); in axp20x_match_device()
886 axp20x->cells = axp809_cells; in axp20x_match_device()
887 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
888 axp20x->regmap_irq_chip = &axp809_regmap_irq_chip; in axp20x_match_device()
891 axp20x->nr_cells = ARRAY_SIZE(axp813_cells); in axp20x_match_device()
892 axp20x->cells = axp813_cells; in axp20x_match_device()
893 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
901 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
904 dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant); in axp20x_match_device()
905 return -EINVAL; in axp20x_match_device()
908 axp20x_model_names[axp20x->variant]); in axp20x_match_device()
925 * AXP806_REG_ADDR_EXT, registers. The former is read-only, with in axp20x_device_probe()
934 * property "x-powers,master-mode" to override the default. in axp20x_device_probe()
936 if (axp20x->variant == AXP806_ID) { in axp20x_device_probe()
937 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
938 "x-powers,master-mode") || in axp20x_device_probe()
939 of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
940 "x-powers,self-working-mode")) in axp20x_device_probe()
941 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
944 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
948 ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq, in axp20x_device_probe()
949 IRQF_ONESHOT | IRQF_SHARED | axp20x->irq_flags, in axp20x_device_probe()
950 -1, axp20x->regmap_irq_chip, &axp20x->regmap_irqc); in axp20x_device_probe()
952 dev_err(axp20x->dev, "failed to add irq chip: %d\n", ret); in axp20x_device_probe()
956 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells, in axp20x_device_probe()
957 axp20x->nr_cells, NULL, 0, NULL); in axp20x_device_probe()
960 dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret); in axp20x_device_probe()
961 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_probe()
970 dev_info(axp20x->dev, "AXP20X driver loaded\n"); in axp20x_device_probe()
983 mfd_remove_devices(axp20x->dev); in axp20x_device_remove()
984 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_remove()