diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-09-26 15:26:00 +0530 |
---|---|---|
committer | Ajay Nandakumar <anandakumarm@nvidia.com> | 2013-10-03 19:17:24 +0530 |
commit | 9f44b7fc20e947866da53b0e557b9841a38c8aec (patch) | |
tree | 5a14d8ae1e7ea2e1216f7b7339105d334b884a2b /drivers/extcon | |
parent | 649f9fadee4ee4fb577788d39bcd119bd305a3e4 (diff) |
extcon: palmas: add extcon connection name property for DT
Add property to set the extcon connection name so that the name
can be configure from DT.
Change-Id: Ifdee07cb60d2e29a764eea31989954ca5f4e2300
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/279285
(cherry picked from commit ed979fecab6c4edfe2d3eb8452aee029f6c3e580)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-palmas.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index c84f36216f7b..627623a8f4a0 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -311,6 +311,7 @@ static int palmas_usb_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; struct palmas_usb *palmas_usb; int status; + const char *ext_name = NULL; palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL); if (!palmas_usb) @@ -326,6 +327,9 @@ static int palmas_usb_probe(struct platform_device *pdev) "ti,enable-id-detection"); palmas_usb->enable_vbus_detection = of_property_read_bool(node, "ti,enable-vbus-detection"); + status = of_property_read_string(node, "extcon-name", &ext_name); + if (status < 0) + ext_name = NULL; } else { palmas_usb->wakeup = true; palmas_usb->enable_id_detection = true; @@ -339,6 +343,7 @@ static int palmas_usb_probe(struct platform_device *pdev) epdata->enable_vbus_detection; if (palmas_usb->enable_id_detection) palmas_usb->wakeup = true; + ext_name = epdata->connection_name; } } @@ -358,8 +363,7 @@ static int palmas_usb_probe(struct platform_device *pdev) palmas_usb->edev.supported_cable = palmas_extcon_cable; palmas_usb->edev.mutually_exclusive = mutually_exclusive; - palmas_usb->edev.name = (epdata && epdata->connection_name) ? - epdata->connection_name : pdev->name; + palmas_usb->edev.name = (ext_name) ? ext_name : dev_name(&pdev->dev); status = extcon_dev_register(&palmas_usb->edev, palmas_usb->dev); if (status < 0) { |