Samuel Holland | 3f90261 | 2021-10-08 00:17:16 -0500 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | #include <dm.h> |
| 4 | #include <i2c.h> |
| 5 | #include <power/pmic.h> |
| 6 | |
| 7 | static int axp_pmic_reg_count(struct udevice *dev) |
| 8 | { |
| 9 | /* TODO: Get the specific value from driver data. */ |
| 10 | return 0x100; |
| 11 | } |
| 12 | |
| 13 | static struct dm_pmic_ops axp_pmic_ops = { |
| 14 | .reg_count = axp_pmic_reg_count, |
| 15 | .read = dm_i2c_read, |
| 16 | .write = dm_i2c_write, |
| 17 | }; |
| 18 | |
| 19 | static const struct udevice_id axp_pmic_ids[] = { |
| 20 | { .compatible = "x-powers,axp152" }, |
| 21 | { .compatible = "x-powers,axp202" }, |
| 22 | { .compatible = "x-powers,axp209" }, |
| 23 | { .compatible = "x-powers,axp221" }, |
| 24 | { .compatible = "x-powers,axp223" }, |
| 25 | { .compatible = "x-powers,axp803" }, |
| 26 | { .compatible = "x-powers,axp806" }, |
| 27 | { .compatible = "x-powers,axp809" }, |
| 28 | { .compatible = "x-powers,axp813" }, |
| 29 | { } |
| 30 | }; |
| 31 | |
| 32 | U_BOOT_DRIVER(axp_pmic) = { |
| 33 | .name = "axp_pmic", |
| 34 | .id = UCLASS_PMIC, |
| 35 | .of_match = axp_pmic_ids, |
| 36 | .bind = dm_scan_fdt_dev, |
| 37 | .ops = &axp_pmic_ops, |
| 38 | }; |