[Letux-kernel] GPIOs and driver removal

H. Nikolaus Schaller hns at goldelico.com
Mon Nov 19 09:16:44 CET 2018


Hi,

> Am 19.11.2018 um 07:04 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> I found out something interesting about GPIOs and driver removal.
> If I rmmod the gps driver, then exporting gpio145 (on/off), it shows up as an
> *input*. The value is read as 1. That causes an interesting behavior of the gps
> module.
> Enabling pulldown via pinctrl (for testing via devmem2) seems to solve that
> problem. GPS stays off after rmmod.
> A similiar behavior I have seen for the reset gpio of the usb3322 phy.

> Unbinding the driver seems to enable that phy. manually setting the pin
> to low via OFFENABLE setting in padconf via devmem2 then disables it again.

Well, it may be that these chips have an internal weak pull-up (e.g. 1 MOhm)
on their enable-input so that they are enabled by default if the pin is not
connected.

Using the gpio in input mode reads this as "1".

Activating pull-down (e.g. 50 kOhm) makes it read as "0" on both ends.

> 
> So that are things we should have in mind when rmmod something causes
> unexpected behavior in current consumption. Remember, I had that drop in
> suspend current on the a5 when I did rmmod hci_uart.
> 
> I was not aware of this.

I wasn't as well...

IMHO there are (were) different pinmux settings for all gpios in suspend?
Those should probably applied on rmmod...

BR,
Nikolaus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20181119/4737537a/attachment.asc>


More information about the Letux-kernel mailing list