1. 24 Jan, 2016 1 commit
  2. 14 Dec, 2015 1 commit
  3. 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
  4. 16 Jul, 2015 3 commits
  5. 12 Jun, 2015 1 commit
  6. 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
  7. 19 May, 2015 4 commits
  8. 07 Mar, 2015 1 commit
  9. 23 Feb, 2015 2 commits
  10. 25 Jan, 2015 1 commit
  11. 24 Nov, 2014 1 commit
  12. 20 Oct, 2014 1 commit
  13. 22 Sep, 2014 2 commits
  14. 22 Jul, 2014 1 commit
  15. 17 Jun, 2014 2 commits
  16. 15 Jun, 2014 1 commit
  17. 28 Apr, 2014 1 commit
  18. 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
  19. 26 Sep, 2013 3 commits
  20. 08 Apr, 2013 2 commits
  21. 13 Mar, 2013 2 commits
  22. 13 Feb, 2013 3 commits
  23. 14 Jan, 2013 2 commits
    • Chanwoo Choi's avatar
      extcon: max77693: Add support Dock-Smart device for desktop mode · a1626298
      Chanwoo Choi authored
      This patch support the detection of Dock-Smart device which include
      three type of port(HDMI, USB for mouse/keyboard and Micro-USB for
      USB/TA cable).The Dock-Smart device need always exteranl power supply
      (USB/TA cable through micro-usb cable). Dock-Smart device support screen
      output of target to separate monitor and mouse/keyboard for desktop
      mode.
      
      Features of 'Dock-Smart device'
      - Support HDMI
      - Support external output feature of audio
      - Support charging through micro-usb port without data
        connection if TA cable is connected to target.
      - Support charging and data connection through micro-usb port
        if USB cable is connected between target and host device.
      - Support OTG device (Mouse/Keyboard)
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarMyungjoo Ham <myungjoo.ham@samsung.com>
      a1626298
    • Chanwoo Choi's avatar
      extcon: max77693: Fix bug when detecting MHL/Dock-Audio with USB/TA cable · 0e2738f5
      Chanwoo Choi authored
      This patch fix bug that muic couldn't detect MHL/Dock-Audio with USB/TA
      cable on exception situation. I explain detail case on following:
      
      When MHL(with USB/TA cable) or Dock-Audio with USB/TA cable is attached,
      the MUIC device happen following two interrupt.
      - 'MAX77693_MUIC_IRQ_INT1_ADC' for detecting MHL/Dock-Audio.
      - 'MAX77693_MUIC_IRQ_INT2_CHGTYP' for detecting USB/TA cable connected to
      MHL/Dock-Audio. Always, happen eariler MAX77693_MUIC_IRQ_INT1_ADC interrupt
      than MAX77693_MUIC_IRQ_INT2_CHGTYP interrupt.
      
      If user attach MHL with USB/TA cable and immediately detach MHL with USB/TA
      cable before MAX77693_MUIC_IRQ_INT2_CHGTYP interrupt is happened, USB/TA
      connected to MHL cable remain connected state to target. But USB/TA connected
      to MHL cable isn't connected to target. user be faced with unusual action.
      So, driver should check this situation in spite of that, previous charger type
      is N/A.
      Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: default avatarMyungjoo Ham <myungjoo.ham@samsung.com>
      0e2738f5