Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbbEOObX (ORCPT ); Fri, 15 May 2015 10:31:23 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:50508 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753874AbbEOObV (ORCPT ); Fri, 15 May 2015 10:31:21 -0400 X-AuditID: cbfee68f-f793b6d000005f66-3d-555603370598 From: Chanwoo Choi To: linux-kernel@vger.kernel.org Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com, k.kozlowski@samsung.com, ckeepax@opensource.wolfsonmicro.com, gg@slimlogic.co.uk, kishon@ti.com, jaewon02.kim@samsung.com, rogerq@ti.com, ramakrishna.pallala@intel.com, george.cherian@ti.com, balbi@ti.com, aaro.koskinen@iki.fi Subject: [PATCH 0/2] extcon: Use the unique id for each cable and update the extcon notifier Date: Fri, 15 May 2015 23:31:16 +0900 Message-id: <1431700278-30465-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.5.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsWyRsSkQNecOSzUYMFlXos1LxwsDt6vt/g3 5Qa7xfUvz1ktTh1czmrRv8XFYkfDEVaL1y8MLS487WGzuLxrDpvF7cYVbBYL39xksuh5pOXA 63H460IWj8V7XjJ5vJz4m82jb8sqRo+pU/4yehy/sZ3J4/MmuQD2KC6blNSczLLUIn27BK6M qY2NLAXfBSq2Tu1lbWBcy9vFyMkhIWAicenpIjYIW0ziwr31QDYXh5DAUkaJ7iMHGGGK7k26 zg6RmM4ocfvDDkYI5wujxJWOh6wgVWwCWhL7X9wAGyUioCCxufcZK0gRs8BcJok5k/aAFQkL xElc+3mfBcRmEVCV2Lz4DFicV8BVoufDLnaIdQoSy5bPBGuWENjELrFo2zY2iAYBiW+TDwE1 cwAlZCU2HWCGqJeUOLjiBssERsEFjAyrGEVTC5ILipPSi4z1ihNzi0vz0v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zXE62aFheKj97ku8Yg43Z99WZckEGkvJPW4otKz9qvRR4EP6R09Gr/FTlIoGutHLRKbMC T5t+Pcni+F3mXkTpcnbDH4bpx/6dCc+TdZO4s2hRqtYmhQOJe/1PNi07FdovOe3KrrvtSizF GYmGWsxFxYkAzXT+t8UCAAA= 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 Content-Length: 2359 Lines: 58 This patch-set update the extcon core to resolve the ambiguous identification method for each external connectors. So, first patch define the unique id for each external connector to identify them by using common unique id on various extcon device driver as following: enum extcon { EXTCON_NONE = 0x0, /* NONE */ /* USB external connector */ EXTCON_USB = 0x1, /* USB */ EXTCON_USB_HOST = 0x2, /* USB-HOST */ /* Charger external connector */ EXTCON_TA = 0x10, /* TA */ EXTCON_FAST_CHARGER = 0x11, /* FAST-CHARGER */ EXTCON_SLOW_CHARGER = 0x12, /* SLOW-CHARGER */ EXTCON_CHARGE_DOWNSTREAM= 0x13, /* CHARGE-DOWNSTREAM */ ..... }; And the second patch simplify the prototype of extcon notifier's register and unregister function with the unique id. All extcon driver have to use the unique id (enum extcon definition) when registering the notifier and getting/setting the state of cable state. : int extcon_{register|unregister}_notifier(struct extcon_dev *edev, enum extcon id, struct notifier_block *nb) In result, the extcon_{register|unregister}_interest() will be deprecated by using the simply extcon_{register|unregister}_notifier(). Chanwoo Choi (2): extcon: Use the unique id for external connector instead of string extcon: Update the prototype of extcon_register_notifier() with enum extcon drivers/extcon/extcon-arizona.c | 38 ++--- drivers/extcon/extcon-axp288.c | 24 ++- drivers/extcon/extcon-max14577.c | 45 +++--- drivers/extcon/extcon-max77693.c | 95 ++++++------ drivers/extcon/extcon-max77843.c | 56 +++---- drivers/extcon/extcon-max8997.c | 59 +++----- drivers/extcon/extcon-palmas.c | 22 +-- drivers/extcon/extcon-rt8973a.c | 40 ++--- drivers/extcon/extcon-sm5502.c | 32 ++-- drivers/extcon/extcon-usb-gpio.c | 32 +--- drivers/extcon/extcon.c | 257 +++++++++++++++++++-------------- include/linux/extcon.h | 109 +++++++------- include/linux/extcon/extcon-adc-jack.h | 5 +- 13 files changed, 382 insertions(+), 432 deletions(-) -- 1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/