Lines Matching refs:axp20x

848 int axp20x_match_device(struct axp20x_dev *axp20x)  in axp20x_match_device()  argument
850 struct device *dev = axp20x->dev; in axp20x_match_device()
860 axp20x->variant = (long)of_id->data; in axp20x_match_device()
867 axp20x->variant = (long)acpi_id->driver_data; in axp20x_match_device()
870 switch (axp20x->variant) { in axp20x_match_device()
872 axp20x->nr_cells = ARRAY_SIZE(axp152_cells); in axp20x_match_device()
873 axp20x->cells = axp152_cells; in axp20x_match_device()
874 axp20x->regmap_cfg = &axp152_regmap_config; in axp20x_match_device()
875 axp20x->regmap_irq_chip = &axp152_regmap_irq_chip; in axp20x_match_device()
879 axp20x->nr_cells = ARRAY_SIZE(axp20x_cells); in axp20x_match_device()
880 axp20x->cells = axp20x_cells; in axp20x_match_device()
881 axp20x->regmap_cfg = &axp20x_regmap_config; in axp20x_match_device()
882 axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip; in axp20x_match_device()
885 axp20x->nr_cells = ARRAY_SIZE(axp221_cells); in axp20x_match_device()
886 axp20x->cells = axp221_cells; in axp20x_match_device()
887 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
888 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
891 axp20x->nr_cells = ARRAY_SIZE(axp223_cells); in axp20x_match_device()
892 axp20x->cells = axp223_cells; in axp20x_match_device()
893 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
894 axp20x->regmap_irq_chip = &axp22x_regmap_irq_chip; in axp20x_match_device()
897 axp20x->cells = axp288_cells; in axp20x_match_device()
898 axp20x->nr_cells = ARRAY_SIZE(axp288_cells); in axp20x_match_device()
899 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
900 axp20x->regmap_irq_chip = &axp288_regmap_irq_chip; in axp20x_match_device()
901 axp20x->irq_flags = IRQF_TRIGGER_LOW; in axp20x_match_device()
904 axp20x->nr_cells = ARRAY_SIZE(axp803_cells); in axp20x_match_device()
905 axp20x->cells = axp803_cells; in axp20x_match_device()
906 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
907 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
914 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_match_device()
916 axp20x->irq > 0) { in axp20x_match_device()
917 axp20x->nr_cells = ARRAY_SIZE(axp806_self_working_cells); in axp20x_match_device()
918 axp20x->cells = axp806_self_working_cells; in axp20x_match_device()
920 axp20x->nr_cells = ARRAY_SIZE(axp806_cells); in axp20x_match_device()
921 axp20x->cells = axp806_cells; in axp20x_match_device()
923 axp20x->regmap_cfg = &axp806_regmap_config; in axp20x_match_device()
924 axp20x->regmap_irq_chip = &axp806_regmap_irq_chip; in axp20x_match_device()
927 axp20x->nr_cells = ARRAY_SIZE(axp809_cells); in axp20x_match_device()
928 axp20x->cells = axp809_cells; in axp20x_match_device()
929 axp20x->regmap_cfg = &axp22x_regmap_config; in axp20x_match_device()
930 axp20x->regmap_irq_chip = &axp809_regmap_irq_chip; in axp20x_match_device()
933 axp20x->nr_cells = ARRAY_SIZE(axp813_cells); in axp20x_match_device()
934 axp20x->cells = axp813_cells; in axp20x_match_device()
935 axp20x->regmap_cfg = &axp288_regmap_config; in axp20x_match_device()
943 axp20x->regmap_irq_chip = &axp803_regmap_irq_chip; in axp20x_match_device()
946 dev_err(dev, "unsupported AXP20X ID %lu\n", axp20x->variant); in axp20x_match_device()
950 axp20x_model_names[axp20x->variant]); in axp20x_match_device()
956 int axp20x_device_probe(struct axp20x_dev *axp20x) in axp20x_device_probe() argument
978 if (axp20x->variant == AXP806_ID) { in axp20x_device_probe()
979 if (of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
981 of_property_read_bool(axp20x->dev->of_node, in axp20x_device_probe()
983 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
986 regmap_write(axp20x->regmap, AXP806_REG_ADDR_EXT, in axp20x_device_probe()
991 if (axp20x->irq > 0) { in axp20x_device_probe()
992 ret = regmap_add_irq_chip(axp20x->regmap, axp20x->irq, in axp20x_device_probe()
993 IRQF_ONESHOT | IRQF_SHARED | axp20x->irq_flags, in axp20x_device_probe()
994 -1, axp20x->regmap_irq_chip, in axp20x_device_probe()
995 &axp20x->regmap_irqc); in axp20x_device_probe()
997 dev_err(axp20x->dev, "failed to add irq chip: %d\n", in axp20x_device_probe()
1003 ret = mfd_add_devices(axp20x->dev, -1, axp20x->cells, in axp20x_device_probe()
1004 axp20x->nr_cells, NULL, 0, NULL); in axp20x_device_probe()
1007 dev_err(axp20x->dev, "failed to add MFD devices: %d\n", ret); in axp20x_device_probe()
1008 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_probe()
1013 axp20x_pm_power_off = axp20x; in axp20x_device_probe()
1017 dev_info(axp20x->dev, "AXP20X driver loaded\n"); in axp20x_device_probe()
1023 void axp20x_device_remove(struct axp20x_dev *axp20x) in axp20x_device_remove() argument
1025 if (axp20x == axp20x_pm_power_off) { in axp20x_device_remove()
1030 mfd_remove_devices(axp20x->dev); in axp20x_device_remove()
1031 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); in axp20x_device_remove()