掌機 - Pandora(1GHz) - Debian(Mark2) - 解決USBHostTrigger問題



當使用者使用pdcmd開啓USBHost模式後,會發現無法再度使用pdcmd關閉USBHost,這是因為pdcmd script在判斷ehci-hcd時,誤將ehci_hcd寫成ehci-hcd,使用者可以使用如下方式修復:

$ sudo vim /usr/sbin/pdcmd
    USBHostTrigger(){
      if [ -z "$(lsmod | grep ehci_hcd)" ]; then
        msg "USB Host" "Start"
        modprobe ehci-hcd
      else
        msg "USB Host" "Stop"
        rmmod ehci-hcd
      fi
    }

Enable USBHost

$ sudo pdcmd USBHostTrigger
$ sudo dmesg -c
    [ 3706.670959] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 3707.675842] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
    [ 3707.682373] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
    [ 3707.687225] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
    [ 3707.699645] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
    [ 3707.699981] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 3707.700103] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 3707.700317] usb usb1: Product: OMAP-EHCI Host Controller
    [ 3707.700531] usb usb1: Manufacturer: Linux 3.2.45 ehci_hcd
    [ 3707.700653] usb usb1: SerialNumber: ehci-omap.0
    [ 3707.707794] hub 1-0:1.0: USB hub found
    [ 3707.708038] hub 1-0:1.0: 3 ports detected

Disable USBHost

$ sudo pdcmd USBHostTrigger
$ sudo dmesg -c
    [ 3725.640502] ehci-omap ehci-omap.0: remove, state 4
    [ 3725.640747] usb usb1: USB disconnect, device number 1
    [ 3725.643341] ehci-omap ehci-omap.0: USB bus 1 deregistered