aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-09-15Merge branch 'next' into resolutionKishon Vijay Abraham I1-0/+1
Conflicts: drivers/extcon/extcon-adc-jack.c drivers/extcon/extcon-arizona.c drivers/extcon/extcon-gpio.c include/linux/extcon.h
2016-09-13extcon: Add support for qcom SPMI PMIC USB id detection hardwareStephen Boyd3-0/+177
Some Qualcomm PMICs have a misc device that performs USB id pin detection via an interrupt. When the interrupt triggers, we should read the interrupt line to see if it has gone high or low. If the interrupt is low then the ID pin is grounded, and if the interrupt is high then the ID pin is being held high. Cc: Roger Quadros <rogerq@ti.com> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> [cw00.choi: Edited the driver description and added the author information] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13extcon: Use the extcon_set_state_sync() instead of deprecated functionsChanwoo Choi13-83/+83
This patch alters the renamed extcon API to set the state of the external connectors instead of deprecated extcon_set_cable_state_(). Because the patch[1] modifies the function name to maintain the function naming pattern. - extcon_set_cable_state_() -> extcon_set_state_sync() - extcon_get_cable_state_() -> extcon_get_state() [1] https://lkml.org/lkml/2016/8/4/729 - extcon: Rename the extcon_set/get_state() to maintain the function naming pattern Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Roger Quadros <rogerq@ti.com>
2016-09-13extcon: axp288: Fix spelling mistakeColin Ian King1-3/+3
This patch fixes the spelling mistake in dev_dbg messages. Signed-off-by: Colin Ian King <colin.king@canonical.com> [cw00.choi: Modify the patch title/description] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13extcon: max14577: Change Krzysztof Kozlowski's email to kernel.orgKrzysztof Kozlowski1-2/+2
Change my email address to kernel.org instead of Samsung one for the purpose of any future contact. The copyrights remain untouched and are attributed to Samsung. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Add new EXTCON_CHG_WPT for Wireless Power Transfer deviceChanwoo Choi1-0/+5
This patchs add the new EXTCON_CHG_WPT for Wireless Power Transfer[1]. The Wireless Power Transfer is the transmission of electronical energy from a power source. The EXTCON_CHG_WPT has the EXTCON_TYPE_CHG. [1] https://en.wikipedia.org/wiki/Wireless_power_transfer Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Add new EXTCON_DISP_HMD for Head-mounted Display deviceChanwoo Choi1-0/+5
This patch adds the new EXTCON_DISP_HMD id for Head-mounted Display[1] device. The HMD device is usually for USB connector type So, the HMD connector has the two extcon types of both EXTCON_TYPE_DISP and EXTCON_TYPE_USB. [1] https://en.wikipedia.org/wiki/Head-mounted_display Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Add EXTCON_DISP_DP and the property for USB Type-CChris Zhong1-0/+5
Add EXTCON_DISP_DP for the Display external connector. For Type-C connector the DisplayPort can work as an Alternate Mode(VESA DisplayPort Alt Mode on USB Type-C Standard). The Type-C support both normal and flipped orientation, so add a property to extcon. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Add the synchronization extcon APIs to support the notificationChanwoo Choi1-75/+135
This patch adds the synchronization extcon APIs to support the notifications for both state and property. When extcon_*_sync() functions is called, the extcon informs the information from extcon provider to extcon client. The extcon driver may need to change the both state and multiple properties at the same time. After setting the data of a external connector, the extcon send the notification to client driver with the extcon_*_sync(). The list of new extcon APIs as following: - extcon_sync() : Send the notification for each external connector to synchronize the information between extcon provider driver and extcon client driver. - extcon_set_state_sync() : Set the state of external connector with noti. - extcon_set_property_sync() : Set the property of external connector with noti. For example, case 1, change the state of external connector and synchronized the data. extcon_set_state_sync(edev, EXTCON_USB, 1); case 2, change both the state and property of external connector and synchronized the data. extcon_set_state(edev, EXTCON_USB, 1); extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS 1); extcon_sync(edev, EXTCON_USB); case 3, change the property of external connector and synchronized the data. extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); extcon_sync(edev, EXTCON_USB); case 4, change the property of external connector and synchronized the data. extcon_set_property_sync(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Rename the extcon_set/get_state() to maintain the function naming patternChanwoo Choi1-15/+13
This patch just renames the existing extcon_get/set_cable_state_() as following because of maintaining the function naming pattern like as extcon APIs for property. - extcon_set_cable_state_() -> extcon_set_state() - extcon_get_cable_state_() -> extcon_get_state() But, this patch remains the old extcon_set/get_cable_state_() functions to prevent the build break. After altering new APIs, remove the old APIs. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Add the support for the capability of each propertyChanwoo Choi1-0/+140
This patch adds the support of the property capability setting. This function decides the supported properties of each external connector on extcon provider driver. Ths list of new extcon APIs to get/set the capability of property as following: - int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); - int extcon_set_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Add the support for extcon property according to extcon typeChanwoo Choi1-1/+200
This patch support the extcon property for the external connector because each external connector might have the property according to the H/W design and the specific characteristics. - EXTCON_PROP_USB_[property name] - EXTCON_PROP_CHG_[property name] - EXTCON_PROP_JACK_[property name] - EXTCON_PROP_DISP_[property name] Add the new extcon APIs to get/set the property value as following: - int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val) - int extcon_set_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value prop_val) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Add the extcon_type to gather each connector into five categoryChanwoo Choi1-29/+130
This patch adds the new extcon type to group the each connecotr into following five category. This type would be used to handle the connectors as a group unit instead of a connector unit. - EXTCON_TYPE_USB : USB connector - EXTCON_TYPE_CHG : Charger connector - EXTCON_TYPE_JACK : Jack connector - EXTCON_TYPE_DISP : Display connector - EXTCON_TYPE_MISC : Miscellaneous connector Also, each external connector is possible to belong to one more extcon type. In caes of EXTCON_CHG_USB_SDP, it have the EXTCON_TYPE_CHG and EXTCON_TYPE_USB. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-09-10extcon: Fix compile time warningManinder Singh1-1/+1
This patch fixes below compilation warning:- drivers/extcon/extcon.c: In function extcon_register_notifier: drivers/extcon/extcon.c:455:6: warning: idx may be used uninitialized in this function [-Wmaybe-uninitialized] if (idx >= 0) { Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> [cw00.choi : Modify the patch title using the a captical letter for first char] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Block the bit masking operation for cable state except for extcon coreChanwoo Choi1-19/+1
This patch restrict the usage of extcon_update_state() in the extcon core because the extcon_update_state() use the bit masking to change the state of external connector. When this function is used in device drivers, it may occur the probelm with the handling mistake of bit masking. Also, this patch removes the extcon_get/set_state() functions because these functions use the bit masking which is reluctant way. Instead, extcon provides the extcon_set/get_cable_state_() functions. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Remove the state_store() to prevent the wrong accessChanwoo Choi1-20/+1
This patch removes the state_store() which change the state of external connectors with bit masking on user-space. It is wrong access to modify the change the state of external connectors. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: gpio: Remove the usage of extcon_set_state()Chanwoo Choi1-1/+1
This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: adc-jack: Remove the usage of extcon_set_state()Chanwoo Choi1-12/+14
This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set/get_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: arizona: Remove the usage of extcon_update_state()Chanwoo Choi1-4/+7
This patch remvoes the usage of extcon_update_state() because the extcon_update_state() use directly the bit masking calculation to change the state of external connector without the unique id of external connector. It makes the code diffcult to read it. So, this patch uses the extcon_set_cable_state_() instead. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2016-09-10extcon: arizona: Remove unneeded semi-colonCharles Keepax1-1/+1
There is no need for a semi-colon at the end of a switch statement so remove it. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: Move extcon_get_edev_by_phandle() errors to dbg levelStephen Boyd1-2/+2
Sometimes drivers may call this API and expect it to fail because the extcon they're looking for is optional. Let's move these prints to debug level so it doesn't look like there's a problem when there isn't one. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-10extcon: adc-jack: update cable state during bootVenkat Reddy Talla1-0/+1
Update cable state during boot to avoid any missing external cable events occurred before driver initialisation. Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Add new EXTCON_CHG_WPT for Wireless Power Transfer deviceChanwoo Choi1-0/+5
This patchs add the new EXTCON_CHG_WPT for Wireless Power Transfer[1]. The Wireless Power Transfer is the transmission of electronical energy from a power source. The EXTCON_CHG_WPT has the EXTCON_TYPE_CHG. [1] https://en.wikipedia.org/wiki/Wireless_power_transfer Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Add new EXTCON_DISP_HMD for Head-mounted Display deviceChanwoo Choi1-0/+5
This patch adds the new EXTCON_DISP_HMD id for Head-mounted Display[1] device. The HMD device is usually for USB connector type So, the HMD connector has the two extcon types of both EXTCON_TYPE_DISP and EXTCON_TYPE_USB. [1] https://en.wikipedia.org/wiki/Head-mounted_display Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Add EXTCON_DISP_DP and the property for USB Type-CChris Zhong1-0/+5
Add EXTCON_DISP_DP for the Display external connector. For Type-C connector the DisplayPort can work as an Alternate Mode(VESA DisplayPort Alt Mode on USB Type-C Standard). The Type-C support both normal and flipped orientation, so add a property to extcon. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Add the synchronization extcon APIs to support the notificationChanwoo Choi1-75/+135
This patch adds the synchronization extcon APIs to support the notifications for both state and property. When extcon_*_sync() functions is called, the extcon informs the information from extcon provider to extcon client. The extcon driver may need to change the both state and multiple properties at the same time. After setting the data of a external connector, the extcon send the notification to client driver with the extcon_*_sync(). The list of new extcon APIs as following: - extcon_sync() : Send the notification for each external connector to synchronize the information between extcon provider driver and extcon client driver. - extcon_set_state_sync() : Set the state of external connector with noti. - extcon_set_property_sync() : Set the property of external connector with noti. For example, case 1, change the state of external connector and synchronized the data. extcon_set_state_sync(edev, EXTCON_USB, 1); case 2, change both the state and property of external connector and synchronized the data. extcon_set_state(edev, EXTCON_USB, 1); extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS 1); extcon_sync(edev, EXTCON_USB); case 3, change the property of external connector and synchronized the data. extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); extcon_sync(edev, EXTCON_USB); case 4, change the property of external connector and synchronized the data. extcon_set_property_sync(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Rename the extcon_set/get_state() to maintain the function naming patternChanwoo Choi1-15/+13
This patch just renames the existing extcon_get/set_cable_state_() as following because of maintaining the function naming pattern like as extcon APIs for property. - extcon_set_cable_state_() -> extcon_set_state() - extcon_get_cable_state_() -> extcon_get_state() But, this patch remains the old extcon_set/get_cable_state_() functions to prevent the build break. After altering new APIs, remove the old APIs. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Add the support for the capability of each propertyChanwoo Choi1-0/+140
This patch adds the support of the property capability setting. This function decides the supported properties of each external connector on extcon provider driver. Ths list of new extcon APIs to get/set the capability of property as following: - int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); - int extcon_set_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Add the support for extcon property according to extcon typeChanwoo Choi1-1/+200
This patch support the extcon property for the external connector because each external connector might have the property according to the H/W design and the specific characteristics. - EXTCON_PROP_USB_[property name] - EXTCON_PROP_CHG_[property name] - EXTCON_PROP_JACK_[property name] - EXTCON_PROP_DISP_[property name] Add the new extcon APIs to get/set the property value as following: - int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val) - int extcon_set_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value prop_val) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Add the extcon_type to gather each connector into five categoryChanwoo Choi1-29/+130
This patch adds the new extcon type to group the each connecotr into following five category. This type would be used to handle the connectors as a group unit instead of a connector unit. - EXTCON_TYPE_USB : USB connector - EXTCON_TYPE_CHG : Charger connector - EXTCON_TYPE_JACK : Jack connector - EXTCON_TYPE_DISP : Display connector - EXTCON_TYPE_MISC : Miscellaneous connector Also, each external connector is possible to belong to one more extcon type. In caes of EXTCON_CHG_USB_SDP, it have the EXTCON_TYPE_CHG and EXTCON_TYPE_USB. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Guenter Roeck <groeck@chromium.org>
2016-08-08extcon: Fix compile time warningManinder Singh1-1/+1
This patch fixes below compilation warning:- drivers/extcon/extcon.c: In function extcon_register_notifier: drivers/extcon/extcon.c:455:6: warning: idx may be used uninitialized in this function [-Wmaybe-uninitialized] if (idx >= 0) { Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> [cw00.choi : Modify the patch title using the a captical letter for first char] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Block the bit masking operation for cable state except for extcon coreChanwoo Choi1-19/+1
This patch restrict the usage of extcon_update_state() in the extcon core because the extcon_update_state() use the bit masking to change the state of external connector. When this function is used in device drivers, it may occur the probelm with the handling mistake of bit masking. Also, this patch removes the extcon_get/set_state() functions because these functions use the bit masking which is reluctant way. Instead, extcon provides the extcon_set/get_cable_state_() functions. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Remove the state_store() to prevent the wrong accessChanwoo Choi1-20/+1
This patch removes the state_store() which change the state of external connectors with bit masking on user-space. It is wrong access to modify the change the state of external connectors. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: gpio: Remove the usage of extcon_set_state()Chanwoo Choi1-1/+1
This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: adc-jack: Remove the usage of extcon_set_state()Chanwoo Choi1-12/+14
This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set/get_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: arizona: Remove the usage of extcon_update_state()Chanwoo Choi1-4/+7
This patch remvoes the usage of extcon_update_state() because the extcon_update_state() use directly the bit masking calculation to change the state of external connector without the unique id of external connector. It makes the code diffcult to read it. So, this patch uses the extcon_set_cable_state_() instead. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2016-08-08extcon: arizona: Remove unneeded semi-colonCharles Keepax1-1/+1
There is no need for a semi-colon at the end of a switch statement so remove it. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: Move extcon_get_edev_by_phandle() errors to dbg levelStephen Boyd1-2/+2
Sometimes drivers may call this API and expect it to fail because the extcon they're looking for is optional. Let's move these prints to debug level so it doesn't look like there's a problem when there isn't one. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-08-08extcon: adc-jack: update cable state during bootVenkat Reddy Talla1-0/+1
Update cable state during boot to avoid any missing external cable events occurred before driver initialisation. Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-07-02extcon: adc-jack: add suspend/resume supportVenkat Reddy Talla1-0/+34
adding suspend and resume funtionality for extcon-adc-jack driver to configure system wake up for extcon events, also adding support to enable/disable system wakeup through flag wakeup_source based on platform requirement. Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-07-02extcon: add missing of_node_put after calling of_parse_phandlePeter Chen1-0/+2
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-30extcon: link devres into core moduleArnd Bergmann1-1/+2
Splitting the resource-managed functions into a separate module means that the extcon core now fails to build because the internal "extcon_dev_allocate" symbol is not exported: ERROR: extcon_dev_allocate [drivers/extcon/devres.ko] undefined! My guess is that the intention was not to have two separate modules (which could be fixed by adding an export, plus the normal MODULE_AUTHOR/MODULE_LICENSE/... fields), but have two source files in the same module. This fixes the Makefile accordingly, making the name of the module extcon_core.ko, which is created from building both extcon.c and devres.c. Fixes: b225d00f3ad2 ("extcon: Split out the resource-managed functions from extcon core") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-27extcon: Add resource-managed functions to register extcon notifierChanwoo Choi1-0/+73
This patch adds the resource-managed functions for register/unregister the extcon notifier with the id of each external connector. This function will make it easy to handle the extcon notifier. - int devm_extcon_register_notifier(struct device *dev, struct extcon_dev *edev, unsigned int id, struct notifier_block *nb); - void devm_extcon_unregister_notifier(struct device *dev, struct extcon_dev *edev, unsigned int id, struct notifier_block *nb); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-27extcon: Split out the resource-managed functions from extcon coreChanwoo Choi3-118/+144
This patch split out the resource-managed related functions from extcon core driver. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-27extcon: Move struct extcon_cable from header file to coreChanwoo Choi1-0/+20
This patch moves the struct extcon_cable because that should be only handled by extcon core. There are no reason to publish the internal structure. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-23extcon: Check for incorrect connection type in notifier registerStephen Boyd1-0/+4
If we call extcon_register_notifier() with the wrong cable type, it blows up with an oops instead of returning an error code. Let's be nice and fail gracefully given that the consumer might not know if the cable is supported by the extcon provider. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-21Merge branch 'ib-extcon-powersupply-4.8' into extcon-nextChanwoo Choi1-177/+24
2016-06-21extcon: usb-gpio: add support for ACPI gpio interfaceLu Baolu1-1/+2
GPIO resource could be retrieved through APCI as well. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Felipe Balbi <balbi@kernel.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-21extcon: usb-gpio: add device binding for platform deviceLu Baolu1-0/+7
This is needed to handle the GPIO connected USB ID pin found on Intel Baytrail devices. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Felipe Balbi <balbi@kernel.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-06-21extcon: usb-gpio: Don't miss event during suspend/resumeRoger Quadros1-0/+3
Pin state might have changed during suspend/resume while our interrupts were disabled and if device doesn't support wakeup. Scan for change during resume for such case. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>