Lines Matching refs:axp20x

826 int axp20x_match_device(struct axp20x_dev *axp20x)  in axp20x_match_device()  argument
828 struct device *dev = axp20x->dev; in axp20x_match_device()
838 axp20x->variant = (long)of_id->data; in axp20x_match_device()
845 axp20x->variant = (long)acpi_id->driver_data; in axp20x_match_device()
848 switch (axp20x->variant) { in axp20x_match_device()
850 axp20x->nr_cells = ARRAY_SIZE(axp152_cells); in axp20x_match_device()
851 axp20x->cells = axp152_cells; in axp20x_match_device()
852 axp20x->regmap_cfg = &axp152_regmap_config; in axp20x_match_device()
853 axp20x->regmap_irq_chip = &axp152_regmap_irq_chip; in axp20x_match_device()
857 axp20x->nr_cells = ARRAY_SIZE(axp20x_cells); in axp20x_match_device()
858 axp20x->cells = axp20x_cells; in axp20x_match_device()
859 axp20x->regmap_cfg = &axp20x_regmap_config; in axp20x_match_device()
860 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip; in axp20x_match_device()
863 axp20x->nr_cells = ARRAY_SIZE(axp221_cells); in axp20x_match_device()
864 axp20x->cells = axp221_cells; in axp20x_match_device()
865 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
866 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
869 axp20x->nr_cells = ARRAY_SIZE(axp223_cells); in axp20x_match_device()
870 axp20x->cells = axp223_cells; in axp20x_match_device()
871 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
872 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
875 axp20x->cells = axp288_cells; in axp20x_match_device()
876 axp20x->nr_cells = ARRAY_SIZE(axp288_cells); in axp20x_match_device()
877 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
878 axp20x->regmap_irq_chip = &axp288_regmap_irq_chip; in axp20x_match_device()
879 axp20x->irq_flags = IRQF_TRIGGER_LOW; in axp20x_match_device()
882 axp20x->nr_cells = ARRAY_SIZE(axp803_cells); in axp20x_match_device()
883 axp20x->cells = axp803_cells; in axp20x_match_device()
884 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
885 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
888 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_match_device()
890 axp20x->nr_cells = ARRAY_SIZE(axp806_self_working_cells); in axp20x_match_device()
891 axp20x->cells = axp806_self_working_cells; in axp20x_match_device()
893 axp20x->nr_cells = ARRAY_SIZE(axp806_cells); in axp20x_match_device()
894 axp20x->cells = axp806_cells; in axp20x_match_device()
896 axp20x->regmap_cfg = &axp806_regmap_config; in axp20x_match_device()
897 axp20x->regmap_irq_chip = &axp806_regmap_irq_chip; in axp20x_match_device()
900 axp20x->nr_cells = ARRAY_SIZE(axp809_cells); in axp20x_match_device()
901 axp20x->cells = axp809_cells; in axp20x_match_device()
902 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
903 axp20x->regmap_irq_chip = &axp809_regmap_irq_chip; in axp20x_match_device()
906 axp20x->nr_cells = ARRAY_SIZE(axp813_cells); in axp20x_match_device()
907 axp20x->cells = axp813_cells; in axp20x_match_device()
908 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
916 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
919 dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant); in axp20x_match_device()
923 axp20x_model_names[axp20x->variant]); in axp20x_match_device()
929 int axp20x_device_probe(struct axp20x_dev *axp20x) in axp20x_device_probe() argument
951 if (axp20x->variant == AXP806_ID) { in axp20x_device_probe()
952 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
954 of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
956 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
959 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
963 ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq, in axp20x_device_probe()
964 IRQF_ONESHOT | IRQF_SHARED | axp20x->irq_flags, in axp20x_device_probe()
965 -1, axp20x->regmap_irq_chip, &axp20x->regmap_irqc); in axp20x_device_probe()
967 dev_err(axp20x->dev, "failed to add irq chip: %d\n", ret); in axp20x_device_probe()
971 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells, in axp20x_device_probe()
972 axp20x->nr_cells, NULL, 0, NULL); in axp20x_device_probe()
975 dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret); in axp20x_device_probe()
976 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_probe()
981 axp20x_pm_power_off = axp20x; in axp20x_device_probe()
985 dev_info(axp20x->dev, "AXP20X driver loaded\n"); in axp20x_device_probe()
991 int axp20x_device_remove(struct axp20x_dev *axp20x) in axp20x_device_remove() argument
993 if (axp20x == axp20x_pm_power_off) { in axp20x_device_remove()
998 mfd_remove_devices(axp20x->dev); in axp20x_device_remove()
999 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_remove()