Powered USB hub not charging phone. Kernel options? I got a powered USB 2.0 hub (ET-UP900). As power source I am using the phones charger. But if I connect the hub with my phone (SM-C115) it does not charge. If I connect the charger directly it works.

My first thought was the hub does not provide enough power. But if I do the same thing with a tablet (SM-P905), which requires more power, it does work.

Also strange: If the hub is powered it does not work. If the hub is not powered it works just fine.

As I am using a custom build kernel I am looking a dmesg and fiddling with kernel options and driver to find the correct setting.

Maybe someone can give me a hint what might work?

Alternative: Any cable I can plugin in between to charge the phone and use the USB hub? I got a OTG charging cable but it would power the USB hub instead of the phone.

UPDATE
I found something about a special cable with a resistor to get into a special AUDIODOCK mode. I did found this AUDIODOCK in the source code of a related driver I saw in dmesg drivers/misc/max77803-muic.c. Maybe I can change the driver to force this mode all the time or something like this...

UPDATE 2
In drivers/misc/max77803-muic.c I saw the CONFIG_MUIC_MAX77803_SUPPORT_OTG_AUDIO_DOCK option needs to be set and the driver I got here does not support this anyway. I guess I try to use a updated driver. With AUDIO_DOCK support implemented.
Got it running. The max77803 chip in the SM-C115 was also used in the S4 but the driver my kernel had did not support the ET-UP900 device. So I searched for newer kernel driver and found danielpanzella/P900-kernel-source. In this driver they call the device LANHUB. If you have a look at the code there are a number of other devices, too. The driver detects depending on resistor on the signal pin what type of devices is connected.

I searched the repository for LANHUB and merged those code lines into my kernel, build the kernel, installed it with odin and it worked!

The USB hub, it's network card and attached USB devices are working while I get power from the hub charging the phone.

Update

Some steps to reproduce this. I used Vagrant as enviroment to get a clean linux box running. Download NDK and the source code of the kernel and setup a cross compiler see any Kernel Tutorial:

sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
export CROSS_COMPILE=/home/vagrant/android/ndk/android-ndk-r10b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-
export ARCH=arm


Next you need to pick the right config file for your device:

cp arch/arm/configs/whatever .config


Edit the config to add a driver:

make menuconfig


For the ET-UP900 adapter goto in "Device Drivers" > "Network Device Support" > "USB Network Adapters". Select "Multi-purpose USB Networking Framework" and "SMSC LAN95XX base USB 2.0 10/100 ethernet devices"

If charing is not working look at "Device Driver" > "Misc". Enable settings with "SUPPORT_LANHUB" in it. 

Now save and exit menuconfig and build the kernel:

make bzImage


Your new kernel will be arch/arm/boot/zImage. Now you need to pack this togther with a ramdisk (Android kernel kitchen) into a boot.img and flash it to the device (Odin).

With the new kernel and the adapter attached bash command netcfg should show you eth0. Run dhcpcd -k eth0 to get an IP.

To see if something is not working have a look at dmesg.