Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Charging USB devices using usbhid driver
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1656

PostPosted: Sun Apr 15, 2018 1:13 am    Post subject: Charging USB devices using usbhid driver Reply with quote

Greetings all, I was working on my Gentoo laptop today and my phone was going to die.
With no other chargers near by I plugged it in to my laptop.
And my phone started going nuts constantly notifying me the usb is plugged in then unpluged.
I had this happen before but never looked into it too much.
Code:

[Sat Apr 14 16:50:02 2018] usb 3-2: new high-speed USB device number 3 using xhci_hcd
[Sat Apr 14 16:50:02 2018] usb 3-2: New USB device found, idVendor=1004, idProduct=6300
[Sat Apr 14 16:50:02 2018] usb 3-2: New USB device strings: Mfr=1, Product=4, SerialNumber=0
[Sat Apr 14 16:50:02 2018] usb 3-2: Product: USB Charge Only Interface
[Sat Apr 14 16:50:02 2018] usb 3-2: Manufacturer: LG Electronics Inc.
[Sat Apr 14 16:50:02 2018] usbhid 3-2:1.0: couldn't find an input interrupt endpoint
[Sat Apr 14 16:50:36 2018] usb 3-2: USB disconnect, device number 3
[Sat Apr 14 16:50:37 2018] usb 3-2: new high-speed USB device number 4 using xhci_hcd
[Sat Apr 14 16:50:37 2018] usb 3-2: New USB device found, idVendor=1004, idProduct=6300
[Sat Apr 14 16:50:37 2018] usb 3-2: New USB device strings: Mfr=1, Product=4, SerialNumber=0
[Sat Apr 14 16:50:37 2018] usb 3-2: Product: USB Charge Only Interface
[Sat Apr 14 16:50:37 2018] usb 3-2: Manufacturer: LG Electronics Inc.
[Sat Apr 14 16:50:37 2018] usbhid 3-2:1.0: couldn't find an input interrupt endpoint
[Sat Apr 14 16:50:39 2018] usb 3-2: USB disconnect, device number 4
[Sat Apr 14 16:50:41 2018] usb 3-2: new high-speed USB device number 5 using xhci_hcd
[Sat Apr 14 16:50:41 2018] usb 3-2: New USB device found, idVendor=1004, idProduct=6300
[Sat Apr 14 16:50:41 2018] usb 3-2: New USB device strings: Mfr=1, Product=4, SerialNumber=0
[Sat Apr 14 16:50:41 2018] usb 3-2: Product: USB Charge Only Interface
[Sat Apr 14 16:50:41 2018] usb 3-2: Manufacturer: LG Electronics Inc.
[Sat Apr 14 16:50:41 2018] usbhid 3-2:1.0: couldn't find an input interrupt endpoint
[Sat Apr 14 16:51:12 2018] usb 3-2: USB disconnect, device number 5
[Sat Apr 14 16:51:13 2018] usb 3-2: new high-speed USB device number 6 using xhci_hcd
[Sat Apr 14 16:51:13 2018] usb 3-2: New USB device found, idVendor=1004, idProduct=6300
[Sat Apr 14 16:51:13 2018] usb 3-2: New USB device strings: Mfr=1, Product=4, SerialNumber=0
[Sat Apr 14 16:51:13 2018] usb 3-2: Product: USB Charge Only Interface
[Sat Apr 14 16:51:13 2018] usb 3-2: Manufacturer: LG Electronics Inc.


I did some digging with
Code:
lsusb -t

to discover I had plugged the phone into port 3-3 this time.
and RTFM https://www.kernel.org/doc/Documentation/usb/power-management.txt
Android phones ask what you want to do when you plug in to a computer.
they can
    [1] Just charge or
    [2] Sync via MTP
    [3] Send images via PTP whatever that is.
    [4]or there it the ADB shell for developers.

If I select option 1 just charge, linux hid driver gets triggered.
This driver seems to want to power off the phone if there is no 'activity' in the amount of time listed in this file:
Code:
/sys/bus/usb/devices/3-3/power/autosuspend_delay_ms


Code:
echo 'on' > /sys/bus/usb/devices/3-3/power/control
echo '-1" > /sys/bus/usb/devices/3-3/power/autosuspend_delay_ms

This appeared to solve the problem of the phone going nuts.
But it still disconnects/reconnects less often (next I am going to see if I can read what the charging current is)
Has anyone messed around with this and made a udev rule or script or something for charging USB devices?
Or have i overlooked some common configuration?
I wonder why linux is giving the phone a new "device number" every time.
Cheers
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Sun Apr 15, 2018 7:13 am    Post subject: Reply with quote

Quote:
I wonder why linux is giving the phone a new "device number" every time.


That's normal for USB I'm afraid. That said... Google didn't give me much, but is your usb cable or port damaged? If you can wiggle the cable around and it starts disconnecting, it's probably going bad.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Apr 15, 2018 8:10 am    Post subject: Re: Charging USB devices using usbhid driver Reply with quote

turtles wrote:
Android phones ask what you want to do when you plug in to a computer.
they can
    [1] Just charge or
    [2] Sync via MTP
    [3] Send images via PTP whatever that is.
    [4]or there it the ADB shell for developers.


Nope, it depends on the implementation, mine just emit a little sound when plug-in, i get this in my dmesg, and it is just charging.
Code:
[88311.517851] usb 1-5: new high-speed USB device number 5 using xhci_hcd
[88311.644620] usb 1-5: New USB device found, idVendor=04e8, idProduct=6860
[88311.644621] usb 1-5: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[88311.644622] usb 1-5: Product: SAMSUNG_Android
[88311.644622] usb 1-5: Manufacturer: SAMSUNG
[88311.660992] cdc_acm 1-5:1.1: ttyACM0: USB ACM device
[88311.661136] usbcore: registered new interface driver cdc_acm
[88311.661137] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Bus 001 Device 005: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Sun Apr 15, 2018 10:21 am    Post subject: Re: Charging USB devices using usbhid driver Reply with quote

krinn wrote:
Nope, it depends on the implementation, mine just emit a little sound when plug-in, i get this in my dmesg, and it is just charging.
Code:
Bus 001 Device 005: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)


Don't you get a popup complaining that it can't transfer files? That's what I get on mine after a couple minutes if I leave it in MTP mode. It still charges fine though, albeit at 500mAh. I can't stand how slow that is, so I usually just use my wall charger.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Apr 15, 2018 10:39 am    Post subject: Re: Charging USB devices using usbhid driver Reply with quote

bunder wrote:
krinn wrote:
Nope, it depends on the implementation, mine just emit a little sound when plug-in, i get this in my dmesg, and it is just charging.
Code:
Bus 001 Device 005: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)


Don't you get a popup complaining that it can't transfer files?

No, the phone gets turn on, a little bip sound, usb icon appears, and charging status change, except that, nothing
for info: model is SM-G318H, android 4.4.4
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum