From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014AbcGZMJ7 (ORCPT ); Tue, 26 Jul 2016 08:09:59 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:54832 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877AbcGZMJ5 (ORCPT ); Tue, 26 Jul 2016 08:09:57 -0400 X-AuditID: cbfee68e-f79cb6d000006cfe-6b-57975312592f From: Chanwoo Choi To: linux-kernel@vger.kernel.org Cc: cw00.choi@samsung.com, myungjoo.ham@samsung.com, zyw@rock-chips.com, groeck@chromium.org, cwchoi00@gmail.com Subject: [PATCH 0/6] extcon: Add the support for extcon type and property Date: Tue, 26 Jul 2016 21:09:42 +0900 Message-id: <1469534988-8305-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsWyRsSkUFcoeHq4wckOS4vrX56zWjw7qm1x 6tUyZovLu+awWdxuXMFmMf/BDmYHNo/ZDRdZPHbOusvu8XfWfhaPvi2rGD0+b5ILYI3isklJ zcksSy3St0vgynix7TBjwSnligVbd7I3MH6U7WLk5JAQMJF4uugcE4QtJnHh3nq2LkYuDiGB FYwS6x+/YoUpOntjKitEYimjRMurRywQzhdGiTPbTjGCVLEJaEnsf3GDDcQWEVCQ2Nz7DKyb WaBIYun0n+wgtrCAp8SBh/eBajg4WARUJb78cQQJ8wq4SJxcdxzqCjmJD3sesYPMlxD4zSZx 4vgNsDksAgIS3yYfYgHplRCQldh0gBmiXlLi4IobLBMYBRcwMqxiFE0tSC4oTkovMtIrTswt Ls1L10vOz93ECAzV0/+e9e1gvHnA+hCjAAejEg/vC/dp4UKsiWXFlbmHGE2BNkxklhJNzgdG RF5JvKGxmZGFqYmpsZG5pZmSOG+C1M9gIYH0xJLU7NTUgtSi+KLSnNTiQ4xMHJxSDYyW1zT0 wozvmWY3rNkS7sStanHrDVv7lncPhL41/Xq256tbyD8Flv1KbGHxRS8qLY5f6/nA/8v+/cql F18azzu5yzwkxTx0utqlt70pxzau8jj40qj0wE3+7/czfLivzPsurxMguzrPulTeMuy12eLd r9cc3Vdf+1EicFqFlKjbQp/E1Y45yzWUWIozEg21mIuKEwGxCM+WUAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xgK5Q8PRwgzP9xhbXvzxntXh2VNvi 1KtlzBaXd81hs7jduILNYv6DHcwObB6zGy6yeOycdZfd4++s/SwefVtWMXp83iQXwBrVwGiT kZqYklqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk4hOg65aZA3SBkkJZYk4p UCggsbhYSd8O04TQEDddC5jGCF3fkCC4HiMDNJCwhjHjxbbDjAWnlCsWbN3J3sD4UbaLkZND QsBE4uyNqawQtpjEhXvr2boYuTiEBJYySrS8esQC4XxhlDiz7RQjSBWbgJbE/hc32EBsEQEF ic29z8C6mQWKJJZO/8kOYgsLeEoceHgfqIaDg0VAVeLLH0eQMK+Ai8TJdceZIJbJSXzY84h9 AiP3AkaGVYwSqQXJBcVJ6blGeanlesWJucWleel6yfm5mxjB8fBMegfj4V3uhxgFOBiVeHgd pk4LF2JNLCuuzD3EKMHBrCTCaxQ0PVyINyWxsiq1KD++qDQntfgQoynQ/onMUqLJ+cBYzSuJ NzQ2MTOyNDI3tDAyNlcS5338f12YkEB6YklqdmpqQWoRTB8TB6dUA+MOzv2SxsVrzArNL1xr 6deVXuGu+OXJogkvCzqtciQXuP67xsoiwMdcpLE+scKjvpxBZHvT/DnH3/fK2O6ZUPL0obPO 06Zz0n6FipzGuyy+9TVo3JMMvaZmG3PnHFuY1vIy+96Uls7NyUJcv0WPGKbGuF873z5v1hnl xu1PtRbUi+ksu3dMXImlOCPRUIu5qDgRAN4BI3udAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch-set add the support the extcon type, extcon property and the synchronization functions. The each external connector has the common characters. So, the external connectors are able to gather in the specific type. And the each external connectors has the specific H/W desigin to support the multiple features throught h/w lines. There are the requirement to express the each h/w character of each external connector. Lastly, when the state and property are changed, the extcon notify the extcon client driver of the changed information. To support the notification on extcon provider drivers, this patches support the three sync functions. Detailed description of these patches: 1. Add the extcon type to group the each external connector. There are five categories unitl now as following: - 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 2. Add the extcon property to support the multiple characteristic for the specific H/W design. - EXTCON_PROP_USB_[property name] - EXTCON_PROP_CHG_[property name] - EXTCON_PROP_JACK_[property name] - EXTCON_PROP_DISP_[property name] e.g., EXTCON_PROP_USB_ID and EXTCON_PROP_USB_VBUS The list of the new extcon APIs for the property 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) - 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); 3. Add the sync functions to synchronize the data of each external connector between an extcon provider driver and the extcon client drivers. The list of the new extcon sync APIs as following: - extcon_sync() : Send the notification for each external connector to synchronize the information between and extcon provider driver and the extcon client drivers. - extcon_set_state_sync() : Set the state of external connector with noti. - extcon_set_property_sync() : Set the property of external connector with noti. 4. Add the new external connector definition. The EXTCON_DISP_DP means the Display external connector[1]. The list of new external connector as following: - EXTCON_DISP_DP The list of new property of USB connector as following: - EXTCON_PROP_USB_TYPEC_POLARITY 5. Rename the renames the existing extcon_get/set_cable_state_() to maintain the function naming pattern like as extcon APIs for property. - extcon_set_cable_state_() -> extcon_set_state() - extcon_get_cable_state_() -> extcon_get_state() 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_ID, 1); extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); 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_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_ID, 1); 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); Depends on: This patch depend on the extcon patches[2]. [1] https://en.wikipedia.org/wiki/DisplayPort [2] http://comments.gmane.org/gmane.linux.kernel/2270818 Chanwoo Choi (5): extcon: Add the extcon_type to group each connector into five category extcon: Add the support for extcon property according to extcon type extcon: Add the support for the capability of each property extcon: Rename the extcon_set/get_state() to maintain the function naming pattern extcon: Add the synchronization extcon APIs to support the notification Chris Zhong (1): extcon: Add EXTCON_DISP_DP and the property for USB Type-C drivers/extcon/extcon.c | 707 ++++++++++++++++++++++++++++++++++++++++-------- include/linux/extcon.h | 176 +++++++++++- 2 files changed, 766 insertions(+), 117 deletions(-) -- 1.9.1