[HTC Desire S] engelmarkus:
Finally, I did it! :victory: ... At least partially.

<6>[ 1117.578247] [USB] msm_otg_mode_write: host
<6>[ 1117.578735] [USBH] msm_otg_sm_work: state:b_peripheral bit:0x00000002
<6>[ 1117.579437] [USB] OTG_STATE_B_PERIPHERAL state
<6>[ 1117.579833] [USBH] send connect type 0
<6>[ 1117.580169] [TP]cable change to 0
<6>[ 1117.582244] [TP]ts->status change to 0
<7>[ 1117.582702] [USBH] gadget off
<6>[ 1117.583679] [USBH] msm_otg_sm_work: state:b_idle bit:0x00000002
<6>[ 1117.584350] [USB] OTG_STATE_B_IDLE state
<6>[ 1117.584716] [USBH] !id || id_a
<7>[ 1117.585083] [USBH] host on
<6>[ 1117.585754] msm_hsusb_host msm_hsusb_host.0: Qualcomm On-Chip EHCI Host Controller
<6>[ 1117.586242] msm_hsusb_host msm_hsusb_host.0: new USB bus registered, assigned bus number 1
<6>[ 1117.591003] [CABLE] usb_status_notifier_func: cable_type = 0
<7>[ 1117.591400] [CABLE] send_cable_connect_notify: cable_type = 0
<6>[ 1117.592071] [BATT] peripheral_cable_update(0) from_owe=0
<6>[ 1117.592468] [BATT] Update SMEM: cable type 0 at 1111762850068 (2013-01-13 14:46:15.556571647 UTC)
<6>[ 1117.606140] [BATT] ID=2, level=86, vol=4063, temp=256, batt_current=84, chg_src=0, chg_en=1, full_bat=1600000, over_vchg=0, smem_vbus=1 at 1111776216768 (2013-01-13 14:46:15.570213004 UTC)
<6>[ 1117.611083] msm_hsusb_host msm_hsusb_host.0: irq 60, io mem 0xa3600000
<6>[ 1117.630737] msm_hsusb_host msm_hsusb_host.0: USB 2.0 started, EHCI 1.00
<6>[ 1117.632110] hub 1-0:1.0: USB hub found
<6>[ 1117.632324] hub 1-0:1.0: 1 port detected
<6>[ 1117.950714] usb 1-1: new high speed USB device number 2 using msm_hsusb_host
<6>[ 1118.120849] hub 1-1:1.0: USB hub found
<6>[ 1118.121124] hub 1-1:1.0: 4 ports detected
<6>[ 1136.541107] usb 1-1.2: new low speed USB device number 3 using msm_hsusb_host
<6>[ 1136.701995] input: BTC USB Multimedia Keyboard as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input7
<6>[ 1136.705749] using input dev BTC USB Multimedia Keyboard for key reset
<6>[ 1136.706481] keychord: using input dev BTC USB Multimedia Keyboard for fevent
<6>[ 1136.707763] generic-usb 0003:046E:52CF.0001: input: USB HID v1.10 Keyboard [BTC USB Multimedia Keyboard] on usb-msm_hsusb_host.0-1.2/input0
<6>[ 1136.817230] input: BTC USB Multimedia Keyboard as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.2/1-1.2:1.1/input/input8
<6>[ 1136.825622] using input dev BTC USB Multimedia Keyboard for key reset
<6>[ 1136.825836] keychord: using input dev BTC USB Multimedia Keyboard for fevent
<6>[ 1136.835693] generic-usb 0003:046E:52CF.0002: input: USB HID v1.10 Device [BTC USB Multimedia Keyboard] on usb-msm_hsusb_host.0-1.2/input1
<6>[ 1161.881195] usb 1-1.3: new low speed USB device number 4 using msm_hsusb_host
<6>[ 1162.014099] input: Logitech USB-PS/2 Optical Mouse as /devices/platform/msm_hsusb_host.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input9
<6>[ 1162.020507] generic-usb 0003:046D:C01E.0003: input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-msm_hsusb_host.0-1.3/input0

At the moment, you have to switch between peripheral mode and host mode manually, as I explained in my post above. When switching to host mode, the phone stops charging, so this isn't really OTG now.

Patching is much easier than we thought, as all necessary code already exists in the stock source code. HTC just seems to have "forgotten" one line...

I'll append a patch for HTC's ICS stock source code and the .config file I used.