Lines Matching refs:axp20x
22 #include <linux/mfd/axp20x.h>
375 /* some IRQs are compatible with axp20x models */
593 .name = "axp20x-gpio",
596 .name = "axp20x-pek",
600 .name = "axp20x-regulator",
602 .name = "axp20x-adc",
605 .name = "axp20x-battery-power-supply",
608 .name = "axp20x-ac-power-supply",
613 .name = "axp20x-usb-power-supply",
626 .name = "axp20x-regulator",
631 .name = "axp20x-ac-power-supply",
636 .name = "axp20x-battery-power-supply",
639 .name = "axp20x-usb-power-supply",
655 .name = "axp20x-battery-power-supply",
658 .name = "axp20x-regulator",
660 .name = "axp20x-ac-power-supply",
665 .name = "axp20x-usb-power-supply",
674 .name = "axp20x-pek",
735 .name = "axp20x-gpio",
741 .name = "axp20x-battery-power-supply",
744 .name = "axp20x-ac-power-supply",
749 .name = "axp20x-usb-power-supply",
754 { .name = "axp20x-regulator" },
763 { .name = "axp20x-regulator" },
769 .name = "axp20x-regulator",
780 .name = "axp20x-regulator",
790 .name = "axp20x-regulator",
792 .name = "axp20x-gpio",
798 .name = "axp20x-battery-power-supply",
801 .name = "axp20x-ac-power-supply",
806 .name = "axp20x-usb-power-supply",
826 int axp20x_match_device(struct axp20x_dev *axp20x)
828 struct device *dev = axp20x->dev;
838 axp20x->variant = (long)of_id->data;
845 axp20x->variant = (long)acpi_id->driver_data;
848 switch (axp20x->variant) {
850 axp20x->nr_cells = ARRAY_SIZE(axp152_cells);
851 axp20x->cells = axp152_cells;
852 axp20x->regmap_cfg = &axp152_regmap_config;
853 axp20x->regmap_irq_chip = &axp152_regmap_irq_chip;
857 axp20x->nr_cells = ARRAY_SIZE(axp20x_cells);
858 axp20x->cells = axp20x_cells;
859 axp20x->regmap_cfg = &axp20x_regmap_config;
860 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
863 axp20x->nr_cells = ARRAY_SIZE(axp221_cells);
864 axp20x->cells = axp221_cells;
865 axp20x->regmap_cfg = &axp22x_regmap_config;
866 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
869 axp20x->nr_cells = ARRAY_SIZE(axp223_cells);
870 axp20x->cells = axp223_cells;
871 axp20x->regmap_cfg = &axp22x_regmap_config;
872 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip;
875 axp20x->cells = axp288_cells;
876 axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
877 axp20x->regmap_cfg = &axp288_regmap_config;
878 axp20x->regmap_irq_chip = &axp288_regmap_irq_chip;
879 axp20x->irq_flags = IRQF_TRIGGER_LOW;
882 axp20x->nr_cells = ARRAY_SIZE(axp803_cells);
883 axp20x->cells = axp803_cells;
884 axp20x->regmap_cfg = &axp288_regmap_config;
885 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip;
888 if (of_property_read_bool(axp20x->dev->of_node,
890 axp20x->nr_cells = ARRAY_SIZE(axp806_self_working_cells);
891 axp20x->cells = axp806_self_working_cells;
893 axp20x->nr_cells = ARRAY_SIZE(axp806_cells);
894 axp20x->cells = axp806_cells;
896 axp20x->regmap_cfg = &axp806_regmap_config;
897 axp20x->regmap_irq_chip = &axp806_regmap_irq_chip;
900 axp20x->nr_cells = ARRAY_SIZE(axp809_cells);
901 axp20x->cells = axp809_cells;
902 axp20x->regmap_cfg = &axp22x_regmap_config;
903 axp20x->regmap_irq_chip = &axp809_regmap_irq_chip;
906 axp20x->nr_cells = ARRAY_SIZE(axp813_cells);
907 axp20x->cells = axp813_cells;
908 axp20x->regmap_cfg = &axp288_regmap_config;
916 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip;
919 dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant);
923 axp20x_model_names[axp20x->variant]);
929 int axp20x_device_probe(struct axp20x_dev *axp20x)
951 if (axp20x->variant == AXP806_ID) {
952 if (of_property_read_bool(axp20x->dev->of_node,
954 of_property_read_bool(axp20x->dev->of_node,
956 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT,
959 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT,
963 ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq,
964 IRQF_ONESHOT | IRQF_SHARED | axp20x->irq_flags,
965 -1, axp20x->regmap_irq_chip, &axp20x->regmap_irqc);
967 dev_err(axp20x->dev, "failed to add irq chip: %d\n", ret);
971 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells,
972 axp20x->nr_cells, NULL, 0, NULL);
975 dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret);
976 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc);
981 axp20x_pm_power_off = axp20x;
985 dev_info(axp20x->dev, "AXP20X driver loaded\n");
991 int axp20x_device_remove(struct axp20x_dev *axp20x)
993 if (axp20x == axp20x_pm_power_off) {
998 mfd_remove_devices(axp20x->dev);
999 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc);