maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [Announce] USB hostmode beta release (https://talk.maemo.org/showthread.php?t=65232)

Estel 2012-01-16 22:22

Re: [Announce] USB hostmode beta release
 
ivgalves, You're right. AFAIK, current HEN works flawlessly with new booston, so joerg_rw could push update to HEN, containing latest flavor of script(s).

/Estel

pali 2012-01-27 10:39

Re: [Announce] USB hostmode beta release
 
Now I have semi-working kernel driver for bq24150 chip for charging battery. I sent it to lkml for comments, see: https://lkml.org/lkml/2012/1/26/519 Driver does not have implemented current sense voltage and termination current sense voltage configuration yet.

So both kernel drivers bq2415x_charger and bq27x00_battery can be replacement for BME.

@joerg_rw:
Can you look my driver?

pali 2012-01-27 16:55

Re: [Announce] USB hostmode beta release
 
Driver update, now boost mode for usb host mode working too :-)

This driver is now included in kp51.

How to use charge:
1. turn off bme:
$ stop bme

2. load module:
$ modprobe power_supply
$ insmod ./bq2415x_charger.ko

3. select correct charge mode:
* none = limit 100mA
* host = usb host/usb charger, limit 500mA
* dedicated = dedicated - wallcharger, unlimited
$ echo host > /sys/class/power_supply/bq24150-0/mode
$ echo dedicated > /sys/class/power_supply/bq24150-0/mode

how to usb host mode:
1. turn off bme
2. connect usb device
3. load module

4. enable host mode (choose hosth, hostl, hostf):
$ echo hosth > /sys/devices/platform/musb_hdrc/mode

5. enable boost mode:
$ echo boost > /sys/class/power_supply/bq24150-0/mode

6. enumerate:
$ echo F > /proc/driver/musb_hdrc

how to stop usb host mode:
$ echo none > /sys/class/power_supply/bq24150-0/mode
$ echo peripheral > /sys/devices/platform/musb_hdrc/mode

how to revert back to bme:
1. make sure that host mode was stopped
2. unload bq2415_charger module:
$ rmmod bq2415_charger
3. start bme:
$ start bme


Now I tested both charging and usb flash disk and both worked. Please note that this driver is experimental and can cause problems!!!

rafael2k 2012-01-27 20:42

Re: [Announce] USB hostmode beta release
 
Good to hear this pali!

Do you people know what hardware is used by the USB in the N9?
How far are we from having USB hostmode for N9?

I can help testing or porting the patch for the N9 kernel.
Btw, where can I find the kernel patches of the USB hostmode work?

Best regards,
Rafael Diniz

Estel 2012-01-27 21:19

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by pali (Post 1156614)
3. select correct charge mode:
* none = limit 100mA
* host = usb host/usb charger, limit 500mA
* dedicated = dedicated - wallcharger, unlimited

Sorry if it's stupid question, but shouldn't "dedicated" be limited to 950 mA? shadowjk tested this some time ago, and increasing charging current by just by 100 mA over this limit (from 950 mA to 1050 mA), resulted in dangerous increase in heat-generation (probably, in charging chip).

/Estel

pali 2012-01-27 21:28

Re: [Announce] USB hostmode beta release
 
Sysfs entry mode setting only current limit (6-7bit of register 0x01).

Charge current (4-6bit of register 0x04) is configured by default to 950mA. (so I think you mean this property).

Same configuration is configured by charge21.sh script

avidscavenger 2012-01-30 01:15

Re: [Announce] USB hostmode beta release
 
Another related (and potentially off-topic) comment... could you also implement the 800mA current limit that the chipset provides? I think this is useful for some wall chargers that claim to deliver 1A but actually struggle to do so and end up going into thermal shutdown.

pali 2012-01-30 09:36

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by avidscavenger (Post 1157637)
Another related (and potentially off-topic) comment... could you also implement the 800mA current limit that the chipset provides? I think this is useful for some wall chargers that claim to deliver 1A but actually struggle to do so and end up going into thermal shutdown.

It is implemented. Set mode to none and manually set current_limit to 800. In my driver are implemented all possible configurations supported by bq24150 chip.

vib3 2012-02-07 09:03

Re: [Announce] USB hostmode beta release
 
Hi!

So bq2415x drivers make possible to charge n900 while in hostmode?
I would need to connect my n900 to active usb-hub in hostmode and charge it also while in hostmode.

pali 2012-02-07 10:33

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by vib3 (Post 1161565)
Hi!

So bq2415x drivers make possible to charge n900 while in hostmode?
I would need to connect my n900 to active usb-hub in hostmode and charge it also while in hostmode.

Of course. You need only select correct bq mode.


All times are GMT. The time now is 01:28.

vBulletin® Version 3.8.8