forked from Minki/linux
Update extcon for v3.19
This patchset fix minor issue of extcon driver. Detailed description for patchset: - Fix typo and change jig cable name of extcon-max77693.c - Update the extcon_get_edev_by_phandle() because previous extcon_get_edev_by_phandle() considered the platform device driver. So, this modification supports OF-based extcon lookup method by using the list of extcon devices. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJUcxzfAAoJEJzN3yze689T5KoQAI709jZXredSvSGtUK6qQHKO +dh9rp9amIpTu+JASoCV//22XkLlOb/6dBg0bPYCSQ1KmO6k+AQSo4DXXayt713w Fx0f0th64/DmukO7gOXwWXh7+eAfXommUnJPtH7kZj44ZmEJyL7rS87Q/gg6jaua y4CLw6WvIupNiRHYS8umKM/Oj3z7WhxfMXnkE832uubiIK0ZhrlmMGcg4r410D+V FrQRmmtFrsZj+x5tnUMekX7BksYDnY/KBfmhY+OApRwveTjVrv77os1kcYKBEouD IgxKE6DCBiBq8a6rQv8UUJTA6H1DqGFjRAbypiVHxzRZhGZve33EYd8LUP/HHQgS JE86ufiJ8KEYrvq9B5zb9RSi2JHK4l/kr6AIiuoOsDjINVX5mnjelUY1Xhdog/DJ cLS2o7khFfz80/aMDs7n+k6kor+VLexAQuAsRotLXo8ppmItGKm5xellh04dFW6y evTsGyicwK3Vo/LNKzTvMKVOsyUI6Ky+B18vTcc+6KzwS5qBM3Pz9lzqGfqNyw0B fVeLBDS0SIby0DYlvrAJ1fs32/BnhaDT0SbPUH1HUJxlVk5GprzAC5vCfG7CjAwR jN9na8gg3nZp+8L/GmWDPt0ESQSg2x5BsacXFzVdhUTU16Fc+0S4PxkJ//w3TF6x ljUtHjUC90QeHX412l+P =k6tk -----END PGP SIGNATURE----- Merge tag 'extcon-next-for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-testing Update extcon for v3.19 This patchset fix minor issue of extcon driver. Detailed description for patchset: - Fix typo and change jig cable name of extcon-max77693.c - Update the extcon_get_edev_by_phandle() because previous extcon_get_edev_by_phandle() considered the platform device driver. So, this modification supports OF-based extcon lookup method by using the list of extcon devices.
This commit is contained in:
commit
1a3c724afd
@ -29,6 +29,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/extcon.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/of.h>
|
||||
@ -997,13 +998,16 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
edev = extcon_get_extcon_dev(node->name);
|
||||
if (!edev) {
|
||||
dev_err(dev, "unable to get extcon device : %s\n", node->name);
|
||||
return ERR_PTR(-ENODEV);
|
||||
mutex_lock(&extcon_dev_list_lock);
|
||||
list_for_each_entry(edev, &extcon_dev_list, entry) {
|
||||
if (edev->dev.parent && edev->dev.parent->of_node == node) {
|
||||
mutex_unlock(&extcon_dev_list_lock);
|
||||
return edev;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&extcon_dev_list_lock);
|
||||
|
||||
return edev;
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
}
|
||||
#else
|
||||
struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* extcon-max14577.c - MAX14577/77836 extcon driver to support MUIC
|
||||
*
|
||||
* Copyright (C) 2013,2014 Samsung Electrnoics
|
||||
* Copyright (C) 2013,2014 Samsung Electronics
|
||||
* Chanwoo Choi <cw00.choi@samsung.com>
|
||||
* Krzysztof Kozlowski <k.kozlowski@samsung.com>
|
||||
*
|
||||
|
@ -232,7 +232,7 @@ static const char *max77693_extcon_cable[] = {
|
||||
[EXTCON_CABLE_JIG_USB_ON] = "JIG-USB-ON",
|
||||
[EXTCON_CABLE_JIG_USB_OFF] = "JIG-USB-OFF",
|
||||
[EXTCON_CABLE_JIG_UART_OFF] = "JIG-UART-OFF",
|
||||
[EXTCON_CABLE_JIG_UART_ON] = "Dock-Car",
|
||||
[EXTCON_CABLE_JIG_UART_ON] = "JIG-UART-ON",
|
||||
[EXTCON_CABLE_DOCK_SMART] = "Dock-Smart",
|
||||
[EXTCON_CABLE_DOCK_DESK] = "Dock-Desk",
|
||||
[EXTCON_CABLE_DOCK_AUDIO] = "Dock-Audio",
|
||||
@ -532,9 +532,6 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
|
||||
extcon_set_cable_state(info->edev, "Dock-Smart", attached);
|
||||
extcon_set_cable_state(info->edev, "MHL", attached);
|
||||
goto out;
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* Dock-Car */
|
||||
strcpy(dock_name, "Dock-Car");
|
||||
break;
|
||||
case MAX77693_MUIC_ADC_AUDIO_MODE_REMOTE: /* Dock-Desk */
|
||||
strcpy(dock_name, "Dock-Desk");
|
||||
break;
|
||||
@ -669,6 +666,11 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
|
||||
strcpy(cable_name, "JIG-UART-OFF");
|
||||
path = CONTROL1_SW_UART;
|
||||
break;
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* ADC_JIG_UART_ON */
|
||||
/* PATH:AP_UART */
|
||||
strcpy(cable_name, "JIG-UART-ON");
|
||||
path = CONTROL1_SW_UART;
|
||||
break;
|
||||
default:
|
||||
dev_err(info->dev, "failed to detect %s jig cable\n",
|
||||
attached ? "attached" : "detached");
|
||||
@ -708,13 +710,13 @@ static int max77693_muic_adc_handler(struct max77693_muic_info *info)
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_USB_OFF:
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_USB_ON:
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF:
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON:
|
||||
/* JIG */
|
||||
ret = max77693_muic_jig_handler(info, cable_type, attached);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
case MAX77693_MUIC_ADC_RESERVED_ACC_3: /* Dock-Smart */
|
||||
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* Dock-Car */
|
||||
case MAX77693_MUIC_ADC_AUDIO_MODE_REMOTE: /* Dock-Desk */
|
||||
case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user