1. 08 8月, 2016 9 次提交
  2. 02 7月, 2016 1 次提交
  3. 27 6月, 2016 2 次提交
  4. 23 6月, 2016 1 次提交
  5. 10 6月, 2016 1 次提交
    • C
      extcon: Remove the deprecated extcon functions · 830ae442
      Chanwoo Choi 提交于
      This patch removes the deprecated extcon functions using string type
      to identify the type of external connector. The Commit 2a9de9c0
      ("extcon: Use the unique id for external connector instead of string)
      uses the unique id to separate the type of external connector instead of
      string name.
      - extcon_register_interest()
      - extcon_unregister_interest()
      - extcon_set_cable_state()
      - extcon_get_cable_state()
      
      And, extcon_register_interest() finds the first extcon device to include the
      requested external connector from extcon client device and then register the
      notifier if extcon device argument is NULL. Instead, extcon_register_notifier()
      supports this feature.
      
      But, this patch remains the deprecatd function definition to prevent
      the build break.
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      830ae442
  6. 16 10月, 2015 1 次提交
    • C
      extcon: Modify the id and name of external connector · 11eecf91
      Chanwoo Choi 提交于
      This patch modifies the id and name of external connector with the
      additional prefix to clarify both attribute and meaning of external
      connector as following:
      - EXTCON_CHG_* mean the charger connector.
      - EXTCON_JACK_* mean the jack connector.
      - EXTCON_DISP_* mean the display port connector.
      
      Following table show the new name of external connector with old name:
      --------------------------------------------------
      Old extcon name         | New extcon name        |
      --------------------------------------------------
      EXTCON_TA               | EXTCON_CHG_USB_DCP     |
      EXTCON_CHARGE_DOWNSTREAM| EXTCON_CHG_USB_CDP     |
      EXTCON_FAST_CHARGER     | EXTCON_CHG_USB_FAST    |
      EXTCON_SLOW_CHARGER     | EXTCON_CHG_USB_SLOW    |
      --------------------------------------------------
      EXTCON_MICROPHONE       | EXTCON_JACK_MICROPHONE |
      EXTCON_HEADPHONE        | EXTCON_JACK_HEADPHONE  |
      EXTCON_LINE_IN          | EXTCON_JACK_LINE_IN    |
      EXTCON_LINE_OUT         | EXTCON_JACK_LINE_OUT   |
      EXTCON_VIDEO_IN         | EXTCON_JACK_VIDEO_IN   |
      EXTCON_VIDEO_OUT        | EXTCON_JACK_VIDEO_OUT  |
      EXTCON_SPDIF_IN         | EXTCON_JACK_SPDIF_IN   |
      EXTCON_SPDIF_OUT        | EXTCON_JACK_SPDIF_OUT  |
      --------------------------------------------------
      EXTCON_HMDI             | EXTCON_DISP_HDMI       |
      EXTCON_MHL              | EXTCON_DISP_MHL        |
      EXTCON_DVI              | EXTCON_DISP_DVI        |
      EXTCON_VGA              | EXTCON_DISP_VGA        |
      --------------------------------------------------
      
      And, when altering the name of USB charger connector, EXTCON refers to the
      "Battery Charging v1.2 Spec and Adopters Agreement"[1] to use the standard
      name of USB charging port as following. Following name of USB charging port
      are already used in power_supply subsystem. We chan check it on patch[2].
      - EXTCON_CHG_USB_SDP	/* Standard Downstream Port */
      - EXTCON_CHG_USB_DCP	/* Dedicated Charging Port */
      - EXTCON_CHG_USB_CDP	/* Charging Downstream Port */
      - EXTCON_CHG_USB_ACA	/* Accessory Charger Adapter */
      
      [1] www.usb.org/developers/docs/devclass_docs/BCv1.2_070312.zip
      [2] commit 85efc8a1 ("power_supply: Add types for USB chargers")
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      [ckeepax: For the Arizona changes]
      Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Reviewed-by: NRoger Quadros <rogerq@ti.com>
      11eecf91
  7. 21 9月, 2015 1 次提交
  8. 10 8月, 2015 3 次提交
  9. 31 7月, 2015 2 次提交
  10. 13 6月, 2015 1 次提交
  11. 29 5月, 2015 1 次提交
  12. 22 5月, 2015 3 次提交
    • C
      extcon: Update the prototype of extcon_register_notifier() with enum extcon · 046050f6
      Chanwoo Choi 提交于
      Previously, extcon consumer driver used the extcon_register_interest()
      to register the notifier chain and then to receive the notifier event
      when external connector's state is changed. When registering the notifier chain
      for specific external connector with extcon_register_interest(), it used the
      the string name of external connector directly. There are potential problem
      because of unclear, non-standard and inconsequent cable name. Namely,
      it is not appropriate method to identify each external connector.
      
      So, this patch modify the prototype of extcon_register_notifier() by using
      the 'enum extcon' which are the unique id for each external connector
      instead of unclear string method.
      
      - Previously, the extcon consumer driver used the extcon_register_interest()
      with 'cable_name' to point out the specific external connector. Also. it used
      the un-needed structure (struct extcon_specific_cable_nb).
      : int extcon_register_interest(struct extcon_specific_cable_nb *obj,
      			     const char *extcon_name, const char *cable_name,
      			     struct notifier_block *nb)
      
      - Newly, the updated extcon_register_notifier() would definitely support
      the same feature to detech the changed state of external connector without
      any specific structure (struct extcon_specific_cable_nb).
      : int extcon_register_notifier(struct extcon_dev *edev, enum extcon id,
      			     struct notifier_block *nb)
      
      This patch support the both extcon_register_interest() and new extcon_register_
      notifier(). But the extcon_{register|unregister}_interest() will be deprecated
      because extcon core would support the notifier event for extcon consumer driver
      with only updated extcon_register_notifier() and 'extcon_specific_cable_nb'
      will be removed if there are no extcon consumer driver with legacy
      extcon_{register|unregister}_interest().
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      046050f6
    • C
      extcon: Use capital letter for the name of external connectors · 8e9bc36d
      Chanwoo Choi 提交于
      This patch uses the capital letter for the name of external connectors
      to improve the readability instead of small letter.
      
      Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      8e9bc36d
    • C
      extcon: Use the unique id for external connector instead of string · 2a9de9c0
      Chanwoo Choi 提交于
      This patch uses the unique id to identify the type of external connector instead
      of string name. The string name have the many potential issues. So, this patch
      defines the 'extcon' enumeration which includes all supported external connector
      on EXTCON subsystem. If new external connector is necessary, the unique id of
      new connector have to be added in 'extcon' enumeration. There are current
      supported external connector in 'enum extcon' as following:
      
      enum extcon {
      	EXTCON_NONE		= 0x0,
      
      	/* USB external connector */
      	EXTCON_USB		= 0x1,
      	EXTCON_USB_HOST		= 0x2,
      
      	/* Charger external connector */
      	EXTCON_TA		= 0x10,
      	EXTCON_FAST_CHARGER	= 0x11,
      	EXTCON_SLOW_CHARGER	= 0x12,
      	EXTCON_CHARGE_DOWNSTREAM = 0x13,
      
      	/* Audio and video external connector */
      	EXTCON_LINE_IN		= 0x20,
      	EXTCON_LINE_OUT		= 0x21,
      	EXTCON_MICROPHONE	= 0x22,
      	EXTCON_HEADPHONE	= 0x23,
      
      	EXTCON_HDMI		= 0x30,
      	EXTCON_MHL		= 0x31,
      	EXTCON_DVI		= 0x32,
      	EXTCON_VGA		= 0x33,
      	EXTCON_SPDIF_IN		= 0x34,
      	EXTCON_SPDIF_OUT	= 0x35,
      	EXTCON_VIDEO_IN		= 0x36,
      	EXTCON_VIDEO_OUT	= 0x37,
      
      	/* Miscellaneous external connector */
      	EXTCON_DOCK		= 0x50,
      	EXTCON_JIG		= 0x51,
      	EXTCON_MECHANICAL	= 0x52,
      
      	EXTCON_END,
      };
      
      For example in extcon-arizona.c:
      To use unique id removes the potential issue about handling
      the inconsistent name of external connector with string.
      - Previously, use the string to register the type of arizona jack connector
      static const char *arizona_cable[] = {
      	"Mechanical",
      	"Microphone",
      	"Headphone",
      	"Line-out",
      };
      - Newly, use the unique id to register the type of arizona jack connector
      static const enum extcon arizona_cable[] = {
      	EXTCON_MECHANICAL,
      	EXTCON_MICROPHONE,
      	EXTCON_HEADPHONE,
      	EXTCON_LINE_OUT,
      
      	EXTCON_NONE,
      };
      
      And this patch modify the prototype of extcon_{get|set}_cable_state_() which
      uses the 'enum extcon id' instead of 'cable_index'. Because although one more
      extcon drivers support USB cable, each extcon driver might has the differnt
      'cable_index' for USB cable. All extcon drivers can use the unique id number
      for same external connector with modified extcon_{get|set}_cable_state_().
      
      - Previously, use 'cable_index' on these functions:
      extcon_get_cable_state_(struct extcon_dev*, int cable_index)
      extcon_set_cable_state_(struct extcon_dev*, int cable_index, bool state)
      
      -Newly, use 'enum extcon id' on these functions:
      extcon_get_cable_state_(struct extcon_dev*, enum extcon id)
      extcon_set_cable_state_(struct extcon_dev*, enum extcon id, bool state)
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      Acked-by: NRoger Quadros <rogerq@ti.com>
      Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Acked-by: NRamakrishna Pallala <ramakrishna.pallala@intel.com>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      [arnd: Report the build break about drivers/usb/phy/phy-tahvo.c after using the
      unique id for external connector insteadf of string]
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      [dan.carpenter: Report the build warning of extcon_{set|get}_cable_state_()]
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      2a9de9c0
  13. 19 5月, 2015 3 次提交
  14. 23 3月, 2015 1 次提交
  15. 07 3月, 2015 2 次提交
  16. 26 1月, 2015 1 次提交
  17. 24 11月, 2014 1 次提交
  18. 16 6月, 2014 1 次提交
  19. 29 4月, 2014 2 次提交
  20. 24 4月, 2014 1 次提交
  21. 19 3月, 2014 1 次提交
  22. 26 11月, 2013 1 次提交
    • W
      extcon: remove freed groups caused the panic or warning in unregister flow · 7585ca0d
      Wang, Xiaoming 提交于
      (edev->extcon_dev_type.groups) has been freed before device_unregister.
      extcon_dev_unregister -> kfree(edev->extcon_dev_type.groups)
      then device_unregister -> device_del -> device_remove_attrs
      -> device_remove_groups(dev, type->groups);
      panic because type->groups has been freed.
      
      This patch is move device_unregister ahead of groups free
      to avoid panic in extcon_dev_unregister.
      
      stack
      [ 22.847226] BUG: unable to handle kernel paging request at 5f39746e
      [ 22.847234] IP: [<c1387fcd>] sysfs_remove_group+0x2d/0xd0
      [ 22.847238] *pdpt = 0000000000000000 *pde = 0000000000000000
      [ 22.847241] Oops: 0000 [#1] PREEMPT SMP
      [ 22.847244] Modules linked in:
      [ 22.847249] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 3.10.16-261140-g6533774 #1
      [ 22.847251] task: f3078000 ti: f3072000 task.ti: f3072000
      [ 22.847254] EIP: 0060:[<c1387fcd>] EFLAGS: 00010206 CPU: 0
      [ 22.847257] EIP is at sysfs_remove_group+0x2d/0xd0
      [ 22.847259] EAX: 00000004 EBX: 5f39746e ECX: 00000000 EDX: f2773560
      [ 22.847261] ESI: f2653b80 EDI: f2773560 EBP: f3073c90 ESP: f3073c70
      [ 22.847263] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
      [ 22.847264] CR0: 8005003b CR2: 5f39746e CR3: 020e5000 CR4: 001007f0
      [ 22.847266] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      [ 22.847268] DR6: ffff0ff0 DR7: 00000400
      [ 22.847269] Stack:
      [ 22.847276] c13848c9 c1ae3805 f3073c80 f24ddc4c 00000246 f2773e88 f1c44408 f2531340
      [ 22.847283] f3073ca0 c16935ca f1c44400 f27d3340 f3073cb4 c1693858 f24ddc44 f1c44400
      [ 22.847289] f1c4420c f3073cc8 c1693f76 f1c44400 00000001 00000000 f3073ce8 c1694011
      [ 22.847290] Call Trace:
      [ 22.847295] [<c13848c9>] ? sysfs_hash_and_remove+0x49/0xa0
      [ 22.847300] [<c1ae3805>] ? sub_preempt_count+0x55/0xe0
      [ 22.847306] [<c16935ca>] device_remove_groups+0x2a/0x40
      [ 22.847309] [<c1693858>] device_remove_attrs+0x38/0x60
      [ 22.847313] [<c1693f76>] device_del+0xd6/0x150
      [ 22.847316] [<c1694011>] device_unregister+0x21/0x60
      [ 22.847320] [<c13869e8>] ? sysfs_remove_link+0x18/0x30
      [ 22.847323] [<c1697d04>] ? class_compat_remove_link+0x34/0x50
      [ 22.847329] [<c18bf5d9>] extcon_dev_unregister+0xf9/0x130
      [ 22.847333] [<c18bd21f>] pwrsrc_extcon_dev_reg_callback+0x7f/0xa0
      [ 22.847337] [<c1ae36e3>] notifier_call_chain+0x43/0x60
      [ 22.847343] [<c12634e1>] __blocking_notifier_call_chain+0x41/0x80
      [ 22.847347] [<c126353f>] blocking_notifier_call_chain+0x1f/0x30
      [ 22.847351] [<c18bef39>] extcon_dev_notify_add_device+0x19/0x20
      [ 22.847354] [<c18bf074>] extcon_dev_register+0x134/0x580
      [ 22.847358] [<c1ae3805>] ? sub_preempt_count+0x55/0xe0
      [ 22.847363] [<c154b4da>] ? gpiod_request+0x6a/0x1d0
      [ 22.847368] [<c132528a>] ? kmem_cache_alloc_trace+0xaa/0x170
      [ 22.847372] [<c18c0179>] ? fsa9285_probe+0x99/0x3f0
      [ 22.847375] [<c18c00e0>] ? fsa9285_irq_handler+0xf0/0xf0
      [ 22.847379] [<c18c019f>] fsa9285_probe+0xbf/0x3f0
      [ 22.847383] [<c18c00e0>] ? fsa9285_irq_handler+0xf0/0xf0
      [ 22.847388] [<c1828d9e>] i2c_device_probe+0x7e/0xf0
      [ 22.847392] [<c1386e52>] ? sysfs_create_link+0x22/0x40
      [ 22.847395] [<c1696c62>] ? driver_sysfs_add+0x72/0xa0
      [ 22.847399] [<c1697119>] driver_probe_device+0x79/0x360
      [ 22.847403] [<c1697491>] __driver_attach+0x91/0xa0
      [ 22.847407] [<c1697400>] ? driver_probe_device+0x360/0x360
      [ 22.847410] [<c16955a2>] bus_for_each_dev+0x42/0x80
      [ 22.847414] [<c1696bee>] driver_attach+0x1e/0x20
      [ 22.847417] [<c1697400>] ? driver_probe_device+0x360/0x360
      [ 22.847420] [<c169675f>] bus_add_driver+0xef/0x270
      [ 22.847425] [<c1828e10>] ? i2c_device_probe+0xf0/0xf0
      [ 22.847428] [<c1828e10>] ? i2c_device_probe+0xf0/0xf0
      [ 22.847432] [<c1697a8a>] driver_register+0x6a/0x160
      [ 22.847436] [<c1addb3d>] ? mutex_unlock+0xd/0x10
      [ 22.847440] [<c1438ab2>] ? __create_file+0x122/0x2a0
      [ 22.847446] [<c20557d3>] ? extcon_class_init+0x15/0x15
      [ 22.847450] [<c1827cbb>] i2c_register_driver+0x2b/0xd0
      [ 22.847454] [<c1438d05>] ? debugfs_create_file+0x35/0x40
      [ 22.847458] [<c20557d3>] ? extcon_class_init+0x15/0x15
      [ 22.847461] [<c20557e4>] fsa9285_extcon_init+0x11/0x29
      [ 22.847465] [<c12001aa>] do_one_initcall+0xba/0x170
      [ 22.847471] [<c2012b4a>] kernel_init_freeable+0x119/0x1b8
      [ 22.847475] [<c20124d3>] ? do_early_param+0x7a/0x7a
      [ 22.847480] [<c1ac4090>] kernel_init+0x10/0xd0
      [ 22.847485] [<c1ae6cf7>] ret_from_kernel_thread+0x1b/0x28
      [ 22.847488] [<c1ac4080>] ? rest_init+0x80/0x80
      Tested-by: NLiu, Chuansheng <chuansheng.liu@intel.com>
      Reviewed-by: NLiu, Chuansheng <chuansheng.liu@intel.com>
      Signed-off-by: Nxiaoming wang <xiaoming.wang@intel.com>
      Signed-off-by: NZhang Dongxing <dongxing.zhang@intel.com>
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      7585ca0d