1. 04 2月, 2016 1 次提交
    • S
      usb: phy: msm: fix error handling in probe. · a38a08df
      Srinivas Kandagatla 提交于
      This driver registers for extcon events as part of its probe, but
      never unregisters them in case of error in the probe path.
      
      There were multiple issues noticed due to this missing error handling.
      One of them is random crashes if the regulators are not ready yet by the
      time probe is invoked.
      
      Ivan's previous attempt [1] to fix this issue, did not really address
      all the failure cases like regualtor/get_irq failures.
      
      [1] https://lkml.org/lkml/2015/9/7/62
      
      Without this patch the kernel would carsh with log:
      ...
      Unable to handle kernel paging request at virtual address 17d78410
      pgd = ffffffc001a5c000
      [17d78410] *pgd=00000000b6806003, *pud=00000000b6806003, *pmd=0000000000000000
      Internal error: Oops: 96000005 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 6 Comm: kworker/u8:0 Not tainted 4.4.0+ #48
      Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
      Workqueue: deferwq deferred_probe_work_func
      task: ffffffc03686e900 ti: ffffffc0368b0000 task.ti: ffffffc0368b0000
      PC is at raw_notifier_chain_register+0x1c/0x44
      LR is at extcon_register_notifier+0x88/0xc8
      pc : [<ffffffc0000da43c>] lr : [<ffffffc000606298>] pstate: 80000085
      sp : ffffffc0368b3a70
      x29: ffffffc0368b3a70 x28: ffffffc03680c310
      x27: ffffffc035518000 x26: ffffffc035518000
      x25: ffffffc03bfa20e0 x24: ffffffc035580a18
      x23: 0000000000000000 x22: ffffffc035518458
      x21: ffffffc0355e9a60 x20: ffffffc035518000
      x19: 0000000000000000 x18: 0000000000000028
      x17: 0000000000000003 x16: ffffffc0018153c8
      x15: 0000000000000001 x14: ffffffc03686f0f8
      x13: ffffffc03686f0f8 x12: 0000000000000003
      x11: 0000000000000001 x10: 0000000000000001
      x9 : ffffffc03686f0f8 x8 : 0000e3872014c1a1
      x7 : 0000000000000028 x6 : 0000000000000000
      x5 : 0000000000000001 x4 : 0000000000000000
      x3 : 00000000354fb170 x2 : 0000000017d78400
      x1 : ffffffc0355e9a60 x0 : ffffffc0354fb268
      
      Fixes: 	591fc116 ("usb: phy: msm: Use extcon framework for VBUS and ID detection")
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      a38a08df
  2. 17 12月, 2015 3 次提交
    • T
      usb: musb: core: Fix handling of the phy notifications · 8055555f
      Tony Lindgren 提交于
      We currently can't unload omap2430 MUSB platform glue driver module and
      this cause issues for fixing the MUSB code further. The reason we can't
      remove omap2430 is because it uses the PHY functions and also exports the
      omap_musb_mailbox function that some PHY drivers are using.
      
      Let's fix the issue by exporting a more generic musb_mailbox function
      from the MUSB core and allow platform glue layers to register phy_callback
      function as needed.
      
      And now we can now also get rid of the include/linux/musb-omap.h.
      
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: NeilBrown <neil@brown.name>
      Reviewed-by: NKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8055555f
    • B
      usb: phy: phy-am335x: bypass first VBUS sensing for host-only mode · 59f042f6
      Bin Liu 提交于
      To prevent VBUS contention, the am335x MUSB phy senses VBUS first before
      transitioning to host mode. However, for host-only mode, VBUS could be
      directly tied to 5V power rail which could prevent MUSB transitions to
      host mode.
      
      This change receives dr_mode of the controller then bypass the first
      VBUS sensing for host-only mode, so that MUSB can work in host mode
      event if VBUS is tied to 5V.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      59f042f6
    • B
      usb: phy: correct the am335x phy header filename · 5306661e
      Bin Liu 提交于
      The filename of am35x-phy-control.h is confusing. The header is used
      by the am335x phy driver, but the filename refers to am35x. Even worse
      there is indeed another device called am35x but it does not use this
      header at all.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      5306661e
  3. 15 12月, 2015 1 次提交
  4. 08 12月, 2015 1 次提交
  5. 20 11月, 2015 3 次提交
  6. 18 11月, 2015 1 次提交
  7. 17 11月, 2015 1 次提交
  8. 27 9月, 2015 2 次提交
  9. 22 9月, 2015 1 次提交
  10. 14 9月, 2015 2 次提交
    • R
      usb: phy: phy-generic: Fix reset behaviour on legacy boot · 762982db
      Roger Quadros 提交于
      The gpio-desc migration done in v4.0 caused a regression
      with legacy boots due to reversed reset logic.
      e.g. omap3-beagle USB host breaks on legacy boot.
      
      Request the reset GPIO with GPIOF_ACTIVE_LOW flag so that
      it matches the driver logic and pin behaviour.
      
      Fixes: e9f2cefb ("usb: phy: generic: migrate to gpio_desc")
      Cc: <stable@vger.kernel.org> # 4.0+
      Tested-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      762982db
    • R
      usb: phy: fix phy-qcom-8x16-usb build · 88ccdbd5
      Randy Dunlap 提交于
      Fix build errors that happen when USB_QCOM_8X16_PHY=y and EXTCON=m:
      
      drivers/built-in.o: In function `phy_8x16_init':
      phy-qcom-8x16-usb.c:(.text+0x86ef4): undefined reference to `extcon_get_cable_state'
      drivers/built-in.o: In function `phy_8x16_probe':
      phy-qcom-8x16-usb.c:(.text+0x870bf): undefined reference to `extcon_get_edev_by_phandle'
      phy-qcom-8x16-usb.c:(.text+0x87133): undefined reference to `extcon_register_interest'
      phy-qcom-8x16-usb.c:(.text+0x87151): undefined reference to `extcon_unregister_interest'
      drivers/built-in.o: In function `phy_8x16_remove':
      phy-qcom-8x16-usb.c:(.text+0x872ec): undefined reference to `extcon_unregister_interest'
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      88ccdbd5
  11. 06 8月, 2015 2 次提交
  12. 05 8月, 2015 2 次提交
  13. 31 7月, 2015 1 次提交
  14. 29 7月, 2015 5 次提交
  15. 07 7月, 2015 1 次提交
  16. 06 7月, 2015 1 次提交
  17. 13 6月, 2015 1 次提交
  18. 26 5月, 2015 3 次提交
  19. 22 5月, 2015 1 次提交
    • 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
  20. 10 5月, 2015 2 次提交
  21. 08 5月, 2015 2 次提交
  22. 29 4月, 2015 3 次提交