mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
extcon: Add named extcon link
Allow Android access by name. Signed-off-by: Tao Huang <huangtao@rock-chips.com> Change-Id: Ia81c1887f41a0ad587d7f78683213e9716e9806b
This commit is contained in:
parent
c653aafaf9
commit
513c60a1ba
|
|
@ -33,6 +33,9 @@
|
|||
#include <linux/sysfs.h>
|
||||
|
||||
#include "extcon.h"
|
||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||
#include "../base/base.h"
|
||||
#endif
|
||||
|
||||
#define SUPPORTED_CABLE_MAX 32
|
||||
|
||||
|
|
@ -1276,6 +1279,14 @@ int extcon_dev_register(struct extcon_dev *edev)
|
|||
list_add(&edev->entry, &extcon_dev_list);
|
||||
mutex_unlock(&extcon_dev_list_lock);
|
||||
|
||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||
ret = sysfs_create_link(&edev->dev.class->p->subsys.kobj,
|
||||
&edev->dev.kobj, edev->name);
|
||||
if (ret)
|
||||
dev_err(&edev->dev, "failed to create extcon %s link\n",
|
||||
edev->name);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
err_dev:
|
||||
|
|
@ -1323,6 +1334,11 @@ void extcon_dev_unregister(struct extcon_dev *edev)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||
sysfs_delete_link(&edev->dev.class->p->subsys.kobj,
|
||||
&edev->dev.kobj, edev->name);
|
||||
#endif
|
||||
|
||||
device_unregister(&edev->dev);
|
||||
|
||||
if (edev->mutually_exclusive && edev->max_supported) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user