Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1453652
| From | Roger Quadros <rogerq@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 1/6] extcon: Add the extcon_type to gather each connector into five category |
| Date | 2016-08-02 10:00 +0200 |
| Message-ID | <s1CCB-1s4-7@gated-at.bofh.it> (permalink) |
| References | <s1x9T-65C-3@gated-at.bofh.it> <s1x9T-65C-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On 02/08/16 04:58, Chanwoo Choi wrote:
> 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>
> ---
> drivers/extcon/extcon.c | 159 +++++++++++++++++++++++++++++++++++++++---------
> include/linux/extcon.h | 9 +++
> 2 files changed, 139 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 9a266e5c7e10..129afc87313e 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -38,43 +38,144 @@
> #define SUPPORTED_CABLE_MAX 32
> #define CABLE_NAME_MAX 30
>
> -static const char *extcon_name[] = {
> - [EXTCON_NONE] = "NONE",
> +struct __extcon_info {
> + unsigned int type;
> + unsigned int id;
> + const char *name;
> +
> +} extcon_info[] = {
> + [EXTCON_NONE] = {
> + .type = EXTCON_TYPE_MISC,
> + .id = EXTCON_NONE,
> + .name = "NONE",
> + },
>
> /* USB external connector */
> - [EXTCON_USB] = "USB",
> - [EXTCON_USB_HOST] = "USB-HOST",
> + [EXTCON_USB] = {
> + .type = EXTCON_TYPE_USB,
> + .id = EXTCON_USB,
> + .name = "USB",
> + },
> + [EXTCON_USB_HOST] = {
> + .type = EXTCON_TYPE_USB,
> + .id = EXTCON_USB,
> + .name = "USB_HOST",
> + },
EXTCON_USB_HOST should now be redundant as we can get all the
necessary information via EXTCON_USB.
>
> /* Charging external connector */
<snip>
cheers,
-roger
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3 1/6] extcon: Add the extcon_type to gather each connector into five category Chanwoo Choi <cw00.choi@samsung.com> - 2016-08-02 04:00 +0200 Re: [PATCH v3 1/6] extcon: Add the extcon_type to gather each connector into five category Chanwoo Choi <cw00.choi@samsung.com> - 2016-08-02 09:50 +0200 Re: [PATCH v3 1/6] extcon: Add the extcon_type to gather each connector into five category Roger Quadros <rogerq@ti.com> - 2016-08-02 10:00 +0200
csiph-web