1. 03 Jul, 2013 1 commit
  2. 17 Jun, 2013 2 commits
  3. 21 Nov, 2012 1 commit
  4. 23 Oct, 2012 6 commits
    • Jenny TC's avatar
      extcon : register for cable interest by cable name · 4f2de3bf
      Jenny TC authored
      There are some scnearios where a driver/framework needs to register
      interest for a particular cable without specifying the extcon device
      name. One such scenario is charger notifications. The platform will
      have charger cabel which will be bound to any extcon device. It's
      not mandatory for the charger driver to know which extcon device
      it should use. This patch enables the support for registering
      interest for a cable just by cable name wihtout specifying the
      extcon device name
      Signed-off-by: default avatarJenny TC <jenny.tc@intel.com>
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Tested-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      
      --
      Kernel-doc comment added by MyungJoo Ham
      4f2de3bf
    • anish kumar's avatar
      extcon: driver model release call not needed · 57e7cd37
      anish kumar authored
      There was a case where free and list_del can be called twice
      on the same pointer.So fixed it by re-arranging the code and
      removing a function which was not needed.
      Signed-off-by: default avataranish kumar <anish198519851985@gmail.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      57e7cd37
    • Axel Lin's avatar
    • Sachin Kamat's avatar
      extcon: Fix return value in extcon_register_interest() · 5cd3c277
      Sachin Kamat authored
      Propagate the value returned from extcon_find_cable_index()
      instead of -ENODEV. For readability, -EINVAL is returned in place of
      the variable.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      5cd3c277
    • Peter Huewe's avatar
      extcon: unregister compat link on cleanup · 824a1bc0
      Peter Huewe authored
      Since extcon registers this compat link at device registration
      (extcon_dev_register), we should probably remove them at deregistration/cleanup.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      824a1bc0
    • Peter Huewe's avatar
      extcon: Unregister compat class at module unload to fix oops · 0dc77b6d
      Peter Huewe authored
      If you compile extcon with CONFIG_ANDROID and then load and unload the
      module you get a simple oops as the driver does not unregister its
      compat class and thus cannot register it again.
      
      Full trace:
      
      root@(none):~# modprobe extcon_class
      root@(none):~# rmmod extcon_class
      root@(none):~# modprobe extcon_class
      ------------[ cut here ]------------
      WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xde/0x100()
      sysfs: cannot create duplicate filename '/class/switch'
      Modules linked in: extcon_class(+) [last unloaded: extcon_class]
      Call Trace:
      9f451a00:  [<602a58bc>] printk+0x0/0xa8
      9f451a18:  [<60039b43>] warn_slowpath_common+0x93/0xd0
      9f451a28:  [<6012c6de>] sysfs_add_one+0xde/0x100
      9f451a50:  [<601d3d90>] strcat+0x0/0x40
      9f451a68:  [<60039cdc>] warn_slowpath_fmt+0x9c/0xa0
      9f451a90:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451ab0:  [<60039c40>] warn_slowpath_fmt+0x0/0xa0
      9f451ac0:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451ae8:  [<6012bd97>] sysfs_pathname.isra.10+0x57/0x70
      9f451b00:  [<601d3d90>] strcat+0x0/0x40
      9f451b18:  [<6012bd97>] sysfs_pathname.isra.10+0x57/0x70
      9f451b48:  [<6012c6de>] sysfs_add_one+0xde/0x100
      9f451b78:  [<6012c96f>] create_dir+0x8f/0x100
      9f451bc0:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451bd8:  [<6012cda6>] sysfs_create_dir+0xa6/0x1c0
      9f451be8:  [<601d89f1>] kvasprintf+0x81/0xa0
      9f451bf8:  [<601cf0f0>] kobject_get+0x0/0x50
      9f451c18:  [<601cf396>] kobject_add_internal+0x96/0x280
      9f451c60:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451c78:  [<601cfb93>] kobject_add+0xd3/0x140
      9f451cc0:  [<601cfac0>] kobject_add+0x0/0x140
      9f451cd0:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451cf8:  [<6002fffc>] set_signals+0x29/0x3f
      9f451d28:  [<600c1de1>] kmem_cache_alloc+0xe1/0x100
      9f451d78:  [<601cffa0>] kobject_create_and_add+0x50/0xa0
      9f451da8:  [<601fbe76>] class_compat_register+0x56/0x80
      9f451dc8:  [<a085d118>] create_extcon_class+0x88/0xd0 [extcon_class]
      9f451de8:  [<a0861010>] extcon_class_init+0x10/0x12 [extcon_class]
      9f451df8:  [<600189a8>] do_one_initcall+0x48/0x1f0
      9f451e20:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e30:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e58:  [<6007e3c3>] sys_init_module+0xa3/0x280
      9f451e88:  [<6001e2ad>] handle_syscall+0x8d/0x90
      9f451ea8:  [<60033370>] userspace+0x405/0x531
      9f451ee8:  [<6001e380>] copy_chunk_to_user+0x0/0x40
      9f451ef8:  [<6001e5cd>] do_op_one_page+0x14d/0x220
      9f451fd8:  [<6001a355>] fork_handler+0x95/0xa0
      
      ---[ end trace dd512cc03fe1c367 ]---
      ------------[ cut here ]------------
      WARNING: at lib/kobject.c:196 kobject_add_internal+0x26e/0x280()
      kobject_add_internal failed for switch with -EEXIST, don't try to
      register things with the same name in the same directory.
      Modules linked in: extcon_class(+) [last unloaded: extcon_class]
      Call Trace:
      9f451ad0:  [<602a58bc>] printk+0x0/0xa8
      9f451ae8:  [<60039b43>] warn_slowpath_common+0x93/0xd0
      9f451af8:  [<601cf56e>] kobject_add_internal+0x26e/0x280
      9f451b18:  [<601cf140>] kobject_put+0x0/0x70
      9f451b20:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451b38:  [<60039cdc>] warn_slowpath_fmt+0x9c/0xa0
      9f451b88:  [<60039c40>] warn_slowpath_fmt+0x0/0xa0
      9f451bc0:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451bd8:  [<6012cda6>] sysfs_create_dir+0xa6/0x1c0
      9f451be8:  [<601d89f1>] kvasprintf+0x81/0xa0
      9f451bf8:  [<601cf0f0>] kobject_get+0x0/0x50
      9f451c18:  [<601cf56e>] kobject_add_internal+0x26e/0x280
      9f451c60:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451c78:  [<601cfb93>] kobject_add+0xd3/0x140
      9f451cc0:  [<601cfac0>] kobject_add+0x0/0x140
      9f451cd0:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451cf8:  [<6002fffc>] set_signals+0x29/0x3f
      9f451d28:  [<600c1de1>] kmem_cache_alloc+0xe1/0x100
      9f451d78:  [<601cffa0>] kobject_create_and_add+0x50/0xa0
      9f451da8:  [<601fbe76>] class_compat_register+0x56/0x80
      9f451dc8:  [<a085d118>] create_extcon_class+0x88/0xd0 [extcon_class]
      9f451de8:  [<a0861010>] extcon_class_init+0x10/0x12 [extcon_class]
      9f451df8:  [<600189a8>] do_one_initcall+0x48/0x1f0
      9f451e20:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e30:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e58:  [<6007e3c3>] sys_init_module+0xa3/0x280
      9f451e88:  [<6001e2ad>] handle_syscall+0x8d/0x90
      9f451ea8:  [<60033370>] userspace+0x405/0x531
      9f451ee8:  [<6001e380>] copy_chunk_to_user+0x0/0x40
      9f451ef8:  [<6001e5cd>] do_op_one_page+0x14d/0x220
      9f451fd8:  [<6001a355>] fork_handler+0x95/0xa0
      
      ---[ end trace dd512cc03fe1c368 ]---
      kobject_create_and_add: kobject_add error: -17
      ------------[ cut here ]------------
      WARNING: at drivers/extcon/extcon_class.c:545
      create_extcon_class+0xbc/0xd0 [extcon_class]()
      cannot allocate
      Modules linked in: extcon_class(+) [last unloaded: extcon_class]
      Call Trace:
      9f451c80:  [<602a58bc>] printk+0x0/0xa8
      9f451c98:  [<60039b43>] warn_slowpath_common+0x93/0xd0
      9f451ca0:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451ca8:  [<a085d14c>] create_extcon_class+0xbc/0xd0 [extcon_class]
      9f451cd0:  [<a0861000>] extcon_class_init+0x0/0x12 [extcon_class]
      9f451ce8:  [<60039cdc>] warn_slowpath_fmt+0x9c/0xa0
      9f451d20:  [<6002fe32>] unblock_signals+0x0/0x84
      9f451d28:  [<60039c40>] warn_slowpath_fmt+0x0/0xa0
      9f451d48:  [<6002fffc>] set_signals+0x29/0x3f
      9f451d58:  [<601cf172>] kobject_put+0x32/0x70
      9f451d78:  [<600c22c3>] kfree+0xb3/0x100
      9f451da8:  [<601fbe9a>] class_compat_register+0x7a/0x80
      9f451dc8:  [<a085d14c>] create_extcon_class+0xbc/0xd0 [extcon_class]
      9f451de8:  [<a0861010>] extcon_class_init+0x10/0x12 [extcon_class]
      9f451df8:  [<600189a8>] do_one_initcall+0x48/0x1f0
      9f451e20:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e30:  [<60061920>] blocking_notifier_call_chain+0x0/0x20
      9f451e58:  [<6007e3c3>] sys_init_module+0xa3/0x280
      9f451e88:  [<6001e2ad>] handle_syscall+0x8d/0x90
      9f451ea8:  [<60033370>] userspace+0x405/0x531
      9f451ee8:  [<6001e380>] copy_chunk_to_user+0x0/0x40
      9f451ef8:  [<6001e5cd>] do_op_one_page+0x14d/0x220
      9f451fd8:  [<6001a355>] fork_handler+0x95/0xa0
      
      ---[ end trace dd512cc03fe1c369 ]---
      FATAL: Error inserting extcon_class
      (/lib/modules/3.6.0-rc6-00178-g811315f/kernel/drivers/extcon/extcon_class.ko):
      Cannot allocate memory
      
      This patch fixes this.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      0dc77b6d
  5. 21 Oct, 2012 2 commits
  6. 05 Sep, 2012 1 commit
  7. 16 Aug, 2012 2 commits
  8. 14 Jun, 2012 2 commits
  9. 04 May, 2012 1 commit
  10. 29 Apr, 2012 1 commit
  11. 25 Apr, 2012 1 commit
  12. 23 Apr, 2012 1 commit
  13. 20 Apr, 2012 4 commits
    • MyungJoo Ham's avatar
      Extcon: support mutually exclusive relation between cables. · bde68e60
      MyungJoo Ham authored
      There could be cables that t recannot be attaches simulatenously. Extcon
      device drivers may express such information via mutually_exclusive in
      struct extcon_dev.
      
      For example, for an extcon device with 16 cables (bits 0 to 15 are
      available), if mutually_exclusive = { 0x7, 0xC0, 0x81, 0 }, then, the
      following attachments are prohibitted.
      {0, 1}
      {0, 2}
      {1, 2}
      {6, 7}
      {0, 7}
      and every attachment set that are superset of one of the above.
      For the detail, please refer to linux/include/linux/extcon.h.
      
      The concept is suggested by NeilBrown <neilb@suse.de>
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      
      --
      Changes from V5:
      - Updated sysfs format
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bde68e60
    • MyungJoo Ham's avatar
      Extcon: support multiple states at a device. · 806d9dd7
      MyungJoo Ham authored
      One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
      devices) may have multiple cables attached. For example, one
      30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
      Thus, one switch device requires multiple state bits each representing
      a type of cable.
      
      For such purpose, we use the 32bit state variable; thus, up to 32
      different type of cables may be defined for a switch device. The list of
      possible cables is defined by the array of cable names in the switch_dev
      struct given to the class.
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      
      --
      Changes from V7
      - Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
      - Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
      
      Changes from V5
      - Sysfs style reformed: subdirectory per cable.
      - Updated standard cable names
      - Removed unnecessary printf
      - Bugfixes after testing
      
      Changes from V4
      - Bugfixes after more testing at Exynos4412 boards with userspace
        processses.
      
      Changes from V3
      - Bugfixes after more testing at Exynos4412 boards.
      
      Changes from V2
      - State can be stored by user
      - Documentation updated
      
      Changes from RFC
      - Switch is renamed to extcon
      - Added kerneldoc comments
      - Added APIs to support "standard" cable names
      - Added helper APIs to support notifier block registration with cable
        name.
      - Regrouped function list in the header file.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      806d9dd7
    • Donggeun Kim's avatar
      Extcon: support notification based on the state changes. · 74c5d09b
      Donggeun Kim authored
      State changes of extcon devices have been notified via kobjet_uevent.
      This patch adds notifier interfaces in order to allow device drivers to
      get notified easily. Along with notifier interface,
      extcon_get_extcon_dev() function is added so that device drivers may
      discover a extcon_dev easily.
      Signed-off-by: default avatarDonggeun Kim <dg77.kim@samsung.com>
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      
      --
      Changes from RFC
      - Renamed switch to extcon
      - Bugfix: extcon_dev_unregister()
      - Bugfix: "edev->dev" is "internal" data.
      - Added kerneldoc comments.
      - Reworded comments.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      74c5d09b
    • MyungJoo Ham's avatar
      Extcon (external connector): import Android's switch class and modify. · de55d871
      MyungJoo Ham authored
      External connector class (extcon) is based on and an extension of
      Android kernel's switch class located at linux/drivers/switch/.
      
      This patch provides the before-extension switch class moved to the
      location where the extcon will be located (linux/drivers/extcon/) and
      updates to handle class properly.
      
      The before-extension class, switch class of Android kernel, commits
      imported are:
      
      switch: switch class and GPIO drivers. (splitted)
      Author: Mike Lockwood <lockwood@android.com>
      
      switch: Use device_create instead of device_create_drvdata.
      Author: Arve Hjønnevåg <arve@android.com>
      
      In this patch, upon the commits of Android kernel, we have added:
      - Relocated and renamed for extcon.
      - Comments, module name, and author information are updated
      - Code clean for successing patches
      - Bugfix: enabling write access without write functions
      - Class/device/sysfs create/remove handling
      - Added comments about uevents
      - Format changes for extcon_dev_register() to have a parent dev.
      Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      
      --
      Changes from v7
      - Compiler error fixed when it is compiled as a module.
      - Removed out-of-date Kconfig entry
      
      Changes from v6
      - Updated comment/strings
      - Revised "Android-compatible" mode.
         * Automatically activated if CONFIG_ANDROID && !CONFIG_ANDROID_SWITCH
         * Creates /sys/class/switch/*, which is a copy of /sys/class/extcon/*
      
      Changes from v5
      - Split the patch
      - Style fixes
      - "Android-compatible" mode is enabled by Kconfig option.
      
      Changes from v2
      - Updated name_show
      - Sysfs entries are handled by class itself.
      - Updated the method to add/remove devices for the class
      - Comments on uevent send
      - Able to become a module
      - Compatible with Android platform
      
      Changes from RFC
      - Renamed to extcon (external connector) from multistate switch
      - Added a seperated directory (drivers/extcon)
      - Added kerneldoc comments
      - Removed unused variables from extcon_gpio.c
      - Added ABI Documentation.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      de55d871