diff options
Diffstat (limited to 'drivers/mfd/da9052-core.c')
| -rw-r--r-- | drivers/mfd/da9052-core.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c index a88c2065d8ab..a23a3a1c7061 100644 --- a/drivers/mfd/da9052-core.c +++ b/drivers/mfd/da9052-core.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/mfd/core.h> | 18 | #include <linux/mfd/core.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/property.h> | ||
| 21 | 22 | ||
| 22 | #include <linux/mfd/da9052/da9052.h> | 23 | #include <linux/mfd/da9052/da9052.h> |
| 23 | #include <linux/mfd/da9052/pdata.h> | 24 | #include <linux/mfd/da9052/pdata.h> |
| @@ -519,9 +520,6 @@ static const struct mfd_cell da9052_subdev_info[] = { | |||
| 519 | .name = "da9052-wled3", | 520 | .name = "da9052-wled3", |
| 520 | }, | 521 | }, |
| 521 | { | 522 | { |
| 522 | .name = "da9052-tsi", | ||
| 523 | }, | ||
| 524 | { | ||
| 525 | .name = "da9052-bat", | 523 | .name = "da9052-bat", |
| 526 | }, | 524 | }, |
| 527 | { | 525 | { |
| @@ -529,6 +527,10 @@ static const struct mfd_cell da9052_subdev_info[] = { | |||
| 529 | }, | 527 | }, |
| 530 | }; | 528 | }; |
| 531 | 529 | ||
| 530 | static const struct mfd_cell da9052_tsi_subdev_info[] = { | ||
| 531 | { .name = "da9052-tsi" }, | ||
| 532 | }; | ||
| 533 | |||
| 532 | const struct regmap_config da9052_regmap_config = { | 534 | const struct regmap_config da9052_regmap_config = { |
| 533 | .reg_bits = 8, | 535 | .reg_bits = 8, |
| 534 | .val_bits = 8, | 536 | .val_bits = 8, |
| @@ -619,9 +621,27 @@ int da9052_device_init(struct da9052 *da9052, u8 chip_id) | |||
| 619 | goto err; | 621 | goto err; |
| 620 | } | 622 | } |
| 621 | 623 | ||
| 624 | /* | ||
| 625 | * Check if touchscreen pins are used are analogue input instead | ||
| 626 | * of having a touchscreen connected to them. The analogue input | ||
| 627 | * functionality will be provided by hwmon driver (if enabled). | ||
| 628 | */ | ||
| 629 | if (!device_property_read_bool(da9052->dev, "dlg,tsi-as-adc")) { | ||
| 630 | ret = mfd_add_devices(da9052->dev, PLATFORM_DEVID_AUTO, | ||
| 631 | da9052_tsi_subdev_info, | ||
| 632 | ARRAY_SIZE(da9052_tsi_subdev_info), | ||
| 633 | NULL, 0, NULL); | ||
| 634 | if (ret) { | ||
| 635 | dev_err(da9052->dev, "failed to add TSI subdev: %d\n", | ||
| 636 | ret); | ||
| 637 | goto err; | ||
| 638 | } | ||
| 639 | } | ||
| 640 | |||
| 622 | return 0; | 641 | return 0; |
| 623 | 642 | ||
| 624 | err: | 643 | err: |
| 644 | mfd_remove_devices(da9052->dev); | ||
| 625 | da9052_irq_exit(da9052); | 645 | da9052_irq_exit(da9052); |
| 626 | 646 | ||
| 627 | return ret; | 647 | return ret; |
