[Letux-kernel] GPIOs and driver removal

Andreas Kemnade andreas at kemnade.info
Tue Nov 20 18:55:31 CET 2018


On Tue, 20 Nov 2018 17:56:28 +0100
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> Hi,
> 
> > Am 20.11.2018 um 17:14 schrieb Andreas Kemnade <andreas at kemnade.info>:
> > 
> > Hi,
> > 
> > On Tue, 20 Nov 2018 09:56:46 +0100
> > "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> >   
> >> Hi,
> >> 
> >> This is IMHO the cleanest way.
> >>   
> > At least the easiest way.
> >   
> >>> Is the gpio behavior really sane? Shouldn't gpios generally be declared as
> >>> input, output or both (and not only the inputenable in the pinmux).
> >>> Lots of strange things.    
> >> 
> >> This is special for omap. Usually one would expect that a gpio is always
> >> input and you declare it to be an output.
> >> 
> >> But on OMAP you can only enable the input by pinmux.
> >> 
> >> The reason seems to be that pinmux and gpio-controller are quite independent
> >> functions.
> >>   
> > Yes, and here I am talking about gpio-controller function only and how it
> > handled by kernel. 
> > So who is turning that on/off gpio into an input at driver removal? And why?  
> 
> Ah, now I get it...
> 
> If you remove a driver that has set it to output it is magically turned into an input?
> 
yes.

root at gta04:~# devmem2 0x49056034 w
/dev/mem opened.
Memory mapped at address 0xb6f7e000.
Value at address 0x49056034 (0xb6f7e034): 0xFFFD79FF
root at gta04:~# rmmod w2sg0004
rmmod: ERROR: Module w2sg0004 is not currently loaded
root at gta04:~# rmmod gnss_w2sg0004
root at gta04:~# devmem2 0x49056034 w
/dev/mem opened.
Memory mapped at address 0xb6fca000.
Value at address 0x49056034 (0xb6fca034): 0xFFFF79FF
root at gta04:~# 

The register is GPIO5_OE. 1 = input, 0 = output

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20181120/c2a1459f/attachment.asc>


More information about the Letux-kernel mailing list