1. 23 Oct, 2017 1 commit
    • Chanwoo Choi's avatar
      extcon: Split out extcon header file for consumer and provider device · 176aa360
      Chanwoo Choi authored
      The extcon has two type of extcon devices as following.
      - 'extcon provider deivce' adds new extcon device and detect the
         state/properties of external connector. Also, it notifies the
         state/properties to the extcon consumer device.
      - 'extcon consumer device' gets the change state/properties
         from extcon provider device.
      Prior to that, include/linux/extcon.h contains all exported API for
      both provider and consumer device driver. To clarify the meaning of
      header file and to remove the wrong use-case on consumer device,
      this patch separates into extcon.h and extcon-provider.h.
      
      [Description for include/linux/{extcon.h|extcon-provider.h}]
      - extcon.h includes the extcon API and data structure for extcon consumer
        device driver. This header file contains the following APIs:
        : Register/unregister the notifier to catch the change of extcon device
        : Get the extcon device instance
        : Get the extcon device name
        : Get the state of each external connector
        : Get the property value of each external connector
        : Get the property capability of each external connector
      
      - extcon-provider.h includes the extcon API and data structure for extcon
        provider device driver. This header file contains the following APIs:
        : Include 'include/linux/extcon.h'
        : Allocate the memory for extcon device instance
        : Register/unregister extcon device
        : Set the state of each external connector
        : Set the property value of each external connector
        : Set the property capability of each external connector
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Acked-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
      Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Acked-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      176aa360
  2. 25 Aug, 2017 1 commit
  3. 09 Jan, 2017 1 commit
  4. 13 Sep, 2016 1 commit
  5. 25 Jan, 2016 1 commit
  6. 15 Dec, 2015 1 commit
  7. 15 Oct, 2015 1 commit
    • Chanwoo Choi's avatar
      extcon: Modify the id and name of external connector · 11eecf91
      Chanwoo Choi authored
      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: default avatarChanwoo Choi <cw00.choi@samsung.com>
      [ckeepax: For the Arizona changes]
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Reviewed-by: default avatarRoger Quadros <rogerq@ti.com>
      11eecf91
  8. 16 Jul, 2015 3 commits
  9. 13 Jun, 2015 1 commit
  10. 22 May, 2015 1 commit
    • Chanwoo Choi's avatar
      extcon: Use the unique id for external connector instead of string · 2a9de9c0
      Chanwoo Choi authored
      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: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Acked-by: default avatarRoger Quadros <rogerq@ti.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Acked-by: default avatarRamakrishna Pallala <ramakrishna.pallala@intel.com>
      Reviewed-by: default avatarKrzysztof 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: default avatarArnd Bergmann <arnd@arndb.de>
      [dan.carpenter: Report the build warning of extcon_{set|get}_cable_state_()]
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      2a9de9c0
  11. 19 May, 2015 4 commits
  12. 07 Mar, 2015 1 commit
  13. 24 Feb, 2015 2 commits
  14. 26 Jan, 2015 1 commit
  15. 24 Nov, 2014 1 commit
  16. 20 Oct, 2014 1 commit
  17. 22 Sep, 2014 2 commits
  18. 23 Jul, 2014 1 commit
  19. 17 Jun, 2014 2 commits
  20. 16 Jun, 2014 1 commit
  21. 29 Apr, 2014 1 commit
  22. 24 Apr, 2014 3 commits
    • Sangjung Woo's avatar
      extcon: max77693: Use devm_extcon_dev_register() · 10fae118
      Sangjung Woo authored
      Use the resource-managed extcon device register function (i.e.
      devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
      is attached with this function, that extcon device is automatically unregistered
      on driver detach. That reduces tiresome managing code.
      Signed-off-by: default avatarSangjung Woo <sangjung.woo@samsung.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      10fae118
    • Krzysztof Kozlowski's avatar
      extcon: max77693: Use power efficient workqueue for delayed cable detection · b8629411
      Krzysztof Kozlowski authored
      Schedule delayed cable detection work on power efficient workqueue
      so the scheduler won't wake up idle core for that work.
      This extends the idle time for CPU cores and conserves power.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      b8629411
    • Krzysztof Kozlowski's avatar
      extcon: max77693: Fix two NULL pointer exceptions on missing pdata · d5653f2b
      Krzysztof Kozlowski authored
      Fix NULL pointer exceptions when platform data is not supplied.
      
      Trace of one exception:
      Unable to handle kernel NULL pointer dereference at virtual address 00000008
      pgd = c0004000
      [00000008] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 2 PID: 1 Comm: swapper/0 Not tainted 3.14.0-12045-gead5dd4687a6-dirty #1628
      task: eea80000 ti: eea88000 task.ti: eea88000
      PC is at max77693_muic_probe+0x27c/0x528
      LR is at regmap_write+0x50/0x60
      pc : [<c041d1c8>]    lr : [<c02eba60>]    psr: 20000113
      sp : eea89e38  ip : 00000000  fp : c098a834
      r10: ee1a5a10  r9 : 00000005  r8 : c098a83c
      r7 : 0000000a  r6 : c098a774  r5 : 00000005  r4 : eeb006d0
      r3 : c0697bd8  r2 : 00000000  r1 : 00000001  r0 : 00000000
      Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 4000404a  DAC: 00000015
      Process swapper/0 (pid: 1, stack limit = 0xeea88240)
      Stack: (0xeea89e38 to 0xeea8a000)
      9e20:                                                       c08499fc eeb006d0
      9e40: 00000000 00000000 c0915f98 00000001 00000000 ee1a5a10 c098a730 c09a88b8
      9e60: 00000000 c098a730 c0915f98 00000000 00000000 c02d6aa0 c02d6a88 ee1a5a10
      9e80: c0a712c8 c02d54e4 00001204 c0628b00 ee1a5a10 c098a730 ee1a5a44 00000000
      9ea0: eea88000 c02d57b4 00000000 c098a730 c02d5728 c02d3a24 ee813e5c eeb9d534
      9ec0: c098a730 ee22f700 c097c720 c02d4b14 c08174ec c098a730 00000006 c098a730
      9ee0: 00000006 c092fd30 c09b8500 c02d5df8 00000000 c093cbb8 00000006 c0008928
      9f00: 000000c3 ef7fc785 00000000 ef7fc794 00000000 c08af968 00000072 eea89f30
      9f20: ef7fc85e c065f198 000000c3 c003e87c 00000003 00000000 c092fd3c 00000000
      9f40: c08af618 c0826d58 00000006 00000006 c0956f58 c093cbb8 00000006 c092fd30
      9f60: c09b8500 000000c3 c092fd3c c08e8510 00000000 c08e8bb0 00000006 00000006
      9f80: c08e8510 c0c0c0c0 00000000 c0628fac 00000000 00000000 00000000 00000000
      9fa0: 00000000 c0628fb4 00000000 c000f038 00000000 00000000 00000000 00000000
      9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 c0c0c0c0 c0c0c0c0
      [<c041d1c8>] (max77693_muic_probe) from [<c02d6aa0>] (platform_drv_probe+0x18/0x48)
      [<c02d6aa0>] (platform_drv_probe) from [<c02d54e4>] (driver_probe_device+0x140/0x384)
      [<c02d54e4>] (driver_probe_device) from [<c02d57b4>] (__driver_attach+0x8c/0x90)
      [<c02d57b4>] (__driver_attach) from [<c02d3a24>] (bus_for_each_dev+0x54/0x88)
      [<c02d3a24>] (bus_for_each_dev) from [<c02d4b14>] (bus_add_driver+0xe8/0x204)
      [<c02d4b14>] (bus_add_driver) from [<c02d5df8>] (driver_register+0x78/0xf4)
      [<c02d5df8>] (driver_register) from [<c0008928>] (do_one_initcall+0xc4/0x174)
      [<c0008928>] (do_one_initcall) from [<c08e8bb0>] (kernel_init_freeable+0xfc/0x1c8)
      [<c08e8bb0>] (kernel_init_freeable) from [<c0628fb4>] (kernel_init+0x8/0xec)
      [<c0628fb4>] (kernel_init) from [<c000f038>] (ret_from_fork+0x14/0x3c)
      Code: caffffe7 e59d200c e3550001 b3a05001 (e5923008)
      ---[ end trace 85db969ce011bde7 ]---
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Cc: <stable@vger.kernel.org>
      Fixes: 190d7cfcSigned-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      d5653f2b
  23. 27 Sep, 2013 2 commits
  24. 26 Sep, 2013 1 commit
  25. 08 Apr, 2013 2 commits
  26. 13 Mar, 2013 2 commits
  27. 13 Feb, 2013 1 commit