Skip to content
  1. Mar 01, 2011
    • Hema HK's avatar
      usb: musb: Idle path retention and offmode support for OMAP3 · 7acc6197
      Hema HK authored
      
      
      This patch supports the retention and offmode support in the idle path for
      musb driver using runtime pm APIs.
      
      This is restricted to support offmode and retention only when device not
      connected.When device/cable connected with gadget driver loaded,configured
      to no idle/standby which will not allow the core transition to retention
      or off.
      
      There is no context save/restore done by hardware for musb in OMAP3
      and OMAP4,driver has to take care of saving and restoring the context
      during offmode.
      
      Musb has a requirement of configuring sysconfig register to force
      idle/standby mode and set the ENFORCE bit in module STANDBY register
      for retention and offmode support.
      
      Runtime pm and hwmod frameworks will take care of configuring to force
      idle/standby when pm_runtime_put_sync is called and back to no
      idle/standby when pm_runeime_get_sync is called.
      
      Compile, boot tested and also tested the retention in the idle path on
      OMAP3630Zoom3. And tested the global suspend/resume with offmode enabled.
      Usb basic functionality tested on OMAP4430SDP.
      
      There is some problem with idle path offmode in mainline, I could not test
      with offmode. But I have tested this patch with resetting the controller
      in the idle path when wakeup from retention just to make sure that the
      context is lost, and restore path is working fine.
      
      Removed .suspend/.resume fnction pointers and functions because there
      is no need of having these functions as all required work is done
      at runtime in the driver.
      
      There is no need to call the runtime pm api with glue driver device
      as glue layer device is the parent of musb core device, when runtime apis
      are called for the child, parent device runtime functionality
      will be invoked.
      
      Design overview:
      
      pm_runtime_get_sync: When called with musb core device takes care of
      enabling the clock, calling runtime callback function of omap2430 glue
      layer, runtime call back of musb driver and configure the musb sysconfig
      to no idle/standby
      
      pm_runtime_put: Takes care of calling runtime callback function of omap2430
      glue layer, runtime call back of musb driver, Configure the musb sysconfig
      to force idle/standby and disable the clock.
      
      During musb driver load: Call pm_runtime_get_sync.
      
      End of musb driver load: Call pm_runtime_put
      
      During gadget driver load: Call pm_runtime_get_sync,
      End of gadget driver load: Call pm_runtime_put if there is no device
      or cable is connected.
      
      During unload of the gadget driver:Call pm_runtime_get_sync if cable/device
      is not connected.
      End of the gadget driver unload : pm_runtime_put
      
      During unload of musb driver : Call pm_runtime_get_sync
      End of unload: Call pm_runtime_put
      
      On connect of usb cable/device -> transceiver notification(VBUS and ID-GND):
      pm_runtime_get_sync only if the gadget driver loaded.
      
      On disconnect of the cable/device -> Disconnect Notification:
      pm_runtime_put if the gadget driver is loaded.
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7acc6197
    • Hema HK's avatar
      usb: musb: Remove platform context save/restore API · da68ccec
      Hema HK authored
      
      
      For OMAP3 and OMAP4 for offmode and retention support, musb
      sysconfig is configured to force idle and standby with ENABLE_FORCE bit
      of OTG_FORCESTNDBY set.
      And on wakeup configure to no ilde/standby with resetting the ENABLE_FORCE
      bit. There is not need to save and restore of this register anymore
      so removed omap2430_save_context/omap2430_restore_context functions.
      and also removed otg_forcestandby member of musb_context_registers
      structure
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      da68ccec
    • Felipe Balbi's avatar
      usb: musb: gadget: fix list_head usage · 4cbbf084
      Felipe Balbi authored
      
      
      commit ad1adb89
      (usb: musb: gadget: do not poke with gadget's list_head)
      fixed a bug in musb where it was corrupting the list_head
      which is supposed to be used by gadget drivers. While
      doing that, I forgot to fix the usage in musb_gadget_dequeue()
      method. Fix that.
      
      Reported-by: default avatarPavol Kurina <pavol.kurina@emsys.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      4cbbf084
  2. Feb 21, 2011
  3. Feb 18, 2011
    • Hema HK's avatar
      usb: musb: OMAP4430: Fix usb device detection if connected during boot · 002eda13
      Hema HK authored
      OMAP4430 is embedded with UTMI PHY. This PHY does not support the
      OTG features like ID pin detection and VBUS detection. This function
      is exported to an external companion chip TWL6030. Software must retrieve
      the OTG HNP and SRP status from the TWL6030 and configure the bits inside
      the control module that drive the related USBOTGHS UTMI interface signals.
      It must also read back the UTMI signals needed to configure the TWL6030
      OTG module.
      
      Can find more details in the TRM[1].
      [1]:http://focus.ti.com/pdfs/wtbu/OMAP4430_ES2.0_Public_TRM_vJ.pdf
      
      
      
      In OMAP4430 musb driver VBUS and ID notifications are received from the
      transceiver driver. If the cable/device is connected during boot,
      notifications from transceiver driver will be missed till musb driver
      is loaded.
      Patch to configure the transceiver in the platform_enable/disable
      functions and enable the vbus in the gadget driver based on the
      last_event of the otg_transceiver.
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      002eda13
  4. Feb 17, 2011
    • Hema HK's avatar
      usb: musb: Using runtime pm APIs for musb. · 207b0e1f
      Hema HK authored
      
      
      Calling runtime pm APIs pm_runtime_put_sync() and pm_runtime_get_sync()
      for enabling/disabling the clocks, sysconfig settings.
      
      Enable clock, configure no-idle/standby when active and configure force idle/standby
      and disable clock when idled. This is taken care by the runtime framework when
      driver calls the pm_runtime_get_sync and pm_runtime_put_sync APIs.
      Need to configure MUSB into force standby and force idle mode when usb not used
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Cousson, Benoit <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      207b0e1f
    • Felipe Balbi's avatar
      usb: musb: gadget: do not poke with gadget's list_head · ad1adb89
      Felipe Balbi authored
      
      
      struct usb_request's list_head is supposed to be
      used only by gadget drivers, but musb is abusing
      that. Give struct musb_request its own list_head
      and prevent musb from poking into other driver's
      business.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      ad1adb89
    • Felipe Balbi's avatar
      usb: musb: gadget: beautify usb_gadget_probe_driver()/usb_gadget_unregister_driver · 63eed2b5
      Felipe Balbi authored
      
      
      Just a few cosmetic fixes to usb_gadget_probe_driver()
      and usb_gadget_unregister_driver().
      
      Decreased a few indentation levels with goto statements.
      
      While at that, also add the missing call to musb_stop().
      If we don't have OTG, there's no point of leaving
      MUSB prepared for operation if a gadget driver fails
      to probe. The same is valid for usb_gadget_unregister_driver(),
      since we are removing the gadget driver and we don't have
      OTG, we can completely unconfigure MUSB.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      63eed2b5
    • Felipe Balbi's avatar
      usb: musb: do not error out if Kconfig doesn't match board mode · 75a14b14
      Felipe Balbi authored
      
      
      During development, even though board is wired
      to e.g. OTG, we might want to compile host-only
      or peripheral-only configurations.
      
      Let's allow that to happen.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      75a14b14
  5. Feb 04, 2011
  6. Feb 01, 2011
    • Mian Yousaf Kaukab's avatar
      usb: musb: introduce api for dma code to check compatibility with usb request · 5f5761cb
      Mian Yousaf Kaukab authored
      
      
      Gadget MUSB driver handles dma mappings in musb_gadget_queue(). Where as it is
      possible for  dma code to reject the usb request later at ->channel_program()
      called from txstate()/rxstate()
      
      For example ->channel_program in tusb6010_omap.c:
      
      static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
              u8 rndis_mode, dma_addr_t dma_addr, u32 len)
      {
      ...
      	if (unlikely(dma_addr & 0x1) || (len < 32) || (len > packet_sz))
      		return false;
      ...
      	if (dma_addr & 0x2)
      		return false;
      ...
      }
      
      In this case, usb request will be handled in PIO mode which renders dma mapping
      operations unnecessary.
      
      This patch adds an api to allow dma code to indicate incompatibility with usb
      request. Gadget musb driver call this api, if available, before dma mappings to
      avoid any unnecessary mapping operations.
      
      Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5f5761cb
    • Mian Yousaf Kaukab's avatar
      usb: musb: maintain three states for buffer mappings instead of two · c65bfa62
      Mian Yousaf Kaukab authored
      
      
      If dma buffers are mapped by a higher layer, with a boolean musb_request.mapped
      it is still possible to call dma_sync_single_for_device() from
      musb_g_giveback(), even if txstate()/rxstate() has called unmap_dma_buffer()
      before falling back to pio mode.
      
      Moreover, check for musb_ep->dma is moved within map_dma_buffer() so where
      applicable checks for it are removed. And where possible, checks for
      is_dma_capable() are merged with buffer map state check.
      
      Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c65bfa62
    • Felipe Balbi's avatar
      usb: musb: disable double buffering when it's broken · 06624818
      Felipe Balbi authored
      
      
      We know that blackfin doesn't support double
      buffering feature as of today. So we add a
      flag set by musb_platform_init() to forcefully
      disable that feature.
      
      Such flag is created and marked as deprecated
      to force us to find a solution for the missing
      double buffering support on blackfin.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      06624818
    • Bob Liu's avatar
      usb: musb: hsdma: change back to use musb_read/writew · 9c668079
      Bob Liu authored
      
      
      Blackfin platform doesn't support 32bits musbdma registers, so change back to
      use musb_read/writew instead of musb_read/writel and simply some format casts.
      
      Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      9c668079
    • Sergei Shtylyov's avatar
      usb: musb: core: fix IRQ check · 541079de
      Sergei Shtylyov authored
      
      
      musb_probe() only regards 0 as a wrong IRQ number, despite platform_get_irq()
      that it calls returns -ENXIO in that case. It leads to musb_init_controller()
      calling request_irq() with a negative IRQ number, and when it naturally
      fails, the following is printed to the console:
      
      request_irq -6 failed!
      musb_init_controller failed with status -19
      
      Fix musb_probe() to filter out the error values as well as 0.
      
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      541079de
    • Ming Lei's avatar
      usb: musb: fix kernel panic during s2ram(v2) · 456bb169
      Ming Lei authored
      
      
      This patch fixes kernel panic during s2ram, which is caused
      by the below:
      
      	- musb is not put into drv data of musb platform device if
      	CONFIG_USB_MUSB_HDRC_HCD is defined
      
      	- glue layer driver always get musb instance via platform_get_drvdata.
      
      The patch fixes the issue by always puting musb into drv data
      of musb platform device, which is doable even the platform device
      is a host controller device.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Sergei Shtylyov <sshtylyov@mvista.com>
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      456bb169
  7. Jan 10, 2011
  8. Dec 16, 2010
  9. Dec 11, 2010
  10. Dec 10, 2010
Loading